From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR02-VE1-obe.outbound.protection.outlook.com (mail-eopbgr20050.outbound.protection.outlook.com [40.107.2.50]) by dpdk.org (Postfix) with ESMTP id B961F1B201 for ; Tue, 25 Dec 2018 15:38:43 +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=bOj8HLnL8a0+UAsgMuRNiDPHWjxm73W+dqZG8VEEBd0=; b=H5Mh6Dm8Fs0t3HLfGPTycC+enQ9MYoiLEJIYu4zNNnI4RkXRPKTM3NQoziSOrB74X0zgqgd8BRjHbVo0pdMGg/LMp9KGpHSfWosTKVCoAzJ5TIWWzKczEiyMBfIg5Zl9R3MzxHdBHfDQPNe4dThb0zshFIXCSAgP5/xF3O1qwGc= Received: from AM0PR05MB4435.eurprd05.prod.outlook.com (52.134.92.20) by AM0PR05MB5169.eurprd05.prod.outlook.com (20.178.18.18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1471.20; Tue, 25 Dec 2018 14:38:43 +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.1446.027; Tue, 25 Dec 2018 14:38:43 +0000 From: Mordechay Haimovsky To: "dev@dpdk.org" CC: Mordechay Haimovsky Thread-Topic: [PATCH v1 1/3] net/mlx5: modify shared counter allocation logic Thread-Index: AQHUnF+IeusPm/YkiEOgJu50gYWoRA== Date: Tue, 25 Dec 2018 14:38:43 +0000 Message-ID: <1545748697-3385-2-git-send-email-motih@mellanox.com> References: <1545748697-3385-1-git-send-email-motih@mellanox.com> In-Reply-To: <1545748697-3385-1-git-send-email-motih@mellanox.com> Accept-Language: he-IL, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: CWLP265CA0157.GBRP265.PROD.OUTLOOK.COM (2603:10a6:401:52::25) To AM0PR05MB4435.eurprd05.prod.outlook.com (2603:10a6:208:5a::20) authentication-results: spf=none (sender IP is ) smtp.mailfrom=motih@mellanox.com; x-ms-exchange-messagesentrepresentingtype: 1 x-originating-ip: [37.142.13.130] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; AM0PR05MB5169; 6:85Ocfo5U878eOk8ypsu40bG6F6VsV6k/+1JZfNBfcssvERzTWeCEZyr2G8KuVKDGcxKEfnvmnzPTEcXobeRv4t6L9ZJja9R6gRWR8Xxro5zvyOgqRi3MO2SiH9kZ8HisJoy6+F03o8uAhq4NMjBwMvK+OjzGgOVvqGvezNQ/zr8oKRYM3JuCWBUMa+AjGeP9MsB+iT/wpboIgKKeE0TcRpl4XjxNkZDpomnJknuP+FLgNDcyAxnrn/Ct8HXTbExSPbQRR392qSa2LRNqIexpMEVVlo6P6T27FYtpmb+6PlWS3dFsAEYK6PMCo4NS9RKZ2F/gS2EdiRkfgp1Lbk1xUWgmnrQNRFoy3xbxKYFGwUF0w/Ab80qXK7AUeFFoFVED7KbmoIKktnGvNBVDej1ZHbPs5WCz7DaViiNThboiSzv9v7vFrgzmU/ewpcUDd3SDYL1yuo8Qeb6aDfEZbt31tg==; 5:bJ/sIr6fSUHL0rUqps0uBXCKoMsw4gqtLvF6VBXkSEg3oxP8sRZvHxFbOGAf18Na1kGSx4Pubfgn43ZhXah6urnXi/rfErNJtGkmQzvWgcX/Osk6kyjltRDJzpn+Hz9dn/v/1quPv/XwrGLj0t1dnrC0FKLD94VTN8t7l1s1f4A=; 7:dt/Nc/vuzzbiTIulXaUm4I9/1Ug99BEOYruPM32V5mXkpmTC+XXmL7+ytb/IDqVEhsWJ7fKfLrd9T9l8GzC9UstzTJ/rDQQxR9Lnf3sW2ZdTVxwruS/4kRVAcjUXJ4nPzEHB1CRq7mhzn32Q5060Qw== x-ms-office365-filtering-correlation-id: 29dea76d-7e33-44d3-0ffc-08d66a76aaec x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600074)(711020)(4618075)(2017052603328)(7153060)(7193020); SRVR:AM0PR05MB5169; x-ms-traffictypediagnostic: AM0PR05MB5169: x-microsoft-antispam-prvs: x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(8211001083)(3230021)(908002)(999002)(5005026)(6040522)(2401047)(8121501046)(10201501046)(93006095)(93001095)(3002001)(3231475)(944501520)(52105112)(6055026)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123558120)(20161123560045)(20161123562045)(20161123564045)(201708071742011)(7699051)(76991095); SRVR:AM0PR05MB5169; BCL:0; PCL:0; RULEID:; SRVR:AM0PR05MB5169; x-forefront-prvs: 08978A8F5C x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(136003)(346002)(366004)(376002)(39860400002)(396003)(189003)(199004)(6916009)(2906002)(102836004)(8936002)(8676002)(81166006)(1730700003)(81156014)(11346002)(386003)(36756003)(71200400001)(446003)(6506007)(6436002)(2616005)(476003)(66066001)(106356001)(105586002)(316002)(71190400001)(3846002)(486006)(2351001)(6116002)(6486002)(186003)(2501003)(5660300001)(26005)(99286004)(256004)(14454004)(6512007)(76176011)(5640700003)(107886003)(25786009)(86362001)(4326008)(52116002)(53936002)(305945005)(97736004)(478600001)(68736007)(7736002); DIR:OUT; SFP:1101; SCL:1; SRVR:AM0PR05MB5169; H:AM0PR05MB4435.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-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: qkyomMwYwMd5qUnuNFpPhRfmT757c/GGk7TwaIw8VMgaLpIF3S7waO2wFEqh5cCTntw9CQX51oxZYBO+W8BjGofg7XgPwhoCzDEuc2BFXgyS6IwypNauwNhQ5v9G2DI80d8xTvE9ll+2GdaRl7F/5ma+q8p0pJbTpcCa//cC8QGyLve0CJJ7OpfJxPPeRCQ632n7UAaPykAmKJ2YdqdbhmKD58RGN0R8f4rMLqXolxprC6qnCBo7nPPpEUv4SFQXP2AyPjwLrec/7N2RRcqeV2wVdtqpCyQdOptJONWyp88CjUnUWo4ujklFiBhgnvvY 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: 29dea76d-7e33-44d3-0ffc-08d66a76aaec X-MS-Exchange-CrossTenant-originalarrivaltime: 25 Dec 2018 14:38:43.0473 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR05MB5169 Subject: [dpdk-dev] [PATCH v1 1/3] net/mlx5: modify 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: Tue, 25 Dec 2018 14:38:44 -0000 This commit modifies the logic for searching an allocating a shared counter in mlx5_flow_verbs. modifies commit 84c406e74524 ("net/mlx5: add flow translate function") Signed-off-by: Moti Haimovsky --- 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_flo= w_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) { --=20 1.8.3.1