1IBV_CREATE_WQ(3) Libibverbs Programmer's Manual IBV_CREATE_WQ(3)
2
3
4
6 ibv_create_wq, ibv_destroy_wq - create or destroy a Work Queue (WQ).
7
9 #include <infiniband/verbs_exp.h>
10
11 struct ibv_wq *ibv_create_wq(struct ibv_context *context,
12 struct ibv_wq_init_attr *wq_init_attr);
13
14 int ibv_destroy_wq(struct ibv_wq *wq);
15
17 ibv_create_wq() creates a WQ associated with the ibv_context context.
18 The argument wq_init_attr is an ibv_wq_init_attr struct, as defined in
19 <infiniband/verbs.h>.
20
21 struct ibv_wq_init_attr {
22 void *wq_context; /* Associated context of the WQ */
23 enum ibv_wq_type wq_type; /* WQ type */
24 uint32_t max_wr; /* Requested max number of outstanding WRs in the WQ */
25 uint32_t max_sge; /* Requested max number of scatter/gather (s/g) elements per WR in the WQ */
26 struct ibv_pd *pd; /* PD to be associated with the WQ */
27 struct ibv_cq *cq; /* CQ to be associated with the WQ */
28 uint32_t comp_mask; /* Identifies valid fields. Use ibv_wq_init_attr_mask */
29 uint32_t create_flags /* Creation flags for this WQ, use enum ibv_wq_flags */
30 };
31
32
33 enum ibv_wq_flags {
34 IBV_WQ_FLAGS_CVLAN_STRIPPING = 1 << 0, /* CVLAN field will be stripped from incoming packets */
35 IBV_WQ_FLAGS_SCATTER_FCS = 1 << 1, /* FCS field will be scattered to host memory */
36 IBV_WQ_FLAGS_DELAY_DROP = 1 << 2, /* Packets won't be dropped immediately if no receive WQEs */
37 IBV_WQ_FLAGS_PCI_WRITE_END_PADDING = 1 << 3, /* Incoming packets will be padded to cacheline size */
38 IBV_WQ_FLAGS_RESERVED = 1 << 4,
39 };
40
41 The function ibv_create_wq() will update the wq_init_attr->max_wr and
42 wq_init_attr->max_sge fields with the actual WQ values of the WQ that
43 was created; the values will be greater than or equal to the values
44 requested.
45
46 ibv_destroy_wq() destroys the WQ wq.
47
49 ibv_create_wq() returns a pointer to the created WQ, or NULL if the
50 request fails.
51
52 ibv_destroy_wq() returns 0 on success, or the value of errno on failure
53 (which indicates the failure reason).
54
56 ibv_modify_wq(3),
57
59 Yishai Hadas <yishaih@mellanox.com>
60
61
62
63libibverbs 2016-07-27 IBV_CREATE_WQ(3)