]> git.openfabrics.org - ~shefty/libibverbs.git/commitdiff
libibverbs: Add support for XRC QPs
authorSean Hefty <sean.hefty@intel.com>
Mon, 17 Sep 2012 23:00:12 +0000 (16:00 -0700)
committerSean Hefty <sean.hefty@intel.com>
Mon, 17 Sep 2012 23:00:12 +0000 (16:00 -0700)
XRC queue pairs: xrc defines two new types of QPs.  The
initiator, or send-side, xrc qp behaves similar to a send-
only RC qp.  xrc send qp's are managed through the existing
QP functions.  The send_wr structure is extended in a back-
wards compatible way to support posting sends on a send xrc
qp, which require specifying the remote xrc srq.

The target, or receive-side, xrc qp behaves differently
than other implemented qp's.  A recv xrc qp can be created,
modified, and destroyed like other qp's through the existing
calls.  The qp_init_attr structure is extended for xrc qp's.

Because xrc recv qp's are bound to an xrcd, rather than a pd,
it is intended to be used among multiple processes.  Any process
with access to an xrcd may allocate and connect an xrc recv qp.
The actual xrc recv qp is allocated and managed by the kernel.
If the owning process explicit destroys the xrc recv qp, it is
destroyed.  However, if the xrc recv qp is left open when the
user process exits or closes its device, then the lifetime of
the xrc recv qp is bound with the lifetime of the xrcd.

Signed-off-by: Sean Hefty <sean.hefty@intel.com>
include/infiniband/kern-abi.h
include/infiniband/verbs.h

index 3d72fa738c964c1cedee6a3f26cfb921b9c03031..b6d5ce9f776f3830c17a17c4bb05ef46636ca31d 100644 (file)
@@ -617,6 +617,11 @@ struct ibv_kern_send_wr {
                        __u32 remote_qkey;
                        __u32 reserved;
                } ud;
+               struct {
+                       __u64 reserved[3];
+                       __u32 reserved2;
+                       __u32 remote_srqn;
+               } xrc;
        } wr;
 };
 
index 58d6927dc6687c533da206ff700ac3fea36854f1..1d03c4b60a7c1efd9170fc6558f0773fe38699ca 100644 (file)
@@ -462,7 +462,9 @@ struct ibv_srq_init_attr_ex {
 enum ibv_qp_type {
        IBV_QPT_RC = 2,
        IBV_QPT_UC,
-       IBV_QPT_UD
+       IBV_QPT_UD,
+       IBV_QPT_XRC_SEND = 9,
+       IBV_QPT_XRC_RECV
 };
 
 struct ibv_qp_cap {
@@ -483,6 +485,24 @@ struct ibv_qp_init_attr {
        int                     sq_sig_all;
 };
 
+enum ibv_qp_init_attr_mask {
+       IBV_QP_INIT_ATTR_XRCD           = 1 << 0,
+       IBV_QP_INIT_ATTR_RESERVED       = 1 << 1
+};
+
+struct ibv_qp_init_attr_ex {
+       void                   *qp_context;
+       struct ibv_cq          *send_cq;
+       struct ibv_cq          *recv_cq;
+       struct ibv_srq         *srq;
+       struct ibv_qp_cap       cap;
+       enum ibv_qp_type        qp_type;
+       int                     sq_sig_all;
+
+       uint64_t                comp_mask;
+       struct ibv_xrcd        *xrcd;
+};
+
 enum ibv_qp_attr_mask {
        IBV_QP_STATE                    = 1 <<  0,
        IBV_QP_CUR_STATE                = 1 <<  1,
@@ -598,6 +618,11 @@ struct ibv_send_wr {
                        uint32_t        remote_qpn;
                        uint32_t        remote_qkey;
                } ud;
+               struct {
+                       uint64_t        reserved[3];
+                       uint32_t        reserved2;
+                       uint32_t        remote_srqn;
+               };
        } wr;
 };
 
@@ -642,8 +667,11 @@ struct ibv_srq {
        uint32_t                srq_num;
 };
 
+// set device xrc support
+//XXX TO DO: check mask for all calls
 enum ibv_qp_mask {
-       IBV_QP_RESERVED                 = 1 << 0
+       IBV_QP_XRCD                     = 1 << 0,
+       IBV_QP_RESERVED                 = 1 << 1
 };
 
 struct ibv_qp {