net/mlx5: fix flow count action for shared counter
authorShahaf Shuler <shahafs@mellanox.com>
Sun, 29 Jul 2018 10:43:32 +0000 (13:43 +0300)
committerShahaf Shuler <shahafs@mellanox.com>
Thu, 2 Aug 2018 10:34:17 +0000 (12:34 +0200)
According to commit fb8fd96d4251 ("ethdev: add shared counter to flow
API") the counter id should be taken into account only when the shared
flag is set.

Fixes: 60bd8c9747e8 ("net/mlx5: add count flow action")

Signed-off-by: Shahaf Shuler <shahafs@mellanox.com>
drivers/net/mlx5/mlx5_flow.c

index b94c442..adda4df 100644 (file)
@@ -490,7 +490,7 @@ mlx5_flow_counter_new(struct rte_eth_dev *dev, uint32_t shared, uint32_t id)
        struct mlx5_flow_counter *cnt;
 
        LIST_FOREACH(cnt, &priv->flow_counters, next) {
-               if (cnt->shared != shared)
+               if (!cnt->shared || cnt->shared != shared)
                        continue;
                if (cnt->id != id)
                        continue;