[dpdk-dev] [PATCH] net/mlx5: fix verbs flow counter query
Raslan Darawsheh
rasland at mellanox.com
Wed Nov 13 12:59:09 CET 2019
Hi,
> -----Original Message-----
> From: dev <dev-bounces at dpdk.org> On Behalf Of Dekel Peled
> Sent: Tuesday, November 12, 2019 4:19 PM
> To: Matan Azrad <matan at mellanox.com>; Shahaf Shuler
> <shahafs at mellanox.com>; Slava Ovsiienko <viacheslavo at mellanox.com>
> Cc: Ori Kam <orika at mellanox.com>; dev at 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 at mellanox.com
>
> Signed-off-by: Dekel Peled <dekelp at 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
More information about the dev
mailing list