RDMA/nes: Fix for passing a valid QP pointer to the user space library
authorTatyana Nikolova <Tatyana.E.Nikolova@intel.com>
Tue, 11 Mar 2014 19:20:17 +0000 (14:20 -0500)
committerRoland Dreier <roland@purestorage.com>
Mon, 17 Mar 2014 17:04:16 +0000 (10:04 -0700)
Signed-off-by: Tatyana Nikolova <tatyana.e.nikolova@intel.com>
Signed-off-by: Roland Dreier <roland@purestorage.com>
drivers/infiniband/hw/nes/nes_cm.c
drivers/infiniband/hw/nes/nes_user.h
drivers/infiniband/hw/nes/nes_verbs.c
drivers/infiniband/hw/nes/nes_verbs.h

index e852a3a42b9eb557a4b7ea39d0d7426ac18d34e1..dfa9df484505e6ecdc5362f758ade1627b98d0c7 100644 (file)
@@ -657,7 +657,7 @@ static void build_rdma0_msg(struct nes_cm_node *cm_node, struct nes_qp **nesqp_a
        struct nes_qp *nesqp = *nesqp_addr;
        struct nes_hw_qp_wqe *wqe = &nesqp->hwqp.sq_vbase[0];
 
-       u64temp = (unsigned long)nesqp;
+       u64temp = (unsigned long)nesqp->nesuqp_addr;
        u64temp |= NES_SW_CONTEXT_ALIGN >> 1;
        set_wqe_64bit_value(wqe->wqe_words, NES_IWARP_SQ_WQE_COMP_CTX_LOW_IDX, u64temp);
 
index 4926de744488e71b4ec6e618825ed43218b2f519..529c421bb15caf74e5d7c33072e1b2a18e80b96b 100644 (file)
@@ -39,8 +39,8 @@
 
 #include <linux/types.h>
 
-#define NES_ABI_USERSPACE_VER 1
-#define NES_ABI_KERNEL_VER    1
+#define NES_ABI_USERSPACE_VER 2
+#define NES_ABI_KERNEL_VER    2
 
 /*
  * Make sure that all structs defined in this file remain laid out so
@@ -78,6 +78,7 @@ struct nes_create_cq_req {
 
 struct nes_create_qp_req {
        __u64 user_wqe_buffers;
+       __u64 user_qp_buffer;
 };
 
 enum iwnes_memreg_type {
index 8308e3634767958a4a46920ca11983bf62e62e13..797d8876d948e29c8451d90caa5b25c904644fa0 100644 (file)
@@ -1191,6 +1191,8 @@ static struct ib_qp *nes_create_qp(struct ib_pd *ibpd,
                                if (req.user_wqe_buffers) {
                                        virt_wqs = 1;
                                }
+                               if (req.user_qp_buffer)
+                                       nesqp->nesuqp_addr = req.user_qp_buffer;
                                if ((ibpd->uobject) && (ibpd->uobject->context)) {
                                        nesqp->user_mode = 1;
                                        nes_ucontext = to_nesucontext(ibpd->uobject->context);
index 0eff7c44d76b00bbcb1bbe06602dd54606d390ee..309b31c31ae1ac5e9b7bcd44701f22d65e0a1630 100644 (file)
@@ -184,5 +184,6 @@ struct nes_qp {
        u8                    pau_busy;
        u8                    pau_pending;
        u8                    pau_state;
+       __u64                 nesuqp_addr;
 };
 #endif                 /* NES_VERBS_H */