patches for DPDK stable branches
 help / color / mirror / Atom feed
* [dpdk-stable] [PATCH] net/mlx5: fix flow counters deletion in Verbs
       [not found] <1540289032-29628-9-git-send-email-viacheslavo@mellanox.com>
@ 2018-10-27 10:54 ` Slava Ovsiienko
  2018-10-28 12:53   ` Shahaf Shuler
  0 siblings, 1 reply; 2+ messages in thread
From: Slava Ovsiienko @ 2018-10-27 10:54 UTC (permalink / raw)
  To: Shahaf Shuler; +Cc: dev, Slava Ovsiienko, stable

The Flow counters created with Verbs are erroneously destroyed
in Flow remove function (flow_verbs_remove()). Counter Verbs
handles stored in the translated rule buffer become invalid.
If rule is reapplied with these invalid counter handles the
driver hangs.

The counter should be destroyed with Verbs in the Flow destroy
function. The Flow remove function should keep counters intact.

Fixes: 60bd8c9747e8 ("net/mlx5: add count flow action")
Cc: stable@dpdk.org

Signed-off-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
---
 drivers/net/mlx5/mlx5_flow_verbs.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/net/mlx5/mlx5_flow_verbs.c b/drivers/net/mlx5/mlx5_flow_verbs.c
index 81bc39f..2e506b9 100644
--- a/drivers/net/mlx5/mlx5_flow_verbs.c
+++ b/drivers/net/mlx5/mlx5_flow_verbs.c
@@ -1669,10 +1669,6 @@
 			verbs->hrxq = NULL;
 		}
 	}
-	if (flow->counter) {
-		flow_verbs_counter_release(flow->counter);
-		flow->counter = NULL;
-	}
 }
 
 /**
@@ -1696,6 +1692,10 @@
 		LIST_REMOVE(dev_flow, next);
 		rte_free(dev_flow);
 	}
+	if (flow->counter) {
+		flow_verbs_counter_release(flow->counter);
+		flow->counter = NULL;
+	}
 }
 
 /**
-- 
1.8.3.1

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [dpdk-stable] [PATCH] net/mlx5: fix flow counters deletion in Verbs
  2018-10-27 10:54 ` [dpdk-stable] [PATCH] net/mlx5: fix flow counters deletion in Verbs Slava Ovsiienko
@ 2018-10-28 12:53   ` Shahaf Shuler
  0 siblings, 0 replies; 2+ messages in thread
From: Shahaf Shuler @ 2018-10-28 12:53 UTC (permalink / raw)
  To: Slava Ovsiienko; +Cc: dev, stable

Saturday, October 27, 2018 1:54 PM¸ Slava Ovsiienko:
> Subject: [PATCH] net/mlx5: fix flow counters deletion in Verbs
> 
> The Flow counters created with Verbs are erroneously destroyed in Flow
> remove function (flow_verbs_remove()). Counter Verbs handles stored in
> the translated rule buffer become invalid.
> If rule is reapplied with these invalid counter handles the driver hangs.
> 
> The counter should be destroyed with Verbs in the Flow destroy function.
> The Flow remove function should keep counters intact.
> 
> Fixes: 60bd8c9747e8 ("net/mlx5: add count flow action")
> Cc: stable@dpdk.org
> 

Very nice commit log.

> Signed-off-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>

Acked-by: Shahaf Shuler <shahafs@mellanox.com>

Applied to next-net-mlx, thanks. 

> ---
>  drivers/net/mlx5/mlx5_flow_verbs.c | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/net/mlx5/mlx5_flow_verbs.c
> b/drivers/net/mlx5/mlx5_flow_verbs.c
> index 81bc39f..2e506b9 100644
> --- a/drivers/net/mlx5/mlx5_flow_verbs.c
> +++ b/drivers/net/mlx5/mlx5_flow_verbs.c
> @@ -1669,10 +1669,6 @@
>  			verbs->hrxq = NULL;
>  		}
>  	}
> -	if (flow->counter) {
> -		flow_verbs_counter_release(flow->counter);
> -		flow->counter = NULL;
> -	}
>  }
> 
>  /**
> @@ -1696,6 +1692,10 @@
>  		LIST_REMOVE(dev_flow, next);
>  		rte_free(dev_flow);
>  	}
> +	if (flow->counter) {
> +		flow_verbs_counter_release(flow->counter);
> +		flow->counter = NULL;
> +	}
>  }
> 
>  /**
> --
> 1.8.3.1

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2018-10-28 12:53 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <1540289032-29628-9-git-send-email-viacheslavo@mellanox.com>
2018-10-27 10:54 ` [dpdk-stable] [PATCH] net/mlx5: fix flow counters deletion in Verbs Slava Ovsiienko
2018-10-28 12:53   ` Shahaf Shuler

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).