From: Changcheng Liu Date: Mon, 11 Nov 2019 08:03:11 +0000 (+0800) Subject: msg/async/rdma: use gid_idx as index to get gid X-Git-Tag: v15.1.0~881^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=b5c797876a665b146fd302d0d77f32a61ec3447d;p=ceph.git 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 --- diff --git a/src/msg/async/rdma/Infiniband.cc b/src/msg/async/rdma/Infiniband.cc index cdc438c61c29..fd229d43c62b 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();