mirror of
https://github.com/ceph/ceph
synced 2025-03-11 02:39:05 +00:00
msg/async/rdma: keep qp_conns lock to prevent connection alive
Signed-off-by: Haomai Wang <haomai@xsky.com>
This commit is contained in:
parent
97e0486979
commit
4323ec25c4
@ -107,7 +107,8 @@ void RDMADispatcher::handle_async_event()
|
||||
uint64_t qpn = async_event.element.qp->qp_num;
|
||||
ldout(cct, 10) << __func__ << " event associated qp=" << async_event.element.qp
|
||||
<< " evt: " << ibv_event_type_str(async_event.event_type) << dendl;
|
||||
RDMAConnectedSocketImpl *conn = get_conn_by_qp(qpn);
|
||||
Mutex::Locker l(lock);
|
||||
RDMAConnectedSocketImpl *conn = get_conn_lockless(qpn);
|
||||
if (!conn) {
|
||||
ldout(cct, 1) << __func__ << " missing qp_num=" << qpn << " discard event" << dendl;
|
||||
} else {
|
||||
@ -277,17 +278,6 @@ int RDMADispatcher::register_qp(QueuePair *qp, RDMAConnectedSocketImpl* csi)
|
||||
return fd;
|
||||
}
|
||||
|
||||
RDMAConnectedSocketImpl* RDMADispatcher::get_conn_by_qp(uint32_t qp)
|
||||
{
|
||||
Mutex::Locker l(lock);
|
||||
auto it = qp_conns.find(qp);
|
||||
if (it == qp_conns.end())
|
||||
return nullptr;
|
||||
if (it->second.first->is_dead())
|
||||
return nullptr;
|
||||
return it->second.second;
|
||||
}
|
||||
|
||||
RDMAConnectedSocketImpl* RDMADispatcher::get_conn_lockless(uint32_t qp)
|
||||
{
|
||||
auto it = qp_conns.find(qp);
|
||||
|
@ -127,7 +127,6 @@ class RDMADispatcher : public CephContext::ForkWatcher {
|
||||
}
|
||||
}
|
||||
RDMAStack* get_stack() { return stack; }
|
||||
RDMAConnectedSocketImpl* get_conn_by_qp(uint32_t qp);
|
||||
RDMAConnectedSocketImpl* get_conn_lockless(uint32_t qp);
|
||||
void erase_qpn(uint32_t qpn);
|
||||
Infiniband::CompletionQueue* get_tx_cq() const { return tx_cq; }
|
||||
|
Loading…
Reference in New Issue
Block a user