Skip to content

Commit 5fddf2f

Browse files
committed
bnxt_re/lib: Direct Verbs: Add QP man pages
Document QP related DV APIs: bnxt_re_dv_create_qp bnxt_re_dv_destroy_qp bnxt_re_dv_modify_qp bnxt_re_dv_query_qp Signed-off-by: Sriharsha Basavapatna <sriharsha.basavapatna@broadcom.com> Reviewed-by: Selvin Xavier <selvin.xavier@broadcom.com>
1 parent e2ba280 commit 5fddf2f

6 files changed

Lines changed: 259 additions & 2 deletions

File tree

providers/bnxt_re/man/CMakeLists.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,8 @@ rdma_man_pages(
77
bnxt_re_dv_umem_dereg.3.md
88
bnxt_re_dv_create_cq.3.md
99
bnxt_re_dv_destroy_cq.3.md
10+
bnxt_re_dv_create_qp.3.md
11+
bnxt_re_dv_destroy_qp.3.md
12+
bnxt_re_dv_modify_qp.3.md
13+
bnxt_re_dv_query_qp.3.md
1014
)

providers/bnxt_re/man/bnxt_re_dv.7.md

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,17 @@ The following Direct Verbs are supported:
4747

4848
Applications may register one large buffer with **bnxt_re_dv_umem_reg**(3) and
4949
pass different offsets (aligned to the device page size) and lengths when
50-
creating individual CQs.
50+
creating individual CQs or QP rings.
51+
52+
**Queue pairs**
53+
54+
- **bnxt_re_dv_create_qp**(3) creates a QP whose SQ and RQ rings are backed by
55+
memory described by prior **bnxt_re_dv_umem_reg**(3) handles and offsets. An
56+
optional doorbell region from **bnxt_re_dv_alloc_db_region**(3) may be
57+
supplied; if omitted the context default is used.
58+
- **bnxt_re_dv_destroy_qp**(3) destroys such a QP.
59+
- **bnxt_re_dv_modify_qp**(3) drives QP state transitions.
60+
- **bnxt_re_dv_query_qp**(3) queries the current attributes of a DV QP.
5161

5262
# SEE ALSO
5363

@@ -58,7 +68,11 @@ creating individual CQs.
5868
**bnxt_re_dv_umem_reg**(3),
5969
**bnxt_re_dv_umem_dereg**(3),
6070
**bnxt_re_dv_create_cq**(3),
61-
**bnxt_re_dv_destroy_cq**(3)
71+
**bnxt_re_dv_destroy_cq**(3),
72+
**bnxt_re_dv_create_qp**(3),
73+
**bnxt_re_dv_destroy_qp**(3),
74+
**bnxt_re_dv_modify_qp**(3),
75+
**bnxt_re_dv_query_qp**(3)
6276

6377
# AUTHORS
6478

Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
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\>
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
---
2+
layout: page
3+
title: bnxt_re_dv_destroy_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_destroy_qp - destroy a QP created with bnxt_re_dv_create_qp
14+
15+
# SYNOPSIS
16+
17+
```c
18+
#include <infiniband/bnxt_re_dv.h>
19+
20+
int bnxt_re_dv_destroy_qp(struct ibv_qp *ibvqp);
21+
```
22+
23+
# DESCRIPTION
24+
25+
**bnxt_re_dv_destroy_qp**() destroys a queue pair previously created by
26+
**bnxt_re_dv_create_qp**(3) using the provider's normal QP teardown path.
27+
28+
Any umem registrations used for the SQ or RQ rings may be released with
29+
**bnxt_re_dv_umem_dereg**(3) after this call returns successfully.
30+
31+
# RETURN VALUE
32+
33+
Returns 0 on success, or a non-zero error code on failure with errno set.
34+
35+
# SEE ALSO
36+
37+
**bnxt_re_dv**(7),
38+
**bnxt_re_dv_create_qp**(3),
39+
**bnxt_re_dv_modify_qp**(3),
40+
**bnxt_re_dv_umem_dereg**(3),
41+
**ibv_destroy_qp**(3)
42+
43+
# AUTHORS
44+
45+
Sriharsha Basavapatna \<sriharsha.basavapatna@broadcom.com\>,
46+
Selvin Xavier \<selvin.xavier@broadcom.com\>
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
---
2+
layout: page
3+
title: bnxt_re_dv_modify_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_modify_qp - modify attributes of a DV queue pair
14+
15+
# SYNOPSIS
16+
17+
```c
18+
#include <infiniband/bnxt_re_dv.h>
19+
20+
int bnxt_re_dv_modify_qp(struct ibv_qp *ibv_qp,
21+
struct ibv_qp_attr *attr,
22+
int attr_mask);
23+
```
24+
25+
# DESCRIPTION
26+
27+
**bnxt_re_dv_modify_qp**() modifies the attributes of a queue pair
28+
previously created with **bnxt_re_dv_create_qp**(3). It drives standard
29+
QP state transitions using *attr* and *attr_mask* following the same
30+
semantics as **ibv_modify_qp**(3).
31+
32+
# RETURN VALUE
33+
34+
Returns 0 on success, or a non-zero error code on failure with errno set.
35+
36+
# SEE ALSO
37+
38+
**bnxt_re_dv**(7),
39+
**bnxt_re_dv_create_qp**(3),
40+
**bnxt_re_dv_query_qp**(3),
41+
**ibv_modify_qp**(3)
42+
43+
# AUTHORS
44+
45+
Sriharsha Basavapatna \<sriharsha.basavapatna@broadcom.com\>,
46+
Selvin Xavier \<selvin.xavier@broadcom.com\>
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
---
2+
layout: page
3+
title: bnxt_re_dv_query_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_query_qp - query attributes of a DV queue pair
14+
15+
# SYNOPSIS
16+
17+
```c
18+
#include <infiniband/bnxt_re_dv.h>
19+
#include <rdma/ib_user_verbs.h>
20+
21+
int bnxt_re_dv_query_qp(void *qp_handle, struct ib_uverbs_qp_attr *attr);
22+
```
23+
24+
# DESCRIPTION
25+
26+
**bnxt_re_dv_query_qp**() queries the current attributes of a queue pair
27+
created with **bnxt_re_dv_create_qp**(3) and fills *attr* with the result.
28+
29+
The caller sets **attr->qp_attr_mask** to the bitmask of attributes to
30+
query before calling this function, following the same attribute mask
31+
conventions as **ibv_query_qp**(3). On success, *attr* is populated with
32+
the requested fields and **attr->qp_attr_mask** is preserved.
33+
34+
# RETURN VALUE
35+
36+
Returns 0 on success, or a non-zero error code on failure with errno set.
37+
38+
# SEE ALSO
39+
40+
**bnxt_re_dv**(7),
41+
**bnxt_re_dv_create_qp**(3),
42+
**bnxt_re_dv_modify_qp**(3),
43+
**ibv_query_qp**(3)
44+
45+
# AUTHORS
46+
47+
Sriharsha Basavapatna \<sriharsha.basavapatna@broadcom.com\>,
48+
Selvin Xavier \<selvin.xavier@broadcom.com\>

0 commit comments

Comments
 (0)