]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
msg/async/rdma: complete get_qp_lockless to get get qp
authorChangcheng Liu <changcheng.liu@aliyun.com>
Tue, 27 Aug 2019 07:58:57 +0000 (15:58 +0800)
committerChangcheng Liu <changcheng.liu@aliyun.com>
Mon, 16 Sep 2019 07:25:01 +0000 (15:25 +0800)
Need get_qp_lockless to get the QueuePair when lock is
locked.

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

index 8051687ec963e1721e2f5e6f1b080c98bbef301e..d04249fb4a8c034443d0b136f4710533d9ac5242 100644 (file)
@@ -375,9 +375,8 @@ RDMAConnectedSocketImpl* RDMADispatcher::get_conn_lockless(uint32_t qp)
   return it->second.second;
 }
 
-Infiniband::QueuePair* RDMADispatcher::get_qp(uint32_t qp)
+Infiniband::QueuePair* RDMADispatcher::get_qp_lockless(uint32_t qp)
 {
-  std::lock_guard l{lock};
   // Try to find the QP in qp_conns firstly.
   auto it = qp_conns.find(qp);
   if (it != qp_conns.end())
@@ -391,6 +390,12 @@ Infiniband::QueuePair* RDMADispatcher::get_qp(uint32_t qp)
   return nullptr;
 }
 
+Infiniband::QueuePair* RDMADispatcher::get_qp(uint32_t qp)
+{
+  std::lock_guard l{lock};
+  return get_qp_lockless(qp);
+}
+
 void RDMADispatcher::erase_qpn_lockless(uint32_t qpn)
 {
   auto it = qp_conns.find(qpn);
index 3272592e5cde5e45fff2e3616aed3a362594ab9e..f553098a60f3e0d3d22b8eb3afbb4885f3ef9ee5 100644 (file)
@@ -109,6 +109,7 @@ class RDMADispatcher {
     ++num_pending_workers;
   }
   RDMAConnectedSocketImpl* get_conn_lockless(uint32_t qp);
+  QueuePair* get_qp_lockless(uint32_t qp);
   QueuePair* get_qp(uint32_t qp);
   void erase_qpn_lockless(uint32_t qpn);
   void erase_qpn(uint32_t qpn);