Skip to contentSkip to conversation

rds: Don't check return value from destroy CQ

PATCH In review Leon Romanovsky 2 participants 3 messages May 20, 2019 1 message not in the archive

Subsystems (4)
lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw

PATCH 1/15 rds: Don't check return value from destroy CQ

From: Leon Romanovsky <[email protected]>

There is no value in checking ib_destroy_cq() result and skipping to clear struct ic fields. This connection needs to be reinitialized anyway.

---
 net/rds/ib_cm.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
net/rds/ib_cm.c +4 -4
index 66c6eb56072b..5a42ebb892cd 100644
@@ -611,11 +611,11 @@ static int rds_ib_setup_qp(struct rds_connection *conn)
 qp_out:
 	rdma_destroy_qp(ic->i_cm_id);
 recv_cq_out:
-	if (!ib_destroy_cq(ic->i_recv_cq))
-		ic->i_recv_cq = NULL;
+	ib_destroy_cq(ic->i_recv_cq);
+	ic->i_recv_cq = NULL;
 send_cq_out:
-	if (!ib_destroy_cq(ic->i_send_cq))
-		ic->i_send_cq = NULL;
+	ib_destroy_cq(ic->i_send_cq);
+	ic->i_send_cq = NULL;
 rds_ibdev_out:
 	rds_ib_remove_conn(rds_ibdev, conn);
 out:
Acked-by on v1 1/15
#2 lore raw
Quoted 18 lines · Leon Romanovsky

From: Leon Romanovsky <[email protected]>

There is no value in checking ib_destroy_cq() result and skipping to clear struct ic fields. This connection needs to be reinitialized anyway.

---
  net/rds/ib_cm.c | 8 ++++----
  1 file changed, 4 insertions(+), 4 deletions(-)
net/rds/ib_cm.c +0 -0
index 66c6eb56072b..5a42ebb892cd 100644
@@ -611,11 +611,11 @@ static int rds_ib_setup_qp(struct rds_connection *conn)
  qp_out:
  	rdma_destroy_qp(ic->i_cm_id);

net/rds/ib_cm.c static int rds_ib_setup_qp(struct rds_connection *conn) · line 618

Quoted 10 lines
net/rds/ib_cm.c +4 -4
  recv_cq_out:
-	if (!ib_destroy_cq(ic->i_recv_cq))
-		ic->i_recv_cq = NULL;
+	ib_destroy_cq(ic->i_recv_cq);
+	ic->i_recv_cq = NULL;
  send_cq_out:
-	if (!ib_destroy_cq(ic->i_send_cq))
-		ic->i_send_cq = NULL;
+	ib_destroy_cq(ic->i_send_cq);
+	ic->i_send_cq = NULL;

This was done to ensure, you still don't get ISR delivering the CQEs while we are in shutdown path. Your patch is fine though since you don't change that behavior.

#3 lore raw
Quoted 33 lines · Santosh Shilimkar
Quoted 18 lines · Leon Romanovsky

From: Leon Romanovsky <[email protected]>

There is no value in checking ib_destroy_cq() result and skipping to clear struct ic fields. This connection needs to be reinitialized anyway.

---
  net/rds/ib_cm.c | 8 ++++----
  1 file changed, 4 insertions(+), 4 deletions(-)
net/rds/ib_cm.c +0 -0
index 66c6eb56072b..5a42ebb892cd 100644
@@ -611,11 +611,11 @@ static int rds_ib_setup_qp(struct rds_connection *conn)
  qp_out:
  	rdma_destroy_qp(ic->i_cm_id);

net/rds/ib_cm.c static int rds_ib_setup_qp(struct rds_connection *conn) · line 618

Quoted 10 lines
net/rds/ib_cm.c +4 -4
  recv_cq_out:
-	if (!ib_destroy_cq(ic->i_recv_cq))
-		ic->i_recv_cq = NULL;
+	ib_destroy_cq(ic->i_recv_cq);
+	ic->i_recv_cq = NULL;
  send_cq_out:
-	if (!ib_destroy_cq(ic->i_send_cq))
-		ic->i_send_cq = NULL;
+	ib_destroy_cq(ic->i_send_cq);
+	ic->i_send_cq = NULL;

This was done to ensure, you still don't get ISR delivering the CQEs while we are in shutdown path. Your patch is fine though since you don't change that behavior.

Quoted 1 line

Thanks

Quoted 2 lines