From mboxrd@z Thu Jan 1 00:00:00 1970 From: Slava Ovsiienko Subject: [PATCH v5 10/13] net/mlx5: fix E-Switch Flow counter deletion Date: Sat, 3 Nov 2018 06:18:43 +0000 Message-ID: <1541225876-8817-11-git-send-email-viacheslavo@mellanox.com> References: <1541181152-15788-2-git-send-email-viacheslavo@mellanox.com> <1541225876-8817-1-git-send-email-viacheslavo@mellanox.com> Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Cc: "dev@dpdk.org" , Yongseok Koh , Slava Ovsiienko , Mordechay Haimovsky To: Shahaf Shuler Return-path: Received: from EUR02-VE1-obe.outbound.protection.outlook.com (mail-eopbgr20061.outbound.protection.outlook.com [40.107.2.61]) by dpdk.org (Postfix) with ESMTP id 79B7F5A44 for ; Sat, 3 Nov 2018 07:18:44 +0100 (CET) In-Reply-To: <1541225876-8817-1-git-send-email-viacheslavo@mellanox.com> Content-Language: en-US List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 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") Cc: Moti Haimovsky Suggested-by: Adrien Mazarguil Signed-off-by: Viacheslav Ovsiienko Acked-by: Yongseok Koh --- drivers/net/mlx5/mlx5_flow_tcf.c | 12 ++++++------ 1 file 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 @@ struct pedit_parser { =20 if (!flow) return; - if (flow->counter) { - if (--flow->counter->ref_cnt =3D=3D 0) { - rte_free(flow->counter); - flow->counter =3D NULL; - } - } dev_flow =3D LIST_FIRST(&flow->dev_flows); if (!dev_flow) return; @@ -3883,6 +3877,12 @@ struct pedit_parser { if (!flow) return; flow_tcf_remove(dev, flow); + if (flow->counter) { + if (--flow->counter->ref_cnt =3D=3D 0) { + rte_free(flow->counter); + flow->counter =3D NULL; + } + } dev_flow =3D LIST_FIRST(&flow->dev_flows); if (!dev_flow) return; --=20 1.8.3.1