From mboxrd@z Thu Jan 1 00:00:00 1970 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) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Mellanox.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=YTZmsVmkma+fmcnPgUQCmEDrQ6qjZzi2mIA3x4uNXvY=; b=S+1eo74KoIkZ3CKCpVqh+sD2+KiNMeUekED86SbI0XC05sevrh7ed2kfEQQccRV3ATX3jyiGbtSmlmlUYaJCw/+M9+6Zwka0Xkw60+aCgRIh0Yi5QLiEtp+Y5WqO7ksp94p2EtstX5zSmVBOKQ3OkZR0WfkmKaWJS/kvXCzQ51o= Received: from AM4PR05MB3265.eurprd05.prod.outlook.com (10.171.186.150) by AM4PR05MB3250.eurprd05.prod.outlook.com (10.171.186.147) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1294.21; Sat, 3 Nov 2018 06:18:43 +0000 Received: from AM4PR05MB3265.eurprd05.prod.outlook.com ([fe80::544b:a68d:e6a5:ba6e]) by AM4PR05MB3265.eurprd05.prod.outlook.com ([fe80::544b:a68d:e6a5:ba6e%2]) with mapi id 15.20.1294.027; Sat, 3 Nov 2018 06:18:43 +0000 From: Slava Ovsiienko To: Shahaf Shuler CC: "dev@dpdk.org" , Yongseok Koh , Slava Ovsiienko , Mordechay Haimovsky Thread-Topic: [PATCH v5 10/13] net/mlx5: fix E-Switch Flow counter deletion Thread-Index: AQHUcz0S+dbsjA/80E6R7S7Zl7o2QA== 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> In-Reply-To: <1541225876-8817-1-git-send-email-viacheslavo@mellanox.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: CWLP123CA0088.GBRP123.PROD.OUTLOOK.COM (2603:10a6:401:5b::28) To AM4PR05MB3265.eurprd05.prod.outlook.com (2603:10a6:205:4::22) authentication-results: spf=none (sender IP is ) smtp.mailfrom=viacheslavo@mellanox.com; x-ms-exchange-messagesentrepresentingtype: 1 x-originating-ip: [37.142.13.130] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; AM4PR05MB3250; 6:sa/Gx3vMvWtKN+iQ7WHdG1HLWU6VClwRWGgvXK4+TG4CPu2uQEvsUCWbH4cKMD/phxNZBUkK64YaYM0bkrZAcxI3DjraCQ4R3VmZnpVsoDo9E/1UCwWLXMrIeXKpr0Z3VJIF7scaNU11AbZRRqzG3IcbKJzSjpawzVSlgDgomukSltKXEYEzZj/bxrSrMmzLUIPJrDed1f3CVs7G4usTSUgSZdt9EqsS+4Mj5izqjlFWiL5GwRiHFi9WFqlsuTmbXhhaNgNb4Oa8jA2SfZvi2Vn1neILEgACPqRtsVBqwXgHc7ULh7EhctjFid4fhWwkwLNxaeuLCgv4Ih2p8wq/+G2/+RbZmTeOAyI0k3/DY7ftb/ZMSKmXyWPqPAQbtFX5CAzFFLjMbSr1HNz4ZYPktB6howmid9y4l4NaFh1Uvgh4mj5J4dhDQh1Kp1NNKF8Sk635l2zoBmRjeXZ0p6vTbA==; 5:CO9T5O3ym1jBNY3BbKddZ0Eb57+tTeWCnNqCs29QAhKrbfGKVUKT73RCiD2fmmklgxi082SEG5uITYOB6BlZykalA47OPpxSYpEnEdVmkpm2XOa0zfjmPl9PWRZZ3TJzvoxlICgAnpc42HNKRVSXmhL2a/MSTcmx28ZAxJ9sLAs=; 7:F0CTVViRvx6ROuA29ezLJH15fIRCYueQqEDZHa++/pk+dHOniWcgj1j3IV69EApfbTr+XP0Aq9pFzEiUvkt0of0ErWHN0rXaTTU691UmmHjVatG4dKFRbA+WzSQeSM5Zxxry+9PipJWPTkKXZdyknA== x-ms-office365-filtering-correlation-id: 922ab841-1b17-477d-9662-08d64154346c x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989299)(5600074)(711020)(4618075)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(2017052603328)(7153060)(7193020); SRVR:AM4PR05MB3250; x-ms-traffictypediagnostic: AM4PR05MB3250: x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:; x-ms-exchange-senderadcheck: 1 x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(8121501046)(5005006)(3231382)(944501410)(52105095)(3002001)(10201501046)(93006095)(93001095)(6055026)(148016)(149066)(150057)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123562045)(20161123560045)(20161123564045)(20161123558120)(201708071742011)(7699051)(76991095); SRVR:AM4PR05MB3250; BCL:0; PCL:0; RULEID:; SRVR:AM4PR05MB3250; x-forefront-prvs: 08457955C4 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(346002)(376002)(366004)(39860400002)(136003)(396003)(189003)(199004)(81156014)(66066001)(107886003)(6436002)(71200400001)(71190400001)(6636002)(106356001)(68736007)(25786009)(316002)(52116002)(3846002)(6486002)(6116002)(4326008)(76176011)(97736004)(6862004)(486006)(476003)(478600001)(11346002)(305945005)(37006003)(5660300001)(7736002)(105586002)(2900100001)(26005)(2906002)(99286004)(186003)(2616005)(53936002)(446003)(6512007)(6506007)(8676002)(256004)(8936002)(386003)(14454004)(14444005)(36756003)(102836004)(81166006)(86362001)(54906003); DIR:OUT; SFP:1101; SCL:1; SRVR:AM4PR05MB3250; H:AM4PR05MB3265.eurprd05.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; received-spf: None (protection.outlook.com: mellanox.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: 7jLwDoGHd3SaoNl/jIQunGIHsKL1RcpE/GUVq/sfKPU3CfjRLuR+wKOdnUIjetZxVIyJnOuQA7KfWgYe0k+RpoBxDRFqrs8wKM5Y4B7spFt8lcShs8cJpBX02jnFiXxH0tkUqraK6pTb0mBEhLpjjRzNSoRElrB3t9KldykArYq52f8DA9SQEcV5txIB6ndCt7JzLV6zA7ZJ8CfGF1hQNCzTwE/Yqr0SKhpUKzTJLN/itHVuSXWMOip4+Em+8OZjxApfMTpnb1E9Ez/Z/GaeCc2FB0u4UokOjEkDFm5RPrxQXDmxuxpvET6kn5N/kw5FHkcfShm3sYNuenJVzSTHvRqwoTZm7UHoobFhX1pkJRU= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-Network-Message-Id: 922ab841-1b17-477d-9662-08d64154346c X-MS-Exchange-CrossTenant-originalarrivaltime: 03 Nov 2018 06:18:43.4685 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM4PR05MB3250 Subject: [dpdk-dev] [PATCH v5 10/13] net/mlx5: fix E-Switch Flow counter deletion X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Nov 2018 06:18:45 -0000 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