diff mbox series

[rdma-next,01/15] rds: Don't check return value from destroy CQ

Message ID 20190520065433.8734-2-leon@kernel.org
State Awaiting Upstream
Delegated to: David Miller
Headers show
Series [rdma-next,01/15] rds: Don't check return value from destroy CQ | expand

Commit Message

Leon Romanovsky May 20, 2019, 6:54 a.m. UTC
From: Leon Romanovsky <leonro@mellanox.com>

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

Signed-off-by: Leon Romanovsky <leonro@mellanox.com>
---
 net/rds/ib_cm.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

--
2.20.1

Comments

Santosh Shilimkar May 20, 2019, 5:17 p.m. UTC | #1
On 5/19/2019 11:54 PM, Leon Romanovsky wrote:
> From: Leon Romanovsky <leonro@mellanox.com>
> 
> There is no value in checking ib_destroy_cq() result and skipping
> to clear struct ic fields. This connection needs to be reinitialized
> anyway.
> 
> Signed-off-by: Leon Romanovsky <leonro@mellanox.com>
> ---
>   net/rds/ib_cm.c | 8 ++++----
>   1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/net/rds/ib_cm.c b/net/rds/ib_cm.c
> index 66c6eb56072b..5a42ebb892cd 100644
> --- a/net/rds/ib_cm.c
> +++ b/net/rds/ib_cm.c
> @@ -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;
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.

Acked-by: Santosh Shilimkar <santosh.shilimkar@oracle.com>
Leon Romanovsky May 20, 2019, 6:31 p.m. UTC | #2
On Mon, May 20, 2019 at 10:17:43AM -0700, Santosh Shilimkar wrote:
> On 5/19/2019 11:54 PM, Leon Romanovsky wrote:
> > From: Leon Romanovsky <leonro@mellanox.com>
> >
> > There is no value in checking ib_destroy_cq() result and skipping
> > to clear struct ic fields. This connection needs to be reinitialized
> > anyway.
> >
> > Signed-off-by: Leon Romanovsky <leonro@mellanox.com>
> > ---
> >   net/rds/ib_cm.c | 8 ++++----
> >   1 file changed, 4 insertions(+), 4 deletions(-)
> >
> > diff --git a/net/rds/ib_cm.c b/net/rds/ib_cm.c
> > index 66c6eb56072b..5a42ebb892cd 100644
> > --- a/net/rds/ib_cm.c
> > +++ b/net/rds/ib_cm.c
> > @@ -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;
> 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.
>
> Acked-by: Santosh Shilimkar <santosh.shilimkar@oracle.com>

Thanks

>
>
diff mbox series

Patch

diff --git a/net/rds/ib_cm.c b/net/rds/ib_cm.c
index 66c6eb56072b..5a42ebb892cd 100644
--- a/net/rds/ib_cm.c
+++ b/net/rds/ib_cm.c
@@ -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: