diff mbox series

[v1,for-rc] RDMA/cxgb4: Fix adapter LE hash errors while destroying ipv6 listening server

Message ID 20210322162210.21964-1-bharat@chelsio.com (mailing list archive)
State Superseded
Headers show
Series [v1,for-rc] RDMA/cxgb4: Fix adapter LE hash errors while destroying ipv6 listening server | expand

Commit Message

Potnuri Bharat Teja March 22, 2021, 4:22 p.m. UTC
Not setting ipv6 bit while destroying ipv6 listening servers may result in
potential fatal adapter errors due to lookup engine memory hash errors.
Therefore always set ipv6 field while destroying ipv6 listening servers.

Fixes: 830662f6f032 ("RDMA/cxgb4: Add support for active and passive open connection with IPv6 address")
Signed-off-by: Potnuri Bharat Teja <bharat@chelsio.com>
---
Changes since v0:
- modified commit description to inform the severity of patch.
---
---
 drivers/infiniband/hw/cxgb4/cm.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

Comments

Leon Romanovsky March 24, 2021, 8:35 a.m. UTC | #1
On Mon, Mar 22, 2021 at 09:52:09PM +0530, Potnuri Bharat Teja wrote:
> Not setting ipv6 bit while destroying ipv6 listening servers may result in
> potential fatal adapter errors due to lookup engine memory hash errors.
> Therefore always set ipv6 field while destroying ipv6 listening servers.
> 
> Fixes: 830662f6f032 ("RDMA/cxgb4: Add support for active and passive open connection with IPv6 address")
> Signed-off-by: Potnuri Bharat Teja <bharat@chelsio.com>
> ---
> Changes since v0:
> - modified commit description to inform the severity of patch.
> ---
> ---
>  drivers/infiniband/hw/cxgb4/cm.c | 8 +++++---
>  1 file changed, 5 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/infiniband/hw/cxgb4/cm.c b/drivers/infiniband/hw/cxgb4/cm.c
> index 8769e7aa097f..76faba892f00 100644
> --- a/drivers/infiniband/hw/cxgb4/cm.c
> +++ b/drivers/infiniband/hw/cxgb4/cm.c
> @@ -3599,8 +3599,9 @@ int c4iw_create_listen(struct iw_cm_id *cm_id, int backlog)
>  
>  int c4iw_destroy_listen(struct iw_cm_id *cm_id)
>  {
> -	int err;
>  	struct c4iw_listen_ep *ep = to_listen_ep(cm_id);
> +	bool ipv6 = false;

You don't need extra variable, simply pass true/false.

Thanks
diff mbox series

Patch

diff --git a/drivers/infiniband/hw/cxgb4/cm.c b/drivers/infiniband/hw/cxgb4/cm.c
index 8769e7aa097f..76faba892f00 100644
--- a/drivers/infiniband/hw/cxgb4/cm.c
+++ b/drivers/infiniband/hw/cxgb4/cm.c
@@ -3599,8 +3599,9 @@  int c4iw_create_listen(struct iw_cm_id *cm_id, int backlog)
 
 int c4iw_destroy_listen(struct iw_cm_id *cm_id)
 {
-	int err;
 	struct c4iw_listen_ep *ep = to_listen_ep(cm_id);
+	bool ipv6 = false;
+	int err;
 
 	pr_debug("ep %p\n", ep);
 
@@ -3610,13 +3611,14 @@  int c4iw_destroy_listen(struct iw_cm_id *cm_id)
 	    ep->com.local_addr.ss_family == AF_INET) {
 		err = cxgb4_remove_server_filter(
 			ep->com.dev->rdev.lldi.ports[0], ep->stid,
-			ep->com.dev->rdev.lldi.rxq_ids[0], 0);
+			ep->com.dev->rdev.lldi.rxq_ids[0], ipv6);
 	} else {
 		struct sockaddr_in6 *sin6;
+		ipv6 = true;
 		c4iw_init_wr_wait(ep->com.wr_waitp);
 		err = cxgb4_remove_server(
 				ep->com.dev->rdev.lldi.ports[0], ep->stid,
-				ep->com.dev->rdev.lldi.rxq_ids[0], 0);
+				ep->com.dev->rdev.lldi.rxq_ids[0], ipv6);
 		if (err)
 			goto done;
 		err = c4iw_wait_for_reply(&ep->com.dev->rdev, ep->com.wr_waitp,