From mboxrd@z Thu Jan 1 00:00:00 1970 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) 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=35gmmC6fbOJMVfGP2XJh7RyAZaDN2DajFZuHJCyKEVQ=; b=AvPy7+erVsQNGQ1cbrXQpiaVSr6tPLqW0xKDiVoOFrTAJvkCK5BTMQcIaW636dBE2z+gvgFHAYVPMsTxVk0E0xRTkQq47QoWBaHcKeJCkJ8dAENIfEv0K/lb0ToyWAQljQL8EucZvr0psLwfVvKDnOxX9Yhg7sVn1rFlITkoQFk= Received: from AM4PR05MB3265.eurprd05.prod.outlook.com (10.171.186.150) by AM4PR05MB1457.eurprd05.prod.outlook.com (10.164.79.27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1273.20; Thu, 1 Nov 2018 12:19:32 +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.1273.030; Thu, 1 Nov 2018 12:19:32 +0000 From: Slava Ovsiienko To: Shahaf Shuler CC: "dev@dpdk.org" , Yongseok Koh , Slava Ovsiienko , Mordechay Haimovsky Thread-Topic: [PATCH v3 10/13] net/mlx5: fix e-switch Flow counter deletion Thread-Index: AQHUcd0kIPaJtwCiP0WS0PbG/+yYXQ== 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> In-Reply-To: <1541074741-41368-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: LO2P265CA0079.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:8::19) 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; AM4PR05MB1457; 6:mV6HL4Q/vzykhjINaEF/THrN5aZz+FvKQeotyv/7E7eLJtiYGdeDkDbjYASNAVVIB6Ng5KD8D57rEMBSkL4HAyeeMsVOsKP5ZSLuK8NUgTj/BtQ9bjySzJPY2T/mXAg5K6SyQ1FvhAF8QP7sYuQhYm+yc9uyyz7scYJtttt18Lb6AJNcGvuGWD0zKA+src+MGMum2CdTERFwvQ/U1fPoWSSkc4OEOhOAbcYy3+nb1d02q4IjVDgGVpqo5Hsa7HGsOECgCgf9pVLAoyeu1Y94pTe5kKiSX6lAU57P4p6/GZwhiwCoX08ZTUDAOc27L/mwzkT2SwOGdrwGIc3ypRYUsXvILs9wOG397iGbXarq1ZzoYxX4CFgRjZh2gCDIxyBxouB8w9i4vrcqSzsqYuxE7CfnVku2yV/tLPtuaQXGgmtQqXkeIdq7GrTgELdmlcmfKSS6GiGfogL9iMEkYPRPAA==; 5:W7qjgCpfn7UBs00lKSU/u8lvbaX69x8UeAt2KAt0cGoaMFlSctJbuTfm9M/XavpUmsRLD+xxlXaGd00+THaPCSuXl3eJqOrKdAs89Ak52HlgKF0+yLpSbJCfOjGwtxN87OoCmG9Or3ccJu3cxaXwEOCyZEKOMx/LIr898blfDyw=; 7:xnPB1Qg8DEqlbL4kbf00m7peq+hWqPb2WWJrXtjS2+97mNq5zGKn7SxYFELd0W7QXxsm1LoYQSi4/gsW0Xm/o9NacvJEQjp2tmzzBhihq1ME4S7drapmQrmTxmNVBCqTkVyTISM+XqEG63iPISjAmg== x-ms-office365-filtering-correlation-id: 13b29ddf-035a-43f8-02af-08d63ff4472c x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600074)(711020)(4618075)(2017052603328)(7153060)(7193020); SRVR:AM4PR05MB1457; x-ms-traffictypediagnostic: AM4PR05MB1457: 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)(5005006)(8121501046)(3231382)(944501410)(52105095)(93006095)(93001095)(10201501046)(3002001)(6055026)(148016)(149066)(150057)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123558120)(20161123562045)(20161123564045)(20161123560045)(201708071742011)(7699051)(76991095); SRVR:AM4PR05MB1457; BCL:0; PCL:0; RULEID:; SRVR:AM4PR05MB1457; x-forefront-prvs: 0843C17679 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(376002)(396003)(39860400002)(346002)(136003)(366004)(199004)(189003)(11346002)(446003)(106356001)(476003)(105586002)(4326008)(97736004)(2616005)(478600001)(6636002)(5250100002)(99286004)(486006)(66066001)(6862004)(2900100001)(25786009)(37006003)(54906003)(5660300001)(316002)(8936002)(8676002)(81156014)(81166006)(68736007)(7736002)(305945005)(3846002)(6116002)(76176011)(2906002)(102836004)(26005)(186003)(386003)(6506007)(107886003)(14454004)(6486002)(52116002)(6512007)(53936002)(6436002)(36756003)(86362001)(71190400001)(71200400001)(14444005)(256004); DIR:OUT; SFP:1101; SCL:1; SRVR:AM4PR05MB1457; H:AM4PR05MB3265.eurprd05.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; received-spf: None (protection.outlook.com: mellanox.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: cQhbV9Scads/k48WKUEFPqOEB3oFCV1TG4qQhluEqBgfRKeDo1oLmRoZ4GYFGACfFTISTyfdqRGNw89jD0X+bDdNfTNubjjFoMWuqih6bBQgIT1fBMPgn2xiBVjSc52ZrxnDW+3avrjr37gja4kCghGCzyebdk7CWuS83rL++GvHCtEzLZr4aE7JWsZDNq81uQ4OyC6fvtSbN9/aShigB4xGCtd9FkAETQ7JQH4N0kYcZz3EKKoW2JAFvdLPiWZ6M5Rc5j672RpR/MFv0E/5nQ8mVDhIeOWcUL2kHZMIWFb57Zx3Tl/pjBMSYJAi/LG9VP7FGfa3+W0+yyW9EhGAAoDEHw1a4VImSplxo392hx4= 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: 13b29ddf-035a-43f8-02af-08d63ff4472c X-MS-Exchange-CrossTenant-originalarrivaltime: 01 Nov 2018 12:19:32.2359 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM4PR05MB1457 Subject: [dpdk-dev] [PATCH v3 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: Thu, 01 Nov 2018 12:19:33 -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 --- 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