From b5c797876a665b146fd302d0d77f32a61ec3447d Mon Sep 17 00:00:00 2001 From: Changcheng Liu Date: Mon, 11 Nov 2019 16:03:11 +0800 Subject: [PATCH] msg/async/rdma: use gid_idx as index to get gid 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 --- src/msg/async/rdma/Infiniband.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/msg/async/rdma/Infiniband.cc b/src/msg/async/rdma/Infiniband.cc index cdc438c61c2..fd229d43c62 100644 --- a/src/msg/async/rdma/Infiniband.cc +++ b/src/msg/async/rdma/Infiniband.cc @@ -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(); -- 2.39.5