]> git.openfabrics.org - ~shefty/librdmacm.git/commitdiff
r9008: Set the QKEY to a common global value for all UD QPs and multicast groups
authorSteve Wise <swise@opengridcomputer.com>
Fri, 18 Aug 2006 21:06:41 +0000 (21:06 +0000)
committerSean Hefty <sean.hefty@intel.com>
Fri, 18 Aug 2006 21:06:41 +0000 (21:06 +0000)
created by the RDMA CM.  This lets a UD QP be used for datagram communication,
as well as multicast group communication over any number of groups.

Signed-off-by: Steve Wise <swise@opengridcomputer.com>
Signed-off-by: Sean Hefty <sean.hefty@intel.com>
examples/udaddy.c
include/rdma/rdma_cma_ib.h
src/cma.c

index c351c3fa7bae27d5f2a5423da133244eb58497ff..5e42d20981280f77024890d8837f0246f830ad1d 100644 (file)
@@ -434,7 +434,7 @@ static void create_reply_ah(struct cmatest_node *node, struct ibv_wc *wc)
        node->ah = ibv_create_ah_from_wc(node->pd, wc, node->mem,
                                         node->cma_id->port_num);
        node->remote_qpn = ntohl(wc->imm_data);
-       node->remote_qkey = ntohs(rdma_get_dst_port(node->cma_id));
+       node->remote_qkey = RDMA_UD_QKEY;
 }
 
 static int poll_cqs(void)
index 0839db03cb5c2428c78036e3e35ad69d5c7020a0..6c33c6152c7db2936a00da4700af53907da565de 100644 (file)
@@ -59,4 +59,10 @@ int rdma_get_dst_attr(struct rdma_cm_id *id, struct sockaddr *addr,
                      struct ibv_ah_attr *ah_attr, uint32_t *remote_qpn,
                      uint32_t *remote_qkey);
 
+/*
+ * Global qkey value for all UD QPs and multicast groups created via the 
+ * RDMA CM.
+ */
+#define RDMA_UD_QKEY 0x01234567
+
 #endif /* RDMA_CMA_IB_H */
index 61b8c7dd89f5e93673ce7cd3ec5188c314cffc7e..ad385e989ae113f79291490d03e0cc95abf54628 100644 (file)
--- a/src/cma.c
+++ b/src/cma.c
@@ -701,7 +701,7 @@ static int ucma_init_ud_qp(struct cma_id_private *id_priv, struct ibv_qp *qp)
 
        qp_attr.port_num = id_priv->id.port_num;
        qp_attr.qp_state = IBV_QPS_INIT;
-       qp_attr.qkey = ntohs(rdma_get_src_port(&id_priv->id));
+       qp_attr.qkey = RDMA_UD_QKEY;
        ret = ibv_modify_qp(qp, &qp_attr, IBV_QP_STATE | IBV_QP_PKEY_INDEX |
                                          IBV_QP_PORT | IBV_QP_QKEY);
        if (ret)