summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorViacheslav Ovsiienko <viacheslavo@mellanox.com>2018-11-03 06:18:43 +0000
committerFerruh Yigit <ferruh.yigit@intel.com>2018-11-05 15:01:25 +0100
commit4eaa82256c9dfb4f4cefc3900c94a58c15d740f2 (patch)
tree1bc3d09b06ea5c9dc3b75cc9a317b31a9aad2bc6 /drivers
parent6e74990b3463a34669e09ccae1d34727a83b082b (diff)
downloaddpdk-4eaa82256c9dfb4f4cefc3900c94a58c15d740f2.zip
dpdk-4eaa82256c9dfb4f4cefc3900c94a58c15d740f2.tar.gz
dpdk-4eaa82256c9dfb4f4cefc3900c94a58c15d740f2.tar.xz
net/mlx5: fix E-Switch flow counter deletion
The counters for E-Switch rules were erroneously deleted in flow_tcf_remove() routine. The counters deletion is moved to flow_tcf_destroy() routine. Fixes: e1114ff6a5ab ("net/mlx5: support e-switch flow count action") Suggested-by: Adrien Mazarguil <adrien.mazarguil@6wind.com> Signed-off-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com> Acked-by: Yongseok Koh <yskoh@mellanox.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/mlx5/mlx5_flow_tcf.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/drivers/net/mlx5/mlx5_flow_tcf.c b/drivers/net/mlx5/mlx5_flow_tcf.c
index 26a91c5..37d9edf 100644
--- a/drivers/net/mlx5/mlx5_flow_tcf.c
+++ b/drivers/net/mlx5/mlx5_flow_tcf.c
@@ -3850,12 +3850,6 @@ flow_tcf_remove(struct rte_eth_dev *dev, struct rte_flow *flow)
if (!flow)
return;
- if (flow->counter) {
- if (--flow->counter->ref_cnt == 0) {
- rte_free(flow->counter);
- flow->counter = NULL;
- }
- }
dev_flow = LIST_FIRST(&flow->dev_flows);
if (!dev_flow)
return;
@@ -3883,6 +3877,12 @@ flow_tcf_destroy(struct rte_eth_dev *dev, struct rte_flow *flow)
if (!flow)
return;
flow_tcf_remove(dev, flow);
+ if (flow->counter) {
+ if (--flow->counter->ref_cnt == 0) {
+ rte_free(flow->counter);
+ flow->counter = NULL;
+ }
+ }
dev_flow = LIST_FIRST(&flow->dev_flows);
if (!dev_flow)
return;