Page MenuHomeFreeBSD

ibcore: Avoid quadratic uverbs ID allocation
Needs ReviewPublic

Authored by rafal.lewandowski_intel.com on Tue, Oct 6, 1:29 PM.
Tags
None
Referenced Files
Unknown Object (File)
Tue, Oct 13, 8:08 AM
Unknown Object (File)
Mon, Oct 12, 10:59 PM
Unknown Object (File)
Sat, Oct 10, 7:48 PM
Unknown Object (File)
Sat, Oct 10, 6:27 PM
Unknown Object (File)
Sat, Oct 10, 1:05 PM
Unknown Object (File)
Sat, Oct 10, 12:18 PM
Unknown Object (File)
Fri, Oct 9, 2:20 AM
Unknown Object (File)
Fri, Oct 9, 2:02 AM
Subscribers

Details

Summary

FreeBSD's LinuxKPI xa_alloc() starts at index zero for each allocation.
The per-file uverbs XArray holds protection domains, completion queues,
queue pairs, and memory regions. As the number of live objects grows,
each new handle probes all occupied lower IDs, making large connection
setups increasingly expensive.

Keep the optimization in the OFED uverbs caller: track the next candidate
ID in ib_uverbs_file, reserve under the XArray lock, and advance the
cursor on success. On a collision, search forward and wrap through the
32-bit handle space. Existing lookup, commit, erase, and destruction
paths are unchanged. Freed lower IDs are reused after wraparound.

Signed-off-by: Lewandowski, Rafal <rafal.lewandowski@intel.com>
Sponsored by: Intel Corporation

Test Plan

The validation team tested the RDMA connection-scaling fix on both peers and confirmed that connection setup and data transfers completed successfully.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped