From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR04-HE1-obe.outbound.protection.outlook.com (mail-eopbgr70073.outbound.protection.outlook.com [40.107.7.73]) by dpdk.org (Postfix) with ESMTP id A827F1B20E for ; Thu, 1 Nov 2018 23:00: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=eW2UG2fOiQ5vPxmG2C1/+wTeI61hDLQonBwcgmdEIUM=; b=C/fTEtcvJQw1zODORbmYxBIEn++hQm0n64ON7FOcM7Bqei3J4bp3uNRUHK5FEQCfu9iA/wlhm8ZlPNk9AoqLEgEhljLtRY8ffyUm5T6GAiqNzApmfOWOHM3h6p3ft7EERRLqYDb6+f6qLKPoE/GPblzEgf2Ha5S6cIVzVtAZ9Ho= Received: from DB3PR0502MB3980.eurprd05.prod.outlook.com (52.134.72.27) by DB3PR0502MB3993.eurprd05.prod.outlook.com (52.134.70.154) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1294.20; Thu, 1 Nov 2018 22:00:31 +0000 Received: from DB3PR0502MB3980.eurprd05.prod.outlook.com ([fe80::f8a1:fcab:94f0:97cc]) by DB3PR0502MB3980.eurprd05.prod.outlook.com ([fe80::f8a1:fcab:94f0:97cc%4]) with mapi id 15.20.1273.030; Thu, 1 Nov 2018 22:00:31 +0000 From: Yongseok Koh To: Slava Ovsiienko CC: Shahaf Shuler , "dev@dpdk.org" , Mordechay Haimovsky Thread-Topic: [PATCH v3 10/13] net/mlx5: fix e-switch Flow counter deletion Thread-Index: AQHUcd0l6EnJi53SmkCZbMt0TmQwWqU7eNoA Date: Thu, 1 Nov 2018 22:00:31 +0000 Message-ID: <20181101220023.GK6118@mtidpdk.mti.labs.mlnx> References: <1539612815-47199-1-git-send-email-viacheslavo@mellanox.com> <1541074741-41368-1-git-send-email-viacheslavo@mellanox.com> <1541074741-41368-11-git-send-email-viacheslavo@mellanox.com> In-Reply-To: <1541074741-41368-11-git-send-email-viacheslavo@mellanox.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: BYAPR05CA0013.namprd05.prod.outlook.com (2603:10b6:a03:c0::26) To DB3PR0502MB3980.eurprd05.prod.outlook.com (2603:10a6:8:10::27) authentication-results: spf=none (sender IP is ) smtp.mailfrom=yskoh@mellanox.com; x-ms-exchange-messagesentrepresentingtype: 1 x-originating-ip: [209.116.155.178] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; DB3PR0502MB3993; 6:CUr4tqsgZGELMgyVUwBAirnZ/KolimxmR9pFdrQit/rtbZdwvItJqlOhAuyH5GIGX86funWNoEO+McVph3EgL/JfW8aJAr3X4c4jKCxH2vtkHnPsNIxaur1+YvhMuROGN8K3FLTC0GI1h9RAOklCL0N54VPimMUpkY7jPUs4JVdrRI/pnKr5TIIZEUVGXWJHacTOfHKPEnDTmjAmaQSTlAaVj86qoRHnnQEDxVtHf502DI23exH6GhCaBS97Ccc2QlCHo7iSgGo718p4uKscAyXY+rOGpBgUunZ9YISbTRyl6lCYDsD3TkEiz0IwmoxmlRQN0iBendO0k9KoXftnz9qCFt2hzHMNfDke19XsBCh1y3e1osG/49Kto2Ji7obArKinX5CO0nDz3BrSyLDDLw4u5nKKrEpJjNQtyglafuLdhJtye/Megamumd9yc0+uzMNBZJZBJvd78mfA1Ri4oQ==; 5:9iPsLtQ+iBBqjWwfNzCmjFopHfu9qw5523EBVddAjTH3J1G0ISEgqX8FOoYeMqk+T0lWfBjvm/kzatZP7fJ53/Gb10WLqd1hg66P8s4iHPbhi10KciKSzL7Z6/zfdAwwQEj7VnUcEj3Dm6T5ul55mUCOvkC0r6yUiOvCV3RV8wI=; 7:6halwEe0f9m7T8ZT/bm2Z1H07w06K6fseuYg3EbdnWwegosFz6N9j3E3v61zW0HyzMC9AbcPU7jTcR/P7IoD4FQc5U3qN78L9+lV2uEy3mRD+sEWjYNzj/XaOHBvJeH1ajYGmfhBfpvMMtFJ6jjJAA== x-ms-office365-filtering-correlation-id: fc74da93-48ee-4b9f-fc10-08d640457128 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:DB3PR0502MB3993; x-ms-traffictypediagnostic: DB3PR0502MB3993: 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)(10201501046)(3002001)(93006095)(93001095)(3231382)(944501410)(52105095)(6055026)(148016)(149066)(150057)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(20161123562045)(20161123558120)(20161123564045)(201708071742011)(7699051)(76991095); SRVR:DB3PR0502MB3993; BCL:0; PCL:0; RULEID:; SRVR:DB3PR0502MB3993; x-forefront-prvs: 0843C17679 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(979002)(366004)(396003)(136003)(376002)(346002)(39860400002)(189003)(199004)(76176011)(54906003)(52116002)(6506007)(486006)(33896004)(6116002)(386003)(446003)(106356001)(81156014)(99286004)(8676002)(11346002)(14444005)(6436002)(476003)(105586002)(256004)(2906002)(1076002)(71190400001)(2900100001)(102836004)(71200400001)(3846002)(316002)(86362001)(25786009)(186003)(7736002)(14454004)(478600001)(26005)(229853002)(81166006)(107886003)(66066001)(305945005)(68736007)(6862004)(4326008)(8936002)(33656002)(6246003)(53936002)(6636002)(6512007)(5660300001)(9686003)(97736004)(6486002)(969003)(989001)(999001)(1009001)(1019001); DIR:OUT; SFP:1101; SCL:1; SRVR:DB3PR0502MB3993; H:DB3PR0502MB3980.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: MhUp9qNxyePyrDZ4unjgHWG/oyfLCaX432i2XxGxT6CG+ai3fvKgTbymerDoyZ30AHkRupYoDeo3R607Tr1G6JAcxNkVXUiCVjTS+QDtiJ2tvHQKJJn0bYZWjRztiWd1tjCOsHRiVmqLJYJxcYUtUg62Xal7QPe9BdlvZUy22z7W1aYCbw5kENU4z/bulaTQjoXGKavZ69lBdlVwMjwiKGIjJYIRo9GEyfBoTdhazIP04jcK0hdv+WGLRzl770rhLYEhoz4aePrHDTmWqME45HHwsi3O1xSi6Od0dN5ncQHmCgA9FMBcEsxCBLpWEXMuzhGGWU0fGE7md4sS4nlnBDRUo/DuGvco4bNyXktuHwk= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="us-ascii" Content-ID: <8BCC1A5B9F2B0D4EB37C5B4C8BE756CB@eurprd05.prod.outlook.com> Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-Network-Message-Id: fc74da93-48ee-4b9f-fc10-08d640457128 X-MS-Exchange-CrossTenant-originalarrivaltime: 01 Nov 2018 22:00:31.8208 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB3PR0502MB3993 Subject: Re: [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 22:00:34 -0000 On Thu, Nov 01, 2018 at 05:19:32AM -0700, Slava Ovsiienko wrote: > The counters for E-Switch rules were erroneously deleted in > flow_tcf_remove() routine. The counters deletion is moved to > flow_tcf_destroy() routine. >=20 > Fixes: e1114ff6a5ab ("net/mlx5: support e-switch flow count action") > Cc: Moti Haimovsky >=20 > Suggested-by: Adrien Mazarguil > Signed-off-by: Viacheslav Ovsiienko > --- Acked-by: Yongseok Koh Thanks > drivers/net/mlx5/mlx5_flow_tcf.c | 12 ++++++------ > 1 file changed, 6 insertions(+), 6 deletions(-) >=20 > diff --git a/drivers/net/mlx5/mlx5_flow_tcf.c b/drivers/net/mlx5/mlx5_flo= w_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 >=20