summaryrefslogtreecommitdiff
path: root/tools/perf/scripts/python/export-to-sqlite.py
diff options
context:
space:
mode:
authorSelvin Xavier <selvin.xavier@broadcom.com>2026-07-21 04:54:37 -0700
committerLeon Romanovsky <leon@kernel.org>2026-07-28 08:03:10 -0400
commit97eafb59d41e62ae54bb7ec61004409d02b7dc74 (patch)
treedbb51da0950d603ad8b824832c2648467d9849db /tools/perf/scripts/python/export-to-sqlite.py
parentba7f6f2f168081482919529f50c5aea802997f43 (diff)
RDMA/bnxt_re: Replace per-device hash tables with per-context XArrays
The CQ and SRQ hash tables (cq_hash, srq_hash) on struct bnxt_re_dev were used exclusively to look up a toggle-page pointer from a user-space-supplied hardware queue ID in the GET_TOGGLE_MEM ioctl handler. This approach has couple of problems. First, because the tables are per-device, any user can look up another user's CQ or SRQ by guessing the hardware queue ID. Second, concurrent add and remove operations on the hash table are not protected by any lock, leaving a race window. The correct fix is to retrieve the CQ and SRQ objects via the uverbs object handle, which gives built-in ownership verification and reference pinning for the duration of the ioctl. That is added in a later patch of this series. To maintain backward compatibility with older rdma-core versions that do not send a uverbs object handle, the driver must continue to support the existing TYPE + RES_ID lookup path. This patch replaces the per-device hash tables with per-ucontext XArrays (cq_xa and srq_xa on struct bnxt_re_ucontext), which narrows the lookup scope to the calling context, eliminating the cross-user visibility. Also adds Xarray locking mechanism for synchronization. The GET_TOGGLE_MEM ioctl handler is updated to call xa_load() in place of the now-removed bnxt_re_search_for_cq()/ bnxt_re_search_for_srq() helpers. No ABI changes are required. bnxt_re_create_user_cq()/bnxt_re_create_srq() publish the uobject into cq_xa/srq_xa before returning to the uverbs core, but the core only sets uobject->object once the create callback has returned success. Guard the lookup against this so a concurrent GET_TOGGLE_MEM racing an in-progress create cannot feed a NULL ->object into container_of(). Signed-off-by: Selvin Xavier <selvin.xavier@broadcom.com> Signed-off-by: Leon Romanovsky <leon@kernel.org>
Diffstat (limited to 'tools/perf/scripts/python/export-to-sqlite.py')
0 files changed, 0 insertions, 0 deletions