From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR02-AM5-obe.outbound.protection.outlook.com (mail-eopbgr00041.outbound.protection.outlook.com [40.107.0.41]) by dpdk.org (Postfix) with ESMTP id B107A1B105; Wed, 2 Jan 2019 07:59:00 +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=TeRVe1Vb0hPTkGMqWLS9gKB2H5JZ4T9V8rwC7WgqsHM=; b=gdFhY7EQxK1bOy7o2nC5OvOwucHyMKziWc6hDb3MEcKVo/kpErJInfZQ/FBaDZM1rNR+z8nhphQNrATfxXg0NPdbwI2znrXYh8OR/7yv9ofVJPO/OnqInxXWAljs6uGBfpmgzbpY9qEIjZEyKfuXJO+W+dc/otRLf/ll98wlQ/4= Received: from AM0PR05MB4435.eurprd05.prod.outlook.com (52.134.92.20) by AM0PR05MB5940.eurprd05.prod.outlook.com (20.178.119.13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1471.20; Wed, 2 Jan 2019 06:58:59 +0000 Received: from AM0PR05MB4435.eurprd05.prod.outlook.com ([fe80::c860:9e3d:3158:8ea]) by AM0PR05MB4435.eurprd05.prod.outlook.com ([fe80::c860:9e3d:3158:8ea%4]) with mapi id 15.20.1471.019; Wed, 2 Jan 2019 06:58:59 +0000 From: Mordechay Haimovsky To: Slava Ovsiienko , "dev@dpdk.org" CC: "stable@dpdk.org" Thread-Topic: [dpdk-dev] [PATCH v2 1/3] net/mlx5: fix shared counter allocation logic Thread-Index: AQHUn7LcuSGLTTiU+E6Iue0ESwGN5aWbkEpg Date: Wed, 2 Jan 2019 06:58:58 +0000 Message-ID: References: <1545748697-3385-4-git-send-email-motih@mellanox.com> <1545949196-3355-2-git-send-email-motih@mellanox.com> In-Reply-To: Accept-Language: he-IL, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=motih@mellanox.com; x-originating-ip: [79.178.41.231] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; AM0PR05MB5940; 6:RapLDpSIjzEN0PjEjJQIWdp9iKqAUoRb4cgxzcMOMuHVjh603byvOL0u9iErRvbyfs7f2VJ0YKaevjOWHWSu4zQVUAK1Nipt+nczwFQcEU9/31MxX1MJW+0G8l4ozmwE4nc6NabLVhCxGV4P4UldKQzFhTbphnqtj0aW5CIleL1177ATKXsQ9DYUXB2XK5YAWGWhLHE3EZDA07LJOC2cylCC7bCy2rjiw99zv7X2VUIwnY4FCBpNoMZiom8iUVk4Jk2mFGoZqFqIGAM/dBwDTecjccgO03IJbFsHEBu+awSwePywqCzdsONar1n25Jj1cV6Uz9I59d2SYYgZ6AchxUfbq1WmWmwEsMJwYqaVBcYdnnXpR+yuZFvMX0OCEDVsuEY3KNMAQ2RK9hbdOjUSABZk+7aDjM7KQdHSK5P7Pkx/vYv3psb+QJKFgIEuZEnNHniYz3F39NUlVknQKoXQ7w==; 5:sSboag5rD09QAiXV/feflJpQIlDGtQtw11wADP810SR9X7LDeamPiJtzYB6FBwKfGyMfszOCFEOstb233URRGWmACnV9JkhxNgTTUNvqH71wX9RTnb+gnBEWyIsZhB0qq6jhl8ew51UngnWaA4DratTa8dD418+ANataK0KR/zw=; 7:6WkrQPEo3UYexmMi1GPBLtNeLPs8eRXfKRLy3kjNTjIsfMS4UNyTe28WW2ymAmhZqD91j+WJqJgP61H2pCiaSFcq/6QZKUZPXqeqPC5LKodIGQ3C0Rz13Knq0nAOBosu4pGFPrG87S7CoHOGz7xAYg== x-ms-exchange-antispam-srfa-diagnostics: SOS; x-ms-office365-filtering-correlation-id: e059ffe8-f539-4bbf-aff8-08d6707fc544 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600109)(711020)(4618075)(2017052603328)(7153060)(7193020); SRVR:AM0PR05MB5940; x-ms-traffictypediagnostic: AM0PR05MB5940: x-microsoft-antispam-prvs: x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(8211001083)(3230021)(908002)(999002)(5005026)(6040522)(8220060)(2401047)(8121501046)(10201501046)(3231475)(944501520)(52105112)(93006095)(93001095)(3002001)(6055026)(6041310)(20161123564045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(20161123562045)(20161123558120)(201708071742011)(7699051)(76991095); SRVR:AM0PR05MB5940; BCL:0; PCL:0; RULEID:; SRVR:AM0PR05MB5940; x-forefront-prvs: 0905A6B2C7 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(376002)(396003)(366004)(346002)(39860400002)(136003)(199004)(189003)(13464003)(33656002)(99286004)(316002)(105586002)(478600001)(110136005)(53936002)(9686003)(229853002)(2906002)(6246003)(55016002)(106356001)(2501003)(68736007)(66066001)(305945005)(74316002)(14454004)(7736002)(71200400001)(97736004)(476003)(11346002)(446003)(76176011)(6506007)(486006)(71190400001)(256004)(5660300001)(86362001)(53546011)(6116002)(450100002)(14444005)(4326008)(25786009)(26005)(81156014)(7696005)(3846002)(102836004)(6436002)(186003)(81166006)(8936002); DIR:OUT; SFP:1101; SCL:1; SRVR:AM0PR05MB5940; H:AM0PR05MB4435.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-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: h/xF7jPmHaC8mkd9XvPCK2y0sfJ5cntfauB15p6su8mRxWMqX5xMC2TuzCU+8mtgxAMqmND/yi1OiC13dLvQDzux4fHbh6dkcddwiJknSzGDn2HsG0tfvTXqQO1pre1awWEzhx+GuL7B1gz3wTNRmAOwDsXAMj5bKg0WICPvfEDaG7a7yIPRMGaJ2V7Pn74rDnAiaCBxAfk0xueKOHbBv/ItqwuUXYwNGe3aK+pQPllCkGi8rilcB6M5HJUYZzfNNdsCHpc4wIN8dDkC2HfOZThe3GOHHt9riliXFxO3r0M5FA6oP9zK77B1hGEVJyFN spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-Network-Message-Id: e059ffe8-f539-4bbf-aff8-08d6707fc544 X-MS-Exchange-CrossTenant-originalarrivaltime: 02 Jan 2019 06:58:59.1023 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR05MB5940 Subject: Re: [dpdk-dev] [PATCH v2 1/3] net/mlx5: fix shared counter allocation logic 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: Wed, 02 Jan 2019 06:59:00 -0000 Hi, Every counter that is created (shared or not) is added to the counters lis= t=20 Therefore every counter destined for removal (i.e. ref_count =3D=3D 0) sho= uld also be=20 Removed from this list. What am I missing ? Moti > -----Original Message----- > From: Slava Ovsiienko > Sent: Saturday, December 29, 2018 10:13 PM > To: Mordechay Haimovsky ; dev@dpdk.org > Cc: Mordechay Haimovsky ; stable@dpdk.org > Subject: RE: [dpdk-dev] [PATCH v2 1/3] net/mlx5: fix shared counter > allocation logic >=20 > Moti, don't you forget to update flow_verbs_counter_release() ? > Only shared counters should be removed from the list. >=20 > WBR, > Slava >=20 > > -----Original Message----- > > From: dev On Behalf Of Mordechay Haimovsky > > Sent: Friday, December 28, 2018 0:20 > > To: dev@dpdk.org > > Cc: Mordechay Haimovsky ; stable@dpdk.org > > Subject: [dpdk-dev] [PATCH v2 1/3] net/mlx5: fix shared counter > > allocation logic > > > > This commit fixes the logic for searching and allocating a shared > > counter in mlx5_flow_verbs. > > Now only the shared counters in the counters list are checked for a > > match and not all the counters as before. > > > > Fixes: 84c406e74524 ("net/mlx5: add flow translate function") > > Cc: stable@dpdk.org > > > > Signed-off-by: Moti Haimovsky > > --- > > v2: > > * Modified commit header > > --- > > drivers/net/mlx5/mlx5_flow_verbs.c | 14 +++++++------- > > 1 file changed, 7 insertions(+), 7 deletions(-) > > > > diff --git a/drivers/net/mlx5/mlx5_flow_verbs.c > > b/drivers/net/mlx5/mlx5_flow_verbs.c > > index 81ec59d..409e1cd 100644 > > --- a/drivers/net/mlx5/mlx5_flow_verbs.c > > +++ b/drivers/net/mlx5/mlx5_flow_verbs.c > > @@ -121,13 +121,13 @@ > > struct mlx5_flow_counter *cnt; > > int ret; > > > > - LIST_FOREACH(cnt, &priv->flow_counters, next) { > > - if (!cnt->shared || cnt->shared !=3D shared) > > - continue; > > - if (cnt->id !=3D id) > > - continue; > > - cnt->ref_cnt++; > > - return cnt; > > + if (shared) { > > + LIST_FOREACH(cnt, &priv->flow_counters, next) { > > + if (cnt->shared && cnt->id =3D=3D id) { > > + cnt->ref_cnt++; > > + return cnt; > > + } > > + } > > } > > cnt =3D rte_calloc(__func__, 1, sizeof(*cnt), 0); > > if (!cnt) { > > -- > > 1.8.3.1