| 1 |
.\" -*- nroff -*- |
| 2 |
.\" Licensed under the OpenIB.org BSD license (FreeBSD Variant) - See COPYING.md |
| 3 |
.\" |
| 4 |
.TH IBV_POST_SRQ_OPS 3 2017-03-26 libibverbs "Libibverbs Programmer's Manual" |
| 5 |
.SH "NAME" |
| 6 |
ibv_post_srq_ops \- perform on a special shared receive queue (SRQ) |
| 7 |
configuration manipulations |
| 8 |
.SH "SYNOPSIS" |
| 9 |
.nf |
| 10 |
.B #include <infiniband/verbs.h> |
| 11 |
.sp |
| 12 |
.BI "int ibv_post_srq_ops(struct ibv_srq " "*srq" ", struct ibv_ops_wr " "*wr" , |
| 13 |
.BI " struct ibv_ops_wr " "**bad_wr" ); |
| 14 |
.fi |
| 15 |
.SH "DESCRIPTION" |
| 16 |
The |
| 17 |
.B ibv_post_srq_ops() |
| 18 |
performs series of offload configuration manipulations on special types of SRQ |
| 19 |
.I srq\fR. Currenlty it is used to configure tag matching SRQ. Series of configuration |
| 20 |
operations defined by linked lists of struct ibv_ops_wr elements starting from |
| 21 |
.I wr. |
| 22 |
.PP |
| 23 |
.nf |
| 24 |
struct ibv_ops_wr { |
| 25 |
.in +8 |
| 26 |
uint64_t wr_id; /* User defined WR ID */ |
| 27 |
/* Pointer to next WR in list, NULL if last WR */ |
| 28 |
struct ibv_ops_wr *next; |
| 29 |
enum ibv_ops_wr_opcode opcode; /* From enum ibv_ops_wr_opcode */ |
| 30 |
int flags; /* From enum ibv_ops_flags */ |
| 31 |
struct { |
| 32 |
.in +8 |
| 33 |
/* Number of unexpected messages |
| 34 |
* handled by SW */ |
| 35 |
uint32_t unexpected_cnt; |
| 36 |
/* Input parameter for the DEL opcode |
| 37 |
* and output parameter for the ADD opcode */ |
| 38 |
uint32_t handle; |
| 39 |
struct { |
| 40 |
.in +8 |
| 41 |
uint64_t recv_wr_id; /* User defined WR ID for TM_RECV */ |
| 42 |
struct ibv_sge *sg_list; /* Pointer to the s/g array */ |
| 43 |
int num_sge; /* Size of the s/g array */ |
| 44 |
uint64_t tag; |
| 45 |
uint64_t mask; /* Incoming message considered matching if |
| 46 |
TMH.tag & entry.mask == entry.tag */ |
| 47 |
.in -8 |
| 48 |
} add; |
| 49 |
.in -8 |
| 50 |
} tm; |
| 51 |
.in -8 |
| 52 |
}; |
| 53 |
.fi |
| 54 |
.PP |
| 55 |
First part of struct ibv_ops_wr retains ibv_send_wr notion. |
| 56 |
Opcode defines operation to perform. Currently supported IBV_WR_TAG_ADD, |
| 57 |
IBV_WR_TAG_DEL and IBV_WR_TAG_SYNC values. See below for detailed |
| 58 |
description. |
| 59 |
.PP |
| 60 |
To allow reliable data delivery TM SRQ maintains special low level |
| 61 |
synchronization primitive - phase synchronization. Receive side message |
| 62 |
handling comprises two concurrent activities - posting tagged buffers by |
| 63 |
SW and receiving incoming messages by HW. This process considered |
| 64 |
coherent only if all unexpected messages received by HW is completely |
| 65 |
processed in SW. To pass to hardware number of processed unexpected |
| 66 |
messages unexpected_cnt field should be used and IBV_OPS_TM_SYNC flag |
| 67 |
should be set. |
| 68 |
.PP |
| 69 |
To request WC for tag list operations IBV_OPS_SIGNALED flags should be |
| 70 |
passed. In this case WC will be generated on TM SRQ's CQ, provided wr_id |
| 71 |
will identify WC. |
| 72 |
.PP |
| 73 |
Opcode IBV_WR_TAG_ADD used to add tag entry to tag matching list. |
| 74 |
Tag entry consists of SGE list, tag & mask (matching parameters), |
| 75 |
user specified opaque wr_id (passed via recv_wr_id field) and uniquely |
| 76 |
identified by handle (returned by driver). |
| 77 |
Size of tag matching list is limited by max_num_tags. |
| 78 |
SGE list size is limited by max_sge. |
| 79 |
.PP |
| 80 |
Opcode IBV_WR_TAG_DEL removes previously added tag entry. |
| 81 |
Field handle should be set to value returned by previously performed |
| 82 |
IBV_WR_TAG_ADD operation. |
| 83 |
Operation may fail due to concurrent tag consumption - in this case IBV_WC_TM_ERR |
| 84 |
status will be returned in WC. |
| 85 |
.PP |
| 86 |
Opcode IBV_WR_TAG_SYNC may be used if no changes to matching list |
| 87 |
required, just to updated unexpected messages counter. |
| 88 |
.PP |
| 89 |
IBV_WC_TM_SYNC_REQ flag returned in list operation WC shows that counter |
| 90 |
synchronization required. This flag also may be returned by unexpected receive WC, |
| 91 |
asking for IBV_WR_TAG_SYNC operation to keep TM coherence consistency. |
| 92 |
.SH "RETURN VALUE" |
| 93 |
.B ibv_post_srq_ops() |
| 94 |
returns 0 on success, or the value of errno on failure (which indicates the |
| 95 |
failure reason). |
| 96 |
.SH "SEE ALSO" |
| 97 |
.BR ibv_create_srq_ex (3), |
| 98 |
.SH "AUTHORS" |
| 99 |
.TP |
| 100 |
Artemy Kovalyov <[email protected]> |