|
| 1 | +--- |
| 2 | +layout: page |
| 3 | +title: bnxt_re_dv_create_qp |
| 4 | +section: 3 |
| 5 | +tagline: Verbs |
| 6 | +date: 2026-06-05 |
| 7 | +header: "Broadcom BNXT-RE Direct Verbs Manual" |
| 8 | +footer: bnxt_re |
| 9 | +--- |
| 10 | + |
| 11 | +# NAME |
| 12 | + |
| 13 | +bnxt_re_dv_create_qp - create a queue pair using application-provided memory |
| 14 | + |
| 15 | +# SYNOPSIS |
| 16 | + |
| 17 | +```c |
| 18 | +#include <infiniband/bnxt_re_dv.h> |
| 19 | + |
| 20 | +struct ibv_qp *bnxt_re_dv_create_qp(struct ibv_pd *pd, |
| 21 | + struct bnxt_re_dv_qp_init_attr *qp_attr); |
| 22 | + |
| 23 | +struct bnxt_re_dv_qp_init_attr { |
| 24 | + /* Standard ibv parameters */ |
| 25 | + enum ibv_qp_type qp_type; |
| 26 | + uint32_t max_send_wr; |
| 27 | + uint32_t max_recv_wr; |
| 28 | + uint32_t max_send_sge; |
| 29 | + uint32_t max_recv_sge; |
| 30 | + uint32_t max_inline_data; |
| 31 | + struct ibv_cq *send_cq; |
| 32 | + struct ibv_cq *recv_cq; |
| 33 | + struct ibv_srq *srq; /* NULL if not using an SRQ */ |
| 34 | + |
| 35 | + /* Direct verbs parameters */ |
| 36 | + uint64_t qp_handle; /* opaque handle embedded in CQEs */ |
| 37 | + void *dbr_handle; /* bnxt_re_dv_alloc_db_region() handle, |
| 38 | + or NULL for the context default */ |
| 39 | + void *sq_umem_handle; /* umem handle from bnxt_re_dv_umem_reg() */ |
| 40 | + uint64_t sq_umem_offset; /* byte offset into SQ umem, page-aligned */ |
| 41 | + uint32_t sq_len; /* SQ ring length in bytes (incl. MSN area) */ |
| 42 | + uint32_t sq_slots; /* SQ depth in WQE slots */ |
| 43 | + uint32_t sq_npsn; /* number of PSN entries */ |
| 44 | + void *rq_umem_handle; /* umem handle from bnxt_re_dv_umem_reg() */ |
| 45 | + uint64_t rq_umem_offset; /* byte offset into RQ umem, page-aligned */ |
| 46 | + uint32_t rq_len; /* RQ ring length in bytes */ |
| 47 | + uint64_t comp_mask; /* reserved, set to 0 */ |
| 48 | +}; |
| 49 | +``` |
| 50 | +
|
| 51 | +# DESCRIPTION |
| 52 | +
|
| 53 | +**bnxt_re_dv_create_qp**() creates a queue pair whose send queue (SQ) and |
| 54 | +receive queue (RQ) rings are backed by memory previously registered with |
| 55 | +**bnxt_re_dv_umem_reg**(3). This allows the application to manage QP ring |
| 56 | +memory directly. |
| 57 | +
|
| 58 | +**qp_handle** is an opaque value set by the library on successful return. It |
| 59 | +is embedded in completion queue entries (CQEs) so the application can |
| 60 | +correlate completions back to this QP. The application must not set this |
| 61 | +field before the call; it is populated by the library. |
| 62 | +
|
| 63 | +**sq_umem_handle** must be a handle returned by **bnxt_re_dv_umem_reg**(3). |
| 64 | +**sq_umem_offset** is the page-aligned byte offset into that registration |
| 65 | +where the SQ ring starts. **sq_len** must cover the full ring including the |
| 66 | +MSN (message sequence number) area. **sq_slots** is the SQ depth in WQE |
| 67 | +slots and **sq_npsn** is the number of PSN entries; both must be set by the |
| 68 | +application based on the ring memory it has allocated. |
| 69 | +
|
| 70 | +**rq_umem_handle** must be a handle returned by **bnxt_re_dv_umem_reg**(3) |
| 71 | +for the RQ ring. If **srq** is set, **rq_umem_handle** and **rq_umem_offset** |
| 72 | +are ignored. |
| 73 | +
|
| 74 | +If **dbr_handle** is NULL, the context's default doorbell page is used. |
| 75 | +Otherwise it must be a pointer returned by **bnxt_re_dv_alloc_db_region**(3). |
| 76 | +
|
| 77 | +This path requires **IB_UVERBS_CORE_SUPPORT_ROBUST_UDATA** on the device |
| 78 | +when **sq_umem_handle** is provided. Callers can check for this support via |
| 79 | +**ibv_query_device_ex**(3). |
| 80 | +
|
| 81 | +# RETURN VALUE |
| 82 | +
|
| 83 | +Returns a pointer to the created **ibv_qp** on success, or NULL on failure |
| 84 | +with errno set. |
| 85 | +
|
| 86 | +# SEE ALSO |
| 87 | +
|
| 88 | +**bnxt_re_dv**(7), |
| 89 | +**bnxt_re_dv_destroy_qp**(3), |
| 90 | +**bnxt_re_dv_modify_qp**(3), |
| 91 | +**bnxt_re_dv_query_qp**(3), |
| 92 | +**bnxt_re_dv_umem_reg**(3), |
| 93 | +**bnxt_re_dv_alloc_db_region**(3), |
| 94 | +**ibv_create_qp**(3) |
| 95 | +
|
| 96 | +# AUTHORS |
| 97 | +
|
| 98 | +Sriharsha Basavapatna \<sriharsha.basavapatna@broadcom.com\>, |
| 99 | +Selvin Xavier \<selvin.xavier@broadcom.com\> |
0 commit comments