]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
msg/async/rdma: use gid_idx as index to get gid
authorChangcheng Liu <changcheng.liu@aliyun.com>
Mon, 11 Nov 2019 08:03:11 +0000 (16:03 +0800)
committerChangcheng Liu <changcheng.liu@aliyun.com>
Mon, 11 Nov 2019 13:11:34 +0000 (21:11 +0800)
1. use gid_idx as parameter to get gid instead of getting the first(0) gid
by default.
int ibv_query_gid(struct ibv_context *context, uint8_t port_num, int
index, union ibv_gid *gid)
2. gid is initialized in class type declaration, there's no need to
initialized in the member construction list.

Signed-off-by: Changcheng Liu <changcheng.liu@aliyun.com>
src/msg/async/rdma/Infiniband.cc

index cdc438c61c296941a35d60626ff8c5ae42869c22..fd229d43c62b18bb61646bef9bd3de6e8c2978cf 100644 (file)
@@ -30,7 +30,7 @@ static const uint32_t MAX_INLINE_DATA = 0;
 static const uint32_t TCP_MSG_LEN = sizeof("0000:00000000:00000000:00000000:00000000000000000000000000000000");
 static const uint32_t CQ_DEPTH = 30000;
 
-Port::Port(CephContext *cct, struct ibv_context* ictxt, uint8_t ipn): ctxt(ictxt), port_num(ipn), gid_idx(0)
+Port::Port(CephContext *cct, struct ibv_context* ictxt, uint8_t ipn): ctxt(ictxt), port_num(ipn)
 {
   int r = ibv_query_port(ctxt, port_num, &port_attr);
   if (r == -1) {
@@ -95,7 +95,7 @@ Port::Port(CephContext *cct, struct ibv_context* ictxt, uint8_t ipn): ctxt(ictxt
     ceph_abort();
   }
 #else
-  r = ibv_query_gid(ctxt, port_num, 0, &gid);
+  r = ibv_query_gid(ctxt, port_num, gid_idx, &gid);
   if (r) {
     lderr(cct) << __func__  << " query gid failed  " << cpp_strerror(errno) << dendl;
     ceph_abort();