| 1 |
.\" -*- nroff -*- |
| 2 |
.\" Licensed under the OpenIB.org BSD license (FreeBSD Variant) - See COPYING.md |
| 3 |
.\" |
| 4 |
.TH IBV_CREATE_WQ 3 2016-07-27 libibverbs "Libibverbs Programmer's Manual" |
| 5 |
.SH "NAME" |
| 6 |
ibv_create_wq, ibv_destroy_wq \- create or destroy a Work Queue (WQ). |
| 7 |
.SH "SYNOPSIS" |
| 8 |
.nf |
| 9 |
.B #include <infiniband/verbs.h> |
| 10 |
.sp |
| 11 |
.BI "struct ibv_wq *ibv_create_wq(struct ibv_context " "*context," |
| 12 |
.BI " struct ibv_wq_init_attr " "*wq_init_attr" ); |
| 13 |
.sp |
| 14 |
.BI "int ibv_destroy_wq(struct ibv_wq " "*wq" ); |
| 15 |
.fi |
| 16 |
.SH "DESCRIPTION" |
| 17 |
.B ibv_create_wq() |
| 18 |
creates a WQ associated with the ibv_context |
| 19 |
.I context\fR. |
| 20 |
The argument |
| 21 |
.I wq_init_attr |
| 22 |
is an ibv_wq_init_attr struct, as defined in <infiniband/verbs.h>. |
| 23 |
.PP |
| 24 |
.nf |
| 25 |
struct ibv_wq_init_attr { |
| 26 |
.in +8 |
| 27 |
void *wq_context; /* Associated context of the WQ */ |
| 28 |
enum ibv_wq_type wq_type; /* WQ type */ |
| 29 |
uint32_t max_wr; /* Requested max number of outstanding WRs in the WQ */ |
| 30 |
uint32_t max_sge; /* Requested max number of scatter/gather (s/g) elements per WR in the WQ */ |
| 31 |
struct ibv_pd *pd; /* PD to be associated with the WQ */ |
| 32 |
struct ibv_cq *cq; /* CQ to be associated with the WQ */ |
| 33 |
uint32_t comp_mask; /* Identifies valid fields. Use ibv_wq_init_attr_mask */ |
| 34 |
uint32_t create_flags /* Creation flags for this WQ, use enum ibv_wq_flags */ |
| 35 |
.in -8 |
| 36 |
}; |
| 37 |
|
| 38 |
.sp |
| 39 |
.nf |
| 40 |
enum ibv_wq_flags { |
| 41 |
.in +8 |
| 42 |
IBV_WQ_FLAGS_CVLAN_STRIPPING = 1 << 0, /* CVLAN field will be stripped from incoming packets */ |
| 43 |
IBV_WQ_FLAGS_SCATTER_FCS = 1 << 1, /* FCS field will be scattered to host memory */ |
| 44 |
IBV_WQ_FLAGS_DELAY_DROP = 1 << 2, /* Packets won't be dropped immediately if no receive WQEs */ |
| 45 |
IBV_WQ_FLAGS_PCI_WRITE_END_PADDING = 1 << 3, /* Incoming packets will be padded to cacheline size */ |
| 46 |
IBV_WQ_FLAGS_RESERVED = 1 << 4, |
| 47 |
.in -8 |
| 48 |
}; |
| 49 |
.nf |
| 50 |
.fi |
| 51 |
.PP |
| 52 |
The function |
| 53 |
.B ibv_create_wq() |
| 54 |
will update the |
| 55 |
.I wq_init_attr\fB\fR->max_wr |
| 56 |
and |
| 57 |
.I wq_init_attr\fB\fR->max_sge |
| 58 |
fields with the actual \s-1WQ\s0 values of the WQ that was created; |
| 59 |
the values will be greater than or equal to the values requested. |
| 60 |
.PP |
| 61 |
.B ibv_destroy_wq() |
| 62 |
destroys the WQ |
| 63 |
.I wq\fR. |
| 64 |
.SH "RETURN VALUE" |
| 65 |
.B ibv_create_wq() |
| 66 |
returns a pointer to the created WQ, or NULL if the request fails. |
| 67 |
.PP |
| 68 |
.B ibv_destroy_wq() |
| 69 |
returns 0 on success, or the value of errno on failure (which indicates the failure reason). |
| 70 |
.SH "SEE ALSO" |
| 71 |
.BR ibv_modify_wq (3), |
| 72 |
.SH "AUTHORS" |
| 73 |
.TP |
| 74 |
Yishai Hadas <[email protected]> |