1IBV_POST_SRQ_OPS(3)     Libibverbs Programmer's Manual     IBV_POST_SRQ_OPS(3)
2
3
4

NAME

6       ibv_post_srq_ops - perform on a special shared receive queue (SRQ) con‐
7       figuration manipulations
8

SYNOPSIS

10       #include <infiniband/verbs.h>
11
12       int ibv_post_srq_ops(struct ibv_srq *srq, struct ibv_ops_wr *wr,
13                            struct ibv_ops_wr **bad_wr);
14

DESCRIPTION

16       The ibv_post_srq_ops() performs series of offload configuration manipu‐
17       lations  on special types of SRQ srq. Currenlty it is used to configure
18       tag matching SRQ. Series of configuration operations defined by  linked
19       lists of struct ibv_ops_wr elements starting from wr.
20
21       struct ibv_ops_wr {
22               uint64_t                wr_id;   /* User defined WR ID */
23               /* Pointer to next WR in list, NULL if last WR */
24               struct ibv_ops_wr      *next;
25               enum ibv_ops_wr_opcode  opcode;  /* From enum ibv_ops_wr_opcode */
26               int                     flags;   /* From enum ibv_ops_flags */
27               struct {
28                       /* Number of unexpected messages
29                        * handled by SW */
30                       uint32_t unexpected_cnt;
31                       /* Input parameter for the DEL opcode
32                        * and output parameter for the ADD opcode */
33                       uint32_t handle;
34                       struct {
35                               uint64_t                recv_wr_id;   /* User defined WR ID for TM_RECV */
36                               struct ibv_sge         *sg_list; /* Pointer to the s/g array */
37                               int                     num_sge; /* Size of the s/g array */
38                               uint64_t                tag;
39                               uint64_t                mask;    /* Incoming message considered matching if
40                                                                   TMH.tag & entry.mask == entry.tag */
41                       } add;
42               } tm;
43       };
44
45       First  part  of  struct  ibv_ops_wr retains ibv_send_wr notion.  Opcode
46       defines  operation  to  perform.  Currently  supported  IBV_WR_TAG_ADD,
47       IBV_WR_TAG_DEL  and  IBV_WR_TAG_SYNC  values.  See  below  for detailed
48       description.
49
50       To allow reliable data delivery TM SRQ maintains special low level syn‐
51       chronization  primitive  -  phase synchronization. Receive side message
52       handling comprises two concurrent activities - posting  tagged  buffers
53       by  SW  and  receiving incoming messages by HW. This process considered
54       coherent only if all unexpected messages received by HW  is  completely
55       processed  in  SW.  To  pass to hardware number of processed unexpected
56       messages unexpected_cnt field should be used and  IBV_OPS_TM_SYNC  flag
57       should be set.
58
59       To  request WC for tag list operations IBV_OPS_SIGNALED flags should be
60       passed. In this case WC will be generated  on  TM  SRQ's  CQ,  provided
61       wr_id will identify WC.
62
63       Opcode  IBV_WR_TAG_ADD used to add tag entry to tag matching list.  Tag
64       entry consists of SGE list, tag  &  mask  (matching  parameters),  user
65       specified opaque wr_id (passed via recv_wr_id field) and uniquely iden‐
66       tified by handle (returned by driver).  Size of tag  matching  list  is
67       limited by max_num_tags.  SGE list size is limited by max_sge.
68
69       Opcode IBV_WR_TAG_DEL removes previously added tag entry.  Field handle
70       should be set to value returned by previously performed  IBV_WR_TAG_ADD
71       operation.   Operation  may fail due to concurrent tag consumption - in
72       this case IBV_WC_TM_ERR status will be returned in WC.
73
74       Opcode IBV_WR_TAG_SYNC may be used  if  no  changes  to  matching  list
75       required, just to updated unexpected messages counter.
76
77       IBV_WC_TM_SYNC_REQ  flag  returned  in  list  operation  WC  shows that
78       counter synchronization required. This flag also  may  be  returned  by
79       unexpected  receive WC, asking for IBV_WR_TAG_SYNC operation to keep TM
80       coherence consistency.
81

RETURN VALUE

83       ibv_post_srq_ops() returns 0 on success, or the value of errno on fail‐
84       ure (which indicates the failure reason).
85

SEE ALSO

87       ibv_create_srq_ex(3),
88

AUTHORS

90       Artemy Kovalyov <artemyko@mellanox.com>
91
92
93
94libibverbs                        2017-03-26               IBV_POST_SRQ_OPS(3)
Impressum