From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR03-AM5-obe.outbound.protection.outlook.com (mail-eopbgr30045.outbound.protection.outlook.com [40.107.3.45]) by dpdk.org (Postfix) with ESMTP id 222B46CD8; Sat, 29 Dec 2018 21:12:46 +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=pT/BxgRMEWYT9Da9N1xCgcIljiUPEkfrnE/i59v5OYs=; b=hxcPFk05uUPVYNdzJvjrNH9Q0fbZg/MQ3IAq1+EnMhuAmxi6Vozp6O+TIFBKYTtuOhUqbZq5NQhG6p4ALhW01+ZElgLHWfL1BguGBejHht45fLTJd8fJbvUEVKr/H6eEC5tyRGvS1Nd2qMxrrm7BYPFrWQ4FO5NsUJQE9Aq47qw= Received: from AM4PR05MB3265.eurprd05.prod.outlook.com (10.171.186.150) by AM4PR05MB3313.eurprd05.prod.outlook.com (10.171.187.10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1471.20; Sat, 29 Dec 2018 20:12:43 +0000 Received: from AM4PR05MB3265.eurprd05.prod.outlook.com ([fe80::892c:fcf4:8c37:f1bc]) by AM4PR05MB3265.eurprd05.prod.outlook.com ([fe80::892c:fcf4:8c37:f1bc%6]) with mapi id 15.20.1471.019; Sat, 29 Dec 2018 20:12:43 +0000 From: Slava Ovsiienko To: Mordechay Haimovsky , "dev@dpdk.org" CC: Mordechay Haimovsky , "stable@dpdk.org" Thread-Topic: [dpdk-dev] [PATCH v2 1/3] net/mlx5: fix shared counter allocation logic Thread-Index: AQHUnjJl56+rA/EOPEOQBXq627ULuqWWKOtA Date: Sat, 29 Dec 2018 20:12:42 +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: <1545949196-3355-2-git-send-email-motih@mellanox.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=viacheslavo@mellanox.com; x-originating-ip: [95.164.10.10] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; AM4PR05MB3313; 6:HReIh0sNo/MnTWawz7Q1s1rjUYo0enFlVXObdqPSw9ftjB086GNHZCIkB8aeWdmXnPXsIp7rcI4XU7moTCsn8He+OnBqqKfZbkq/oe2pKn+Cj/2UbD5Gny09pQrPiFXxfdkMI9KGhX/L+qk7lEY6oUPR/eYWmnw+OM7PjwI9uY+QWdKvdN1/3oBVPhp1BWZI+xHVymSU7gG59ciog3Nyy1MKdnDmkxT/2bAMEUPcXWdGo8sQVZtGCz5YoLbCZJOHHZLJIFwW5c5JpDC17ErgWiMAAzi2hvTSDFOHx9bfWeWM30/g7hLC1EPG6ArkxDmBqJnozi1lN2BpXuD2TMHWbegr2uvS6lH9d1tLntJjIJAmqkFRG3NEsddHC+IdXXoBmaOvtYUpzlrJM1/XHgOOe+6uRxRaDEIcWNJTCDZ21NZYN2aV7rNuEosPgqa2rVvbdjapqjtJ9jrSGoijmm+oyw==; 5:3lTnYvdIJOnbWFgdhEslL0nWSbtXmaew+stMuP32OR+b9vBmcJy4G6bcbj+GrPRkkVl3yLbze+yWhQoMWDXURtiaCLYnBilEQginDDHk2q6CNoNcgPDxPNPXoJ2fRp+AZ9q+hulj6/pvm6WzWIDeOyTP8qMup7XCejckgljrPMs=; 7:UVZnL8nuVknPpuNdkrfa/hnpexYGQ0CxmalXcftyO+36w2j0+aVpC3EK/xYRlxhLJ8+dk2CDTdPUdrXSbBm6DTW9mzykAByteK7NuG3ppe10/JnlsbvZhUgdappkGOoGofykpnIAwNYTD+MEyxGfWg== x-ms-exchange-antispam-srfa-diagnostics: SOS; x-ms-office365-filtering-correlation-id: 2057d92c-0d52-4407-ea00-08d66dc9fda2 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:AM4PR05MB3313; x-ms-traffictypediagnostic: AM4PR05MB3313: x-microsoft-antispam-prvs: x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(8211001083)(3230021)(908002)(999002)(5005026)(6040522)(8220055)(2401047)(8121501046)(10201501046)(3231475)(944501520)(52105112)(3002001)(93006095)(93001095)(6055026)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123558120)(20161123564045)(20161123562045)(20161123560045)(201708071742011)(7699051)(76991095); SRVR:AM4PR05MB3313; BCL:0; PCL:0; RULEID:; SRVR:AM4PR05MB3313; x-forefront-prvs: 09011458FC x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(39850400004)(376002)(136003)(396003)(346002)(366004)(13464003)(199004)(189003)(76176011)(66066001)(14444005)(81156014)(256004)(3846002)(6116002)(446003)(106356001)(11346002)(97736004)(7696005)(2501003)(74316002)(6506007)(81166006)(105586002)(478600001)(102836004)(186003)(26005)(7736002)(305945005)(53546011)(8936002)(25786009)(2906002)(4326008)(5660300001)(33656002)(486006)(71200400001)(14454004)(476003)(71190400001)(54906003)(6246003)(9686003)(6436002)(68736007)(316002)(110136005)(55016002)(229853002)(86362001)(99286004)(450100002)(53936002); DIR:OUT; SFP:1101; SCL:1; SRVR:AM4PR05MB3313; 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-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: aU/sVbMiUbb3Tu/BSWWmGUz8/b8DW80x0865Sq5vT3nBbjbGwq9loBvLzthGhM9SPBsGGRAfgHMgWYwNg8Bp78AvY5zmwyHH3nuXPAiKn45EzdQ/FbGxAhPeLh2TnV2oK+NwLpbrP3dHt/8rGUVElcKzdHiRrgNSE2tBCeOsQ0E8k9C1Y6LWuoXrV+mjliJLD2Ss7CmHtjWQCQgOqeuPt2PMhgmQdsm2c3UsaVqxypsok5mzi2l+amFgwUKgoMeOryUwD9dGjgNhpWMF8scVmL6mpklZ25NnMj8kB6K0ELTVd2opTObzRNetSRJvzln5 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: 2057d92c-0d52-4407-ea00-08d66dc9fda2 X-MS-Exchange-CrossTenant-originalarrivaltime: 29 Dec 2018 20:12:42.8758 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM4PR05MB3313 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: Sat, 29 Dec 2018 20:12:46 -0000 Moti, don't you forget to update flow_verbs_counter_release() ? Only shared counters should be removed from the list. WBR, Slava > -----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 allocatio= n > logic >=20 > 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. >=20 > Fixes: 84c406e74524 ("net/mlx5: add flow translate function") > Cc: stable@dpdk.org >=20 > Signed-off-by: Moti Haimovsky > --- > v2: > * Modified commit header > --- > drivers/net/mlx5/mlx5_flow_verbs.c | 14 +++++++------- > 1 file changed, 7 insertions(+), 7 deletions(-) >=20 > 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; >=20 > - 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