From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR02-VE1-obe.outbound.protection.outlook.com (mail-eopbgr20046.outbound.protection.outlook.com [40.107.2.46]) by dpdk.org (Postfix) with ESMTP id 9204C2BF7 for ; Thu, 27 Dec 2018 09:12:55 +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=mt6AcdTZkjt0XXDTdrjdTNgnBcsSd1WSnqbSH7FzuRc=; b=RBBrvUhE4RbF6ZwF7jhZaoPyMC+3z/aM8zXbbdAhFtT1GZtxwcFXULwoOLzYhSCS/TNXSaPXQcVqWg3XqkVN0cDmiZTOEBMS43VcFad72iIjvftgRCd22cFCFmddZJ5t3sle0yPJ7LWiKod2Eq8RokuSSG8KaSUcwaLxZD1ziVI= Received: from DB7PR05MB4426.eurprd05.prod.outlook.com (52.134.109.15) by DB7PR05MB5559.eurprd05.prod.outlook.com (20.177.193.140) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1446.25; Thu, 27 Dec 2018 08:12:53 +0000 Received: from DB7PR05MB4426.eurprd05.prod.outlook.com ([fe80::b0a0:72a4:7547:1c3c]) by DB7PR05MB4426.eurprd05.prod.outlook.com ([fe80::b0a0:72a4:7547:1c3c%4]) with mapi id 15.20.1471.019; Thu, 27 Dec 2018 08:12:53 +0000 From: Shahaf Shuler To: Mordechay Haimovsky , "dev@dpdk.org" CC: Mordechay Haimovsky Thread-Topic: [dpdk-dev] [PATCH v1 1/3] net/mlx5: modify shared counter allocation logic Thread-Index: AQHUnF+RZlhbt+tO2UyhNJ+50DJKOaWSOL6A Date: Thu, 27 Dec 2018 08:12:53 +0000 Message-ID: References: <1545748697-3385-1-git-send-email-motih@mellanox.com> <1545748697-3385-2-git-send-email-motih@mellanox.com> In-Reply-To: <1545748697-3385-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=shahafs@mellanox.com; x-originating-ip: [31.154.10.105] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; DB7PR05MB5559; 6:mInQNuhCfr7brpiL16aQxSzPM7ihSX5Tp2YFfpbd9ni2Uw0H6kQQF2xdG8XcZaSXX+ERIyY4j+YGbQwxrqB/bOOmzV0sYdDX4AVL9dsnbecUpZrZHQN68z0Zpc08ORam5+As6KVsnKdWPwsv8TnK3kmExQpm1Y/CHjkI82YwROvdgsFGg9/Tee+NydfbOjExqGbRSpBet4t9KyhYBlBOcz4TXmM1mpLD4F5a+gFlx2HpwnKVRzcw7pEMakIZHRhCmP9qEZe8o9xfG+Iaslh9KsVeOEgZ6cOISabvhyc/XGh1FN5UoETbY6OGDvWxMrfQkRQMPxJICoPpOUOC8g/kQMT4swa+x0DjtIv47RtpzRSEhWTJnK7i3EbRoSl7zocy7nNU91XnezF51FBTje2loQawRTlAigEVo3DZbIaCGsHFiY5CQq65RYvnYzFBn5yUXRgBXi6sE6uZxL/AySVhAA==; 5:t0kKwDnP9U8WBKGbr74vO37vUc9k8izmdJTX9RlJ/GnbT0c1LVmKPvM7agLbq/RwOEWO6FGtsLYZVBF/b1Q7x8FHdrRjhu9aVuoaGtXGx+2iykl4EIHyPRmKB6NDCXrlnY+AeRA/f7pJO9d78qsKaGE7r93GyvusN86Ce4KqujE=; 7:TY+Zm8qP9x9UvbMdYcjl36ZDiTJnf2+uJtgSlOzHRl59paZzqvexVhTuIQdVknVDhZ+BIzAEIMMZc43saGpHuW7uxvO2Atnma5YI/1ss8UDE7zoFY2KdIyB+bR7sskjJ+zHstnTWGZ/fdbqFiAaQhQ== x-ms-exchange-antispam-srfa-diagnostics: SOS; x-ms-office365-filtering-correlation-id: f2f558b9-1a50-4889-8a29-08d66bd319fd 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:DB7PR05MB5559; x-ms-traffictypediagnostic: DB7PR05MB5559: x-microsoft-antispam-prvs: x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(8211001083)(3230021)(908002)(999002)(5005026)(6040522)(2401047)(8121501046)(3231475)(944501520)(52105112)(10201501046)(93006095)(93001095)(3002001)(6055026)(6041310)(20161123564045)(20161123560045)(20161123558120)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123562045)(201708071742011)(7699051)(76991095); SRVR:DB7PR05MB5559; BCL:0; PCL:0; RULEID:; SRVR:DB7PR05MB5559; x-forefront-prvs: 0899B47777 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(366004)(396003)(136003)(376002)(346002)(39860400002)(199004)(189003)(74316002)(4326008)(106356001)(55016002)(68736007)(66066001)(486006)(105586002)(2906002)(7696005)(71190400001)(229853002)(71200400001)(6506007)(6436002)(256004)(2501003)(25786009)(76176011)(97736004)(33656002)(81166006)(102836004)(446003)(26005)(316002)(107886003)(86362001)(8936002)(6116002)(3846002)(476003)(7736002)(186003)(110136005)(6246003)(99286004)(5660300001)(305945005)(81156014)(53936002)(478600001)(11346002)(9686003)(14454004); DIR:OUT; SFP:1101; SCL:1; SRVR:DB7PR05MB5559; H:DB7PR05MB4426.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: 0vrueYXjB/xoq9uMv/EN47eIH2aMPcVcvNkWwlE1M+nL3pQJ3AzulgKobTCiplNmdesXYlKYDXNRN998Y1jvXg/X1JooSIekT/WweQ5NCfPCeVY5fJj2hgS2cz2+rCbVg5GralASCzW9rG4/h3wrq5TX5sbPF97vGdbiqkAzUcN+nNMrSZcfpHwIkZEifZBT29Udk9ONG8MSRfnjCFXpbnIiu8plggKvjtTge3MHYdGOzzTQKKuzwRY+8nZgm+TQQrDvLrWMkPgPugggzJ0ELgnr3Je2CZTKmd4OGjMZeazlLG1tp6LeWFhTCZ8RzMiL 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: f2f558b9-1a50-4889-8a29-08d66bd319fd X-MS-Exchange-CrossTenant-originalarrivaltime: 27 Dec 2018 08:12:53.6340 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB7PR05MB5559 Subject: Re: [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: Thu, 27 Dec 2018 08:12:55 -0000 Tuesday, December 25, 2018 4:39 PM, Mordechay Haimovsky: > Subject: [dpdk-dev] [PATCH v1 1/3] net/mlx5: modify shared counter alloca= tion > logic >=20 > This commit modifies the logic for searching an allocating a shared count= er in > mlx5_flow_verbs. Need to explain - why you change it? I assume it is because only shared counters need to be search on the PMD da= tabase, correct? >=20 > modifies commit 84c406e74524 ("net/mlx5: add flow translate function") If above correct, better to introduce it as fix commit w/ Cc: stable@dpdk.o= rg >=20 > Signed-off-by: Moti Haimovsky > --- > 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