]> git.openfabrics.org - ~shefty/libibverbs.git/commitdiff
pop (CONFLICT)
authorSean Hefty <sean.hefty@intel.com>
Fri, 28 Sep 2012 17:43:14 +0000 (10:43 -0700)
committerSean Hefty <sean.hefty@intel.com>
Fri, 28 Sep 2012 17:43:14 +0000 (10:43 -0700)
meta
patches/xrc_qp

diff --git a/meta b/meta
index 4627280c9abdd6a13549f37b1844ebe962acc688..dffb1124f9b44e92a08e801b30005ffa28bfcb12 100644 (file)
--- a/meta
+++ b/meta
@@ -1,12 +1,12 @@
 Version: 1
-Previous: 1ca480eb8e37db225832458aac3d3e675e9991b3
+Previous: 728747d18ba1822bfec3ba00a8e79b96edf82cf1
 Head: a98e29562c1d727dd492cfa66b628369460969f6
 Applied:
   verbs-ext: b1cc207d04e9df91c000aadd20d3612f3cb58552
   xrcd: f2b48b365d126d1c4bc61b3b3ea1ab9b7f2544f4
   srq_ex: 91fdc5b4aaf078280ff31bd0cf35760a6ae5dd10
+  xrc_qp: a98e29562c1d727dd492cfa66b628369460969f6
 Unapplied:
-  xrc_qp: 41c4a902e322da2cc08caabd0ba56a1ffff4c43e
   open_qp: 02ed1a5b57528c104aefa6608f45bdf2d718ded3
   open_qp_man: 3ba2056186d67520b8302137c5906a0083891d7f
   xrc_sample: 1013efa007f441c16274ac07a00adf34afdb41b4
index 7b52183f4cd36abd295d2a6321607e8a20c0b430..b0900b453838830efdb5215241d9256f1f4436d9 100644 (file)
@@ -1,5 +1,5 @@
-Bottom: c6aef470f56908563376a1ec23ad504646517935
-Top:    541345b5c2f2f2889e951657655ccf34257ae86c
+Bottom: f12a9640338b48e3a608e0b2ec69517ecd34327e
+Top:    f12a9640338b48e3a608e0b2ec69517ecd34327e
 Author: Sean Hefty <sean.hefty@intel.com>
 Date:   2012-09-17 16:00:12 -0700
 
@@ -31,271 +31,4 @@ Signed-off-by: Sean Hefty <sean.hefty@intel.com>
 
 ---
 
-diff --git a/include/infiniband/driver.h b/include/infiniband/driver.h
-index 6ad97ae..6bbb10d 100644
---- a/include/infiniband/driver.h
-+++ b/include/infiniband/driver.h
-@@ -81,6 +81,16 @@ struct verbs_srq {
-       uint32_t                srq_num;
- };
-+enum verbs_qp_mask {
-+      VERBS_QP_XRCD           = 1 << 0,
-+      VERBS_QP_RESERVED       = 1 << 1
-+};
-+
-+struct verbs_qp {
-+      struct ibv_qp           qp;
-+      uint32_t                comp_mask;
-+      struct verbs_xrcd       *xrcd;
-+};
- typedef struct ibv_device *(*ibv_driver_init_func)(const char *uverbs_sys_path,
-                                                  int abi_version);
- typedef struct verbs_device *(*verbs_driver_init_func)(const char *uverbs_sys_path,
-@@ -152,6 +162,10 @@ int ibv_cmd_create_qp(struct ibv_pd *pd,
-                     struct ibv_qp *qp, struct ibv_qp_init_attr *attr,
-                     struct ibv_create_qp *cmd, size_t cmd_size,
-                     struct ibv_create_qp_resp *resp, size_t resp_size);
-+int ibv_cmd_create_qp_ex(struct ibv_context *context,
-+                       struct verbs_qp *qp, struct ibv_qp_init_attr_ex *attr_ex,
-+                       struct ibv_create_qp *cmd, size_t cmd_size,
-+                       struct ibv_create_qp_resp *resp, size_t resp_size);
- int ibv_cmd_query_qp(struct ibv_qp *qp, struct ibv_qp_attr *qp_attr,
-                    int attr_mask,
-                    struct ibv_qp_init_attr *qp_init_attr,
-diff --git a/include/infiniband/kern-abi.h b/include/infiniband/kern-abi.h
-index 3d72fa7..b6d5ce9 100644
---- a/include/infiniband/kern-abi.h
-+++ b/include/infiniband/kern-abi.h
-@@ -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;
- };
-diff --git a/include/infiniband/verbs.h b/include/infiniband/verbs.h
-index d649fb5..e7e4d3e 100644
---- a/include/infiniband/verbs.h
-+++ b/include/infiniband/verbs.h
-@@ -107,7 +107,8 @@ enum ibv_device_cap_flags {
-       IBV_DEVICE_SYS_IMAGE_GUID       = 1 << 11,
-       IBV_DEVICE_RC_RNR_NAK_GEN       = 1 << 12,
-       IBV_DEVICE_SRQ_RESIZE           = 1 << 13,
--      IBV_DEVICE_N_NOTIFY_CQ          = 1 << 14
-+      IBV_DEVICE_N_NOTIFY_CQ          = 1 << 14,
-+      IBV_DEVICE_XRC                  = 1 << 20
- };
- enum ibv_atomic_cap {
-@@ -442,7 +443,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 {
-@@ -463,6 +466,26 @@ struct ibv_qp_init_attr {
-       int                     sq_sig_all;
- };
-+enum ibv_qp_init_attr_mask {
-+      IBV_QP_INIT_ATTR_PD             = 1 << 0,
-+      IBV_QP_INIT_ATTR_XRCD           = 1 << 1,
-+      IBV_QP_INIT_ATTR_RESERVED       = 1 << 2
-+};
-+
-+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;
-+
-+      uint32_t                comp_mask;
-+      struct ibv_pd          *pd;
-+      struct ibv_xrcd        *xrcd;
-+};
-+
- enum ibv_qp_attr_mask {
-       IBV_QP_STATE                    = 1 <<  0,
-       IBV_QP_CUR_STATE                = 1 <<  1,
-@@ -578,6 +601,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;
-+              } xrc;
-       } wr;
- };
-@@ -761,6 +789,8 @@ struct verbs_context {
-       int (*drv_new_func1) ();        new corresponding provider call of func1
-       int (*lib_new_func1) ();        New library call func1
-       */
-+      struct ibv_qp *         (*create_qp_ex)(struct ibv_context *context,
-+                                              struct ibv_qp_init_attr_ex *qp_init_attr_ex);
-       uint32_t                (*get_srq_num)(struct ibv_srq *srq);
-       struct ibv_srq *        (*create_srq_ex)(struct ibv_context *context,
-                                                struct ibv_srq_init_attr_ex *srq_init_attr_ex);
-@@ -1129,6 +1159,23 @@ static inline int ibv_post_srq_recv(struct ibv_srq *srq,
- struct ibv_qp *ibv_create_qp(struct ibv_pd *pd,
-                            struct ibv_qp_init_attr *qp_init_attr);
-+static inline struct ibv_qp *
-+ibv_create_qp_ex(struct ibv_context *context, struct ibv_qp_init_attr_ex *qp_init_attr_ex)
-+{
-+      struct verbs_context *vctx;
-+      uint32_t mask = qp_init_attr_ex->comp_mask;
-+
-+      if (!(mask & ~(IBV_QP_INIT_ATTR_PD)) && (mask & IBV_QP_INIT_ATTR_PD))
-+              return ibv_create_qp(qp_init_attr_ex->pd,
-+                                   (struct ibv_qp_init_attr *) qp_init_attr_ex);
-+
-+      if (!(vctx = verbs_get_ctx_op(context, create_qp_ex))) {
-+              errno = ENOSYS;
-+              return NULL;
-+      }
-+      return vctx->create_qp_ex(context, qp_init_attr_ex);
-+}
-+
- /**
-  * ibv_modify_qp - Modify a queue pair.
-  */
-diff --git a/src/cmd.c b/src/cmd.c
-index 462c58e..b8ab132 100644
---- a/src/cmd.c
-+++ b/src/cmd.c
-@@ -659,6 +659,98 @@ int ibv_cmd_destroy_srq(struct ibv_srq *srq)
-       return 0;
- }
-+int ibv_cmd_create_qp_ex(struct ibv_context *context,
-+                       struct verbs_qp *qp, struct ibv_qp_init_attr_ex *attr_ex,
-+                       struct ibv_create_qp *cmd, size_t cmd_size,
-+                       struct ibv_create_qp_resp *resp, size_t resp_size)
-+{
-+      struct verbs_xrcd *vxrcd = NULL;
-+
-+      IBV_INIT_CMD_RESP(cmd, cmd_size, CREATE_QP, resp, resp_size);
-+
-+      if (attr_ex->comp_mask >= IBV_QP_INIT_ATTR_RESERVED)
-+              return ENOSYS;
-+
-+      cmd->user_handle     = (uintptr_t) qp;
-+
-+      if (attr_ex->comp_mask & IBV_QP_INIT_ATTR_XRCD) {
-+              vxrcd = container_of(attr_ex->xrcd, struct verbs_xrcd, xrcd);
-+              cmd->pd_handle  = vxrcd->handle;
-+      } else {
-+              if (!(attr_ex->comp_mask & IBV_QP_INIT_ATTR_PD))
-+                      return EINVAL;
-+
-+              cmd->pd_handle  = attr_ex->pd->handle;
-+              cmd->send_cq_handle = attr_ex->send_cq->handle;
-+
-+              if (attr_ex->qp_type != IBV_QPT_XRC_SEND) {
-+                      cmd->recv_cq_handle = attr_ex->recv_cq->handle;
-+                      cmd->srq_handle = attr_ex->srq ? attr_ex->srq->handle : 0;
-+              }
-+      }
-+
-+      cmd->max_send_wr     = attr_ex->cap.max_send_wr;
-+      cmd->max_recv_wr     = attr_ex->cap.max_recv_wr;
-+      cmd->max_send_sge    = attr_ex->cap.max_send_sge;
-+      cmd->max_recv_sge    = attr_ex->cap.max_recv_sge;
-+      cmd->max_inline_data = attr_ex->cap.max_inline_data;
-+      cmd->sq_sig_all      = attr_ex->sq_sig_all;
-+      cmd->qp_type         = attr_ex->qp_type;
-+      cmd->is_srq          = !!attr_ex->srq;
-+      cmd->reserved        = 0;
-+
-+      if (write(context->cmd_fd, cmd, cmd_size) != cmd_size)
-+              return errno;
-+
-+      (void) VALGRIND_MAKE_MEM_DEFINED(resp, resp_size);
-+
-+      if (abi_ver > 3) {
-+              attr_ex->cap.max_recv_sge    = resp->max_recv_sge;
-+              attr_ex->cap.max_send_sge    = resp->max_send_sge;
-+              attr_ex->cap.max_recv_wr     = resp->max_recv_wr;
-+              attr_ex->cap.max_send_wr     = resp->max_send_wr;
-+              attr_ex->cap.max_inline_data = resp->max_inline_data;
-+      }
-+
-+      if (abi_ver == 4) {
-+              struct ibv_create_qp_resp_v4 *resp_v4 =
-+                      (struct ibv_create_qp_resp_v4 *) resp;
-+
-+              memmove((void *) resp + sizeof *resp,
-+                      (void *) resp_v4 + sizeof *resp_v4,
-+                      resp_size - sizeof *resp);
-+      } else if (abi_ver <= 3) {
-+              struct ibv_create_qp_resp_v3 *resp_v3 =
-+                      (struct ibv_create_qp_resp_v3 *) resp;
-+
-+              memmove((void *) resp + sizeof *resp,
-+                      (void *) resp_v3 + sizeof *resp_v3,
-+                      resp_size - sizeof *resp);
-+      }
-+
-+      qp->qp.handle           = resp->qp_handle;
-+      qp->qp.qp_num           = resp->qpn;
-+      qp->qp.context          = context;
-+      qp->qp.qp_context       = attr_ex->qp_context;
-+      qp->qp.pd               = attr_ex->pd;
-+      qp->qp.send_cq          = attr_ex->send_cq;
-+      qp->qp.recv_cq          = attr_ex->recv_cq;
-+      qp->qp.srq              = attr_ex->srq;
-+      qp->qp.qp_type          = attr_ex->qp_type;
-+      qp->qp.state            = IBV_QPS_RESET;
-+      qp->qp.events_completed = 0;
-+      pthread_mutex_init(&qp->qp.mutex, NULL);
-+      pthread_cond_init(&qp->qp.cond, NULL);
-+
-+      qp->comp_mask = 0;
-+      if (attr_ex->comp_mask & IBV_QP_INIT_ATTR_XRCD) {
-+              qp->comp_mask |= VERBS_QP_XRCD;
-+              qp->xrcd = vxrcd;
-+      }
-+
-+      return 0;
-+}
-+
- int ibv_cmd_create_qp(struct ibv_pd *pd,
-                     struct ibv_qp *qp, struct ibv_qp_init_attr *attr,
-                     struct ibv_create_qp *cmd, size_t cmd_size,
-@@ -667,7 +759,7 @@ int ibv_cmd_create_qp(struct ibv_pd *pd,
-       IBV_INIT_CMD_RESP(cmd, cmd_size, CREATE_QP, resp, resp_size);
-       cmd->user_handle     = (uintptr_t) qp;
--      cmd->pd_handle       = pd->handle;
-+      cmd->pd_handle       = pd->handle;
-       cmd->send_cq_handle  = attr->send_cq->handle;
-       cmd->recv_cq_handle  = attr->recv_cq->handle;
-       cmd->srq_handle      = attr->srq ? attr->srq->handle : 0;
-diff --git a/src/libibverbs.map b/src/libibverbs.map
-index c8ec645..4249793 100644
---- a/src/libibverbs.map
-+++ b/src/libibverbs.map
-@@ -101,5 +101,6 @@ IBVERBS_1.1 {
-               ibv_cmd_open_xrcd;
-               ibv_cmd_close_xrcd;
-               ibv_cmd_create_srq_ex;
-+              ibv_cmd_create_qp_ex;
-               
- } IBVERBS_1.0;
+