From mboxrd@z Thu Jan 1 00:00:00 1970 From: Slava Ovsiienko Subject: [PATCH v3 10/13] net/mlx5: fix e-switch Flow counter deletion Date: Thu, 1 Nov 2018 12:19:32 +0000 Message-ID: <1541074741-41368-11-git-send-email-viacheslavo@mellanox.com> References: <1539612815-47199-1-git-send-email-viacheslavo@mellanox.com> <1541074741-41368-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 EUR03-AM5-obe.outbound.protection.outlook.com (mail-eopbgr30078.outbound.protection.outlook.com [40.107.3.78]) by dpdk.org (Postfix) with ESMTP id 370BB1B12B for ; Thu, 1 Nov 2018 13:19:33 +0100 (CET) In-Reply-To: <1541074741-41368-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 --- 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 67a6ff3..02b64d6 100644 --- a/drivers/net/mlx5/mlx5_flow_tcf.c +++ b/drivers/net/mlx5/mlx5_flow_tcf.c @@ -3803,12 +3803,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; @@ -3836,6 +3830,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