Skip to contentSkip to conversation

RDMA/nes: listener destroyed during loopback setup crash

PATCH In review Faisal Latif 2 participants 3 messages Feb 12, 2010 1 message not in the archive InfiniBand

lore
Share & tools
lore
#0 lore raw

PATCH 2/2 RDMA/nes: listener destroyed during loopback setup crash

When listener is destroyed and where is MPA response pending for loopback connection, the active side cm_node gets destroyed in cm_event_connect_error() and again in nes_accept()/nes_reject(). Incrementing cm_node's refcount to not be destroyed by cm_event_connect_error().

---
 drivers/infiniband/hw/nes/nes_cm.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
drivers/infiniband/hw/nes/nes_cm.c +2 -1
index debd92c..2a49ee4 100644
@@ -1011,9 +1011,10 @@ static int mini_cm_dec_refcnt_listen(struct nes_cm_core *cm_core,
 					event.cm_info.loc_port =
 							 loopback->loc_port;
 					event.cm_info.cm_id = loopback->cm_id;
+					add_ref_cm_node(loopback);
+					loopback->state = NES_CM_STATE_CLOSED;
 					cm_event_connect_error(&event);
 					cm_node->state = NES_CM_STATE_LISTENER_DESTROYED;
-					loopback->state = NES_CM_STATE_CLOSED;
 
 					rem_ref_cm_node(cm_node->cm_core,
 							 cm_node);
Signature · 6 lines
1.5.3.3

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
#1 lore raw

drivers/infiniband/hw/nes/nes_cm.c static int mini_cm_dec_refcnt_listen(struct nes_cm_core · line 1016

Quoted 7 lines
drivers/infiniband/hw/nes/nes_cm.c +2 -0
@@ -1011,9 +1011,10 @@ static int mini_cm_dec_refcnt_listen(struct nes_cm_core
 *cm_core,
 					event.cm_info.loc_port =
 							 loopback->loc_port;
 					event.cm_info.cm_id = loopback->cm_id;
+					add_ref_cm_node(loopback);
+					loopback->state = NES_CM_STATE_CLOSED;

It seems odd to increment a reference count in a function with the name 'dec_refcnt'. Is there a better name for mini_cm_dec_refcnt_listen?

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html

A message that is not in the archive (sent off-list or not yet received): F76A888F6A4D47848B20E1F578081E61-Zpru7NauK7drdx17CPfAsdBPR1lH4CV8@public.gmane.org

#3 lore raw

The add_ref_cm_node() is not for listener node but for the active side node of a loopback connection. For loopback's active node, its refcount gets decremented in cm_event_connect_error(). This is a error handling case.

Faisal

Quoted 10 lines

-----Original Message-----
From: Hefty, Sean
Sent: Friday, February 12, 2010 2:02 PM
To: Latif, Faisal; Roland Dreier; [email protected]; linux- [email protected]
Subject: RE: [PATCH 02/02] RDMA/nes: listener destroyed during loopback setup crash

Review static int mini_cm_dec_refcnt_listen(struct

Quoted 1 line
(quoted diff) +0 -0
@@ -1011,9 +1011,10 @@ static int mini_cm_dec_refcnt_listen(struct

nes_cm_core

Quoted 9 lines

drivers/infiniband/hw/nes/nes_cm.c static int mini_cm_dec_refcnt_listen(struct nes_cm_core *cm_core, · line 1015

Quoted 6 lines
drivers/infiniband/hw/nes/nes_cm.c +2 -0
 *cm_core,
 					event.cm_info.loc_port =
 							 loopback->loc_port;
 					event.cm_info.cm_id = loopback->cm_id;
+					add_ref_cm_node(loopback);
+					loopback->state = NES_CM_STATE_CLOSED;

It seems odd to increment a reference count in a function with the name 'dec_refcnt'. Is there a better name for mini_cm_dec_refcnt_listen?

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html