DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] net/mlx5: fix verbs flow counter query
@ 2019-11-12 14:19 Dekel Peled
  2019-11-12 14:21 ` Slava Ovsiienko
  2019-11-13 11:59 ` Raslan Darawsheh
  0 siblings, 2 replies; 3+ messages in thread
From: Dekel Peled @ 2019-11-12 14:19 UTC (permalink / raw)
  To: matan, shahafs, viacheslavo; +Cc: orika, dev

Function flow_verbs_counter_query() was recently modified.
The new 'if' condition uses a pointer to flow counter-set.
This pointer is valid only if flow contains a count action.

This patch adds check to verify the pointer is valid.

Fixes: d85c7b5ea59f ("net/mlx5: split hairpin flows")
Cc: orika@mellanox.com

Signed-off-by: Dekel Peled <dekelp@mellanox.com>
---
 drivers/net/mlx5/mlx5_flow_verbs.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/mlx5/mlx5_flow_verbs.c b/drivers/net/mlx5/mlx5_flow_verbs.c
index ea85fa1..c787c98 100644
--- a/drivers/net/mlx5/mlx5_flow_verbs.c
+++ b/drivers/net/mlx5/mlx5_flow_verbs.c
@@ -191,7 +191,7 @@
 {
 #if defined(HAVE_IBV_DEVICE_COUNTERS_SET_V42) || \
 	defined(HAVE_IBV_DEVICE_COUNTERS_SET_V45)
-	if (flow->counter->cs) {
+	if (flow->counter && flow->counter->cs) {
 		struct rte_flow_query_count *qc = data;
 		uint64_t counters[2] = {0, 0};
 #if defined(HAVE_IBV_DEVICE_COUNTERS_SET_V42)
-- 
1.8.3.1


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

* Re: [dpdk-dev] [PATCH] net/mlx5: fix verbs flow counter query
  2019-11-12 14:19 [dpdk-dev] [PATCH] net/mlx5: fix verbs flow counter query Dekel Peled
@ 2019-11-12 14:21 ` Slava Ovsiienko
  2019-11-13 11:59 ` Raslan Darawsheh
  1 sibling, 0 replies; 3+ messages in thread
From: Slava Ovsiienko @ 2019-11-12 14:21 UTC (permalink / raw)
  To: Dekel Peled, Matan Azrad, Shahaf Shuler; +Cc: Ori Kam, dev

> -----Original Message-----
> From: Dekel Peled <dekelp@mellanox.com>
> Sent: Tuesday, November 12, 2019 16:19
> To: Matan Azrad <matan@mellanox.com>; Shahaf Shuler
> <shahafs@mellanox.com>; Slava Ovsiienko <viacheslavo@mellanox.com>
> Cc: Ori Kam <orika@mellanox.com>; dev@dpdk.org
> Subject: [PATCH] net/mlx5: fix verbs flow counter query
> 
> Function flow_verbs_counter_query() was recently modified.
> The new 'if' condition uses a pointer to flow counter-set.
> This pointer is valid only if flow contains a count action.
> 
> This patch adds check to verify the pointer is valid.
> 
> Fixes: d85c7b5ea59f ("net/mlx5: split hairpin flows")
> Cc: orika@mellanox.com
> 
> Signed-off-by: Dekel Peled <dekelp@mellanox.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>


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

* Re: [dpdk-dev] [PATCH] net/mlx5: fix verbs flow counter query
  2019-11-12 14:19 [dpdk-dev] [PATCH] net/mlx5: fix verbs flow counter query Dekel Peled
  2019-11-12 14:21 ` Slava Ovsiienko
@ 2019-11-13 11:59 ` Raslan Darawsheh
  1 sibling, 0 replies; 3+ messages in thread
From: Raslan Darawsheh @ 2019-11-13 11:59 UTC (permalink / raw)
  To: Dekel Peled, Matan Azrad, Shahaf Shuler, Slava Ovsiienko; +Cc: Ori Kam, dev

Hi,

> -----Original Message-----
> From: dev <dev-bounces@dpdk.org> On Behalf Of Dekel Peled
> Sent: Tuesday, November 12, 2019 4:19 PM
> To: Matan Azrad <matan@mellanox.com>; Shahaf Shuler
> <shahafs@mellanox.com>; Slava Ovsiienko <viacheslavo@mellanox.com>
> Cc: Ori Kam <orika@mellanox.com>; dev@dpdk.org
> Subject: [dpdk-dev] [PATCH] net/mlx5: fix verbs flow counter query
> 
> Function flow_verbs_counter_query() was recently modified.
> The new 'if' condition uses a pointer to flow counter-set.
> This pointer is valid only if flow contains a count action.
> 
> This patch adds check to verify the pointer is valid.
> 
> Fixes: d85c7b5ea59f ("net/mlx5: split hairpin flows")
> Cc: orika@mellanox.com
> 
> Signed-off-by: Dekel Peled <dekelp@mellanox.com>
> ---
>  drivers/net/mlx5/mlx5_flow_verbs.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/net/mlx5/mlx5_flow_verbs.c
> b/drivers/net/mlx5/mlx5_flow_verbs.c
> index ea85fa1..c787c98 100644
> --- a/drivers/net/mlx5/mlx5_flow_verbs.c
> +++ b/drivers/net/mlx5/mlx5_flow_verbs.c
> @@ -191,7 +191,7 @@
>  {
>  #if defined(HAVE_IBV_DEVICE_COUNTERS_SET_V42) || \
>  	defined(HAVE_IBV_DEVICE_COUNTERS_SET_V45)
> -	if (flow->counter->cs) {
> +	if (flow->counter && flow->counter->cs) {
>  		struct rte_flow_query_count *qc = data;
>  		uint64_t counters[2] = {0, 0};
>  #if defined(HAVE_IBV_DEVICE_COUNTERS_SET_V42)
> --
> 1.8.3.1



Patch applied to next-net-mlx,

Kindest regards,
Raslan Darawsheh

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

end of thread, other threads:[~2019-11-13 11:59 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-11-12 14:19 [dpdk-dev] [PATCH] net/mlx5: fix verbs flow counter query Dekel Peled
2019-11-12 14:21 ` Slava Ovsiienko
2019-11-13 11:59 ` Raslan Darawsheh

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).