Skip to content

bnxt_re/lib: Add uverbs object handle path for CQ/SRQ toggle page#1761

Open
selvintxavier wants to merge 2 commits into
linux-rdma:masterfrom
selvintxavier:new_cq_srq_toggle_obj
Open

bnxt_re/lib: Add uverbs object handle path for CQ/SRQ toggle page#1761
selvintxavier wants to merge 2 commits into
linux-rdma:masterfrom
selvintxavier:new_cq_srq_toggle_obj

Conversation

@selvintxavier

Copy link
Copy Markdown
Contributor

The kernel driver supports two paths for the GET_TOGGLE_MEM ioctl:

- Legacy path (older kernels / older rdma-core): the caller sends
  BNXT_RE_TOGGLE_MEM_TYPE (enum: CQ or SRQ) and BNXT_RE_TOGGLE_MEM_RES_ID
  (the hardware queue ID). The kernel performs an XArray lookup per
  ucontext to find the toggle page.

- New path (new kernel + new rdma-core): the caller sends a uverbs
  object handle (BNXT_RE_TOGGLE_MEM_CQ_HANDLE or
  BNXT_RE_TOGGLE_MEM_SRQ_HANDLE). The kernel resolves the uobject
  directly, with built-in ownership verification and pinning.

During alloc_ucontext, lib  now sets the new request bit
BNXT_RE_COMP_MASK_REQ_UCNTX_TOGGLE_MEM_UOBJ_SUPPORT to advertise
uobj-handle capability. If the kernel responds with
BNXT_RE_UCNTX_CMASK_TOGGLE_MEM_UOBJ_SUPPORT. Based on the negotiated
capability, new path will be selected.

@selvintxavier
selvintxavier force-pushed the new_cq_srq_toggle_obj branch from e564447 to 67129b6 Compare June 22, 2026 05:35
To commit: ?? ("RDMA/bnxt_re: Add uverbs object handle path for CQ/SRQ
toggle page").

Signed-off-by: Selvin Xavier <selvin.xavier@broadcom.com>
The kernel driver supports two paths for the GET_TOGGLE_MEM ioctl:

- Legacy path (older kernels / older rdma-core): the caller sends
  BNXT_RE_TOGGLE_MEM_TYPE (enum: CQ or SRQ) and BNXT_RE_TOGGLE_MEM_RES_ID
  (the hardware queue ID). The kernel performs an XArray lookup per
  ucontext to find the toggle page.

- New path (new kernel + new rdma-core): the caller sends a uverbs
  object handle (BNXT_RE_TOGGLE_MEM_CQ_HANDLE or
  BNXT_RE_TOGGLE_MEM_SRQ_HANDLE). The kernel resolves the uobject
  directly, with built-in ownership verification and pinning.

During alloc_ucontext, lib  now sets the new request bit
BNXT_RE_COMP_MASK_REQ_UCNTX_TOGGLE_MEM_UOBJ_SUPPORT to advertise
uobj-handle capability. If the kernel responds with
BNXT_RE_UCNTX_CMASK_TOGGLE_MEM_UOBJ_SUPPORT. Based on the negotiated
capability, new path will be selected.

Signed-off-by: Selvin Xavier <selvin.xavier@broadcom.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant