Skip to content

Conversation

@sbasavapatna
Copy link

Hi,

This patchset supports Direct Verbs in the bnxt_re library.

This is required by vendor specific applications that need to manage
the HW resources directly and to implement the datapath in the
application.

To support this, the library and the driver are being enhanced to
provide Direct Verbs using which the application can allocate and
manage the HW resources (Queues, Doorbell etc) . The Direct Verbs
enable the application to implement the control path.

Patch#1 Support debug logging
Patch#2 Update kernel headers
Patch#3 Support dbr and umem direct verbs
Patch#4 Support cq and qp direct verbs

Thanks,
-Harsha

@jgunthorpe
Copy link
Member

Please take the debug_file stuff out of here, I'm not keen on every driver implementing their own stuff. We already have tracing frameworks supported, why not use one?

struct bnxt_re_dv_db_region_attr *attr);
int bnxt_re_dv_get_default_db_region(struct ibv_context *ibvctx,
struct bnxt_re_dv_db_region_attr *out);
void *bnxt_re_dv_umem_reg(struct ibv_context *ibvctx,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

void *? That shouldn't be. Why do you have these functions when there is no kernel side?

sbasavapatna and others added 3 commits December 24, 2025 08:35
To commit: ?? ("RDMA/bnxt_re: Direct Verbs: Support CQ and QP verbs").

Signed-off-by: Sriharsha Basavapatna <sriharsha.basavapatna@broadcom.com>
The following Direct Verb (DV) APIs have been implemented in
this patch.

Doorbell Region Direct Verbs:
-----------------------------
- bnxt_re_dv_alloc_db_region():
  This will allow the appliation to create extra doorbell regions
  and use the associated doorbell page index in dv_create_qp() and
  use the associated DB address while ringing the doorbell.

- bnxt_re_dv_free_db_region():
  Free the allocated doorbell region.

- bnxt_re_dv_get_default_db_region():
  Return the default doorbell page index and doorbell page address
  associated with the ucontext.

Umem Registration Direct Verbs:
-------------------------------
- bnxt_re_dv_umem_reg():
  Register the user memory to be used by the application with
  the library. Application can register a large chunk of memory and
  use it during subsequent resource creation DV APIs.

  Note that the API terminates in the library and the app specified
  memory params (addr, len) are saved and a umem-handle is returned.
  That is, there is no ioctl to the driver at this point to map/pin
  the user memory.

  This memory is mapped/pinned later when the application creates
  the required resources (CQ/QP) using respective direct verbs.
  This is implemented in the next patch in this series.

- bnxt_re_dv_umem_dereg():
  Deregister the user memory specified by the umem-handle.

Co-developed-by: Sriharsha Basavapatna <sriharsha.basavapatna@broadcom.com>
Signed-off-by: Sriharsha Basavapatna <sriharsha.basavapatna@broadcom.com>
Signed-off-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Reviewed-by: Selvin Thyparampil Xavier <selvin.xavier@broadcom.com>
The following Direct Verb (DV) APIs have been implemented in
this patch. These are implemented by enhancing the driver
specific udata in existing verbs.

CQ Direct Verbs:
----------------
- bnxt_re_dv_create_cq():
  Create a CQ of requested size (cqe). The application must have
  already registered this memory using bnxt_re_dv_umem_reg().
  The CQ umem-handle and umem-offset provided by the application
  are translated into an address for mapping and passed to the
  driver.

- bnxt_re_dv_destroy_cq():
  Destroy the DV_CQ created earlier.

QP Direct Verbs:
----------------
- bnxt_re_dv_create_qp():
  Create a QP using specified params (struct bnxt_re_dv_qp_init_attr).
  The application must have already registered SQ/RQ memory using
  bnxt_re_dv_umem_reg(). The SQ/RQ umem-handle and umem-offset provided
  by the application are translated into an address for mapping and
  passed to the driver.

- bnxt_re_dv_destroy_qp():
  Destroy the DV_QP created earlier.

- bnxt_re_dv_modify_qp():
  Modify QP attributes of the DV_QP.

- bnxt_re_dv_query_qp():
  Return QP attributes of the DV_QP.

Note:
-----
Some applications might want to allocate memory for all resources of a
given type (CQ/QP) in one big chunk and then register that entire
memory once using dv_umem_reg(). At the time of creating each individual
resource, the application should pass a specific offset/length in the
umem registered memory.

Signed-off-by: Sriharsha Basavapatna <sriharsha.basavapatna@broadcom.com>
Co-developed-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Signed-off-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Co-developed-by: Selvin Xavier <selvin.xavier@broadcom.com>
Signed-off-by: Selvin Xavier <selvin.xavier@broadcom.com>
@sbasavapatna
Copy link
Author

sbasavapatna commented Dec 24, 2025 via email

@sbasavapatna
Copy link
Author

sbasavapatna commented Dec 24, 2025 via email

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.

2 participants