Page MenuHomeFreeBSD

ofed: don't stop removing stale RoCE GIDs at the first hole
ClosedPublic

Authored by aehrenberg_nvidia.com on Tue, Jul 28, 8:57 AM.
Tags
None
Referenced Files
Unknown Object (File)
Fri, Aug 21, 9:09 PM
Unknown Object (File)
Fri, Aug 21, 3:20 AM
Unknown Object (File)
Thu, Aug 20, 4:44 PM
Unknown Object (File)
Tue, Aug 11, 1:38 PM
Unknown Object (File)
Tue, Aug 11, 8:46 AM
Unknown Object (File)
Tue, Aug 11, 8:29 AM
Unknown Object (File)
Tue, Aug 11, 8:18 AM
Unknown Object (File)
Tue, Aug 11, 4:23 AM
Subscribers

Details

Summary

When cleaning up stale GIDs the scan stopped as soon as
rdma_get_gid_attr() failed. But that can also happen for empty entries
in the middle of the table, so a single gap left everything after it
behind and the GID entries could eventually run out.

Now the whole table is scanned and the empty slots are simply skipped.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

aehrenberg_nvidia.com edited the test plan for this revision. (Show Details)
sys/ofed/drivers/infiniband/core/ib_roce_gid_mgmt.c
216

Why is the value initialized so early?
IMO it should be done right before the loop that uses it.

BTW, what guarantees the stability of the gid table?

jhb added inline comments.
sys/ofed/drivers/infiniband/core/ib_roce_gid_mgmt.c
216

I agree with @kib on moving the initialization down to just before the loop. In particular, I believe roce_gid_enum_netdev_default() might grow the table so the length might be stale?

For @kib's second question, I think it's ok if the table is changed concurrently, it might be that we might miss a stale GID if it grows a new stale entry concurrently, but presumably 1) new entries shouldn't be stale and 2) we'd converge eventually.

278

I believe my assumption when I updated this code is that the table wouldn't have holes which is why I had written the loop the way it was. But my asssumption could easily be false in which case I think this is fine once you move the initialization down to just before the loop starts.

This revision is now accepted and ready to land.Thu, Jul 30, 12:48 PM

Per kib and jhb comments, gid_tbl_len initialization moved down just before the loop in which it is used.

This revision now requires review to proceed.Sun, Aug 2, 7:25 AM
This revision is now accepted and ready to land.Sun, Aug 2, 3:34 PM