@@ -144,3 +144,25 @@ following attributes:
* **flags** - the following flags are currently defined:
- IBV_TM_CAP_RC - Support tag matching on RC transport
+
+### TM-SRQ creation
+
+TM-SRQs are created by the ibv_create_srq_ex() Verb, which accepts the
+following new attributes:
+* **srq_type** - set to **IBV_SRQT_TM**
+* **comp_mask** - set the **IBV_SRQ_INIT_ATTR_TM** flag
+* **tm_cap** - TM properties for this TM-SRQ; defined as follows:
+
+```h
+struct ibv_tm_cap {
+ uint32_t max_num_tags; /* Matching list size */
+ uint32_t max_ops; /* Number of outstanding TM operations */
+}
+```
+Similarly to XRC SRQs, a TM-SRQ has a dedicated CQ.
+
+RC QPs are associated with the TM-SRQ just like standard SRQs. However, the
+ownership of the QP's Send Queue is passed to the TM-SRQ, which uses it to
+initiate rendezvous RDMA-Reads. Receive completions are reported to the
+TM-SRQ's CQ.
+
@@ -720,6 +720,17 @@ int ibv_cmd_create_srq_ex(struct ibv_context *context,
vxrcd = container_of(attr_ex->xrcd, struct verbs_xrcd, xrcd);
cmd->xrcd_handle = vxrcd->handle;
cmd->cq_handle = attr_ex->cq->handle;
+ } else if (attr_ex->comp_mask & IBV_SRQ_INIT_ATTR_TM) {
+ if (cmd->srq_type != IBV_SRQT_TM)
+ return EINVAL;
+ if (!(attr_ex->comp_mask & IBV_SRQ_INIT_ATTR_CQ) ||
+ !attr_ex->tm_cap.max_num_tags)
+ return EINVAL;
+
+ cmd->cq_handle = attr_ex->cq->handle;
+ cmd->max_num_tags = attr_ex->tm_cap.max_num_tags;
+ } else if (cmd->srq_type != IBV_SRQT_BASIC) {
+ return EINVAL;
}
if (write(context->cmd_fd, cmd, cmd_size) != cmd_size)
@@ -1126,7 +1126,7 @@ struct ibv_create_xsrq {
__u32 max_wr;
__u32 max_sge;
__u32 srq_limit;
- __u32 reserved;
+ __u32 max_num_tags;
__u32 xrcd_handle;
__u32 cq_handle;
__u64 driver_data[0];
@@ -26,10 +26,11 @@ struct ibv_srq_init_attr_ex {
void *srq_context; /* Associated context of the SRQ */
struct ibv_srq_attr attr; /* SRQ attributes */
uint32_t comp_mask; /* Identifies valid fields */
-enum ibv_srq_type srq_type; /* Basic / XRC */
+enum ibv_srq_type srq_type; /* Basic / XRC / tag matching */
struct ibv_pd *pd; /* PD associated with the SRQ */
struct ibv_xrcd *xrcd; /* XRC domain to associate with the SRQ */
struct ibv_cq *cq; /* CQ to associate with the SRQ for XRC mode */
+struct ibv_tm_cap tm_cap; /* Tag matching attributes */
.in -8
};
.sp
@@ -41,6 +42,16 @@ uint32_t max_sge; /* Requested max number of scatter eleme
uint32_t srq_limit; /* The limit value of the SRQ */
.in -8
};
+.sp
+.nf
+struct ibv_tm_cap {
+.in +8
+uint32_t max_num_tags; /* Tag matching list size */
+uint32_t max_ops; /* Number of outstanding tag list operations */
+.in -8
+};
+.sp
+.nf
.fi
.PP
The function
@@ -673,7 +673,8 @@ struct ibv_srq_init_attr {
enum ibv_srq_type {
IBV_SRQT_BASIC,
- IBV_SRQT_XRC
+ IBV_SRQT_XRC,
+ IBV_SRQT_TM,
};
enum ibv_srq_init_attr_mask {
@@ -681,7 +682,13 @@ enum ibv_srq_init_attr_mask {
IBV_SRQ_INIT_ATTR_PD = 1 << 1,
IBV_SRQ_INIT_ATTR_XRCD = 1 << 2,
IBV_SRQ_INIT_ATTR_CQ = 1 << 3,
- IBV_SRQ_INIT_ATTR_RESERVED = 1 << 4
+ IBV_SRQ_INIT_ATTR_TM = 1 << 4,
+ IBV_SRQ_INIT_ATTR_RESERVED = 1 << 5,
+};
+
+struct ibv_tm_cap {
+ uint32_t max_num_tags;
+ uint32_t max_ops;
};
struct ibv_srq_init_attr_ex {
@@ -693,6 +700,7 @@ struct ibv_srq_init_attr_ex {
struct ibv_pd *pd;
struct ibv_xrcd *xrcd;
struct ibv_cq *cq;
+ struct ibv_tm_cap tm_cap;
};
enum ibv_wq_type {