From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 0567EA0510; Sun, 8 May 2022 16:21:31 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id A90BD4068F; Sun, 8 May 2022 16:21:30 +0200 (CEST) Received: from NAM11-CO1-obe.outbound.protection.outlook.com (mail-co1nam11on2048.outbound.protection.outlook.com [40.107.220.48]) by mails.dpdk.org (Postfix) with ESMTP id 9B28940395 for ; Sun, 8 May 2022 16:21:29 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ZNDXS6/yvoHTMQ9qv1SKA5YlbZmuVyW55ETYI+WywGFXHh9Eo0gE21KxNsplkE/pZR/mZncLy+GVwtjnuGVgiAdFsQcv4QFjIOdG8NWuYnmQ3YQJzHYq4f7b0N6fsAMcX2gRZtNNPDJBWntqX1Wpr9WwMqnqDvXJ1a+WgOSO2kvygj4fcuf1av6JtvT5DECo8nyE+jKwdoZ1ECz7lniK6c5Q0ZtX2NMA1vCKAkAle+ASokJwh+08KX2HZwBM9/LUtjq1EhfFuONAeIF/mNz/MMnRJ4K5khG9GI9E5v5Mpns51uj8amd343T//X3u34XVo9JRD/l5CmTJawKR7gBIzg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=4+i3/8cjhG4nwhuVI4AzBSWABuNjVgddem+kSWSrxUI=; b=RqobJ170lNeuOb56/agfWWZCLxvDO87wjPL3gfNzEkgbR6vVHP61JyI5ysuMHxmcFk4baZD4T2wzLEaufGVXeOVxzcPt2+uxyO0wYHiIEdTIb/auMQbTfNNV9fum9DhsgX4WnTdh/6ptUm1OsX6sJfQCi+pU2fG7foqj1scSpMktyj22oxppfLdh6K7kVjTf9kXYapGg/Ou5Sj4oO3kPNH+KowC0hlHDdSfI49VQmhAUtC0F4L1zGvPvsaqd1sP3hI/+HiFTuobybLZO5nPY/SEVfe/EXufNU8OrLORUr8Mx4eClDccrY/Zh+qg0d4pqTdics+AcQpTDBo1MjnWLFA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nvidia.com; dmarc=pass action=none header.from=nvidia.com; dkim=pass header.d=nvidia.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=4+i3/8cjhG4nwhuVI4AzBSWABuNjVgddem+kSWSrxUI=; b=pByRcEL1bkaQnOkWZcDcz1skGynW3S/rSMfAZnPrqVabZUL/0TtLdiWZ48GPiuQyalgF0th+scbvWflTqgV3m3UNBweQD5JhBipGsuYXXbfUWZvw+TOrxRGi/vNaKuom9iqTKnxmb/xn4EDdm71kcrmo2PiOFnoGAVZXWsm8/KCh75TsRfzza+6Kq46gqZOYpGAZVhripvNwrnpHyAdb8SlWs1ZRFnxOt4MBMRKbeAE4S03GUKADX5+A8zo7x+B94xlcDoGzjq76IsNXHA3Hz3pZxXE403cskSGg7vspPhNta1fFLqds/JxmhBYntPLLmxnVscTLaTFccSKvMa2HRw== Received: from BL1PR12MB5362.namprd12.prod.outlook.com (2603:10b6:208:31d::18) by DM6PR12MB4973.namprd12.prod.outlook.com (2603:10b6:5:1b7::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5227.20; Sun, 8 May 2022 14:21:27 +0000 Received: from BL1PR12MB5362.namprd12.prod.outlook.com ([fe80::7dad:c7d4:e68f:9376]) by BL1PR12MB5362.namprd12.prod.outlook.com ([fe80::7dad:c7d4:e68f:9376%8]) with mapi id 15.20.5227.023; Sun, 8 May 2022 14:21:27 +0000 From: Bassam Zaid AlKilani To: =?iso-8859-1?Q?Geoffrey_Le_Gourri=E9rec?= , "dev@dpdk.org" CC: Didier Pallard , Matan Azrad , Slava Ovsiienko Subject: RE: [PATCH] net/mlx5: fix linux stats gathering function Thread-Topic: [PATCH] net/mlx5: fix linux stats gathering function Thread-Index: AQHYPc7nJqS3p0wSfkO3g3tZlfDmO60VUX/Q Date: Sun, 8 May 2022 14:21:26 +0000 Message-ID: References: <20220317132348.30240-1-geoffrey.le_gourrierec@6wind.com> In-Reply-To: <20220317132348.30240-1-geoffrey.le_gourrierec@6wind.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nvidia.com; x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 2db2b761-f43a-4572-bb59-08da30fe09c2 x-ms-traffictypediagnostic: DM6PR12MB4973:EE_ x-microsoft-antispam-prvs: x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: /C5PalJ76OQbFgNCsIU4Ip76r0Xkj7qArK0YRK6I7A8ZN5yGlvBRA4qLqWa5bL/78y5SiWXwcU3fNERKfk016kO7gALK3sOENSp4mwNS6kNm/VFLcpfL+RvJh5qHJtyMsUaYfKmHjQ3rL+7mx2BkghFWda0u2eAfg6anb2fQd75x6isfX2JZHGpHYx6Tx+S2QJmJARpbLzk8iikrQSEyCxoeUrl9s/JdzUQ3a8WpArB4jB3ONwbd1OeMnrCnqfLEH3zcV+3P/CX0I9rhSvXlEyE/G6XB+QKZp36V5XyqwLkpybkqVhY7GAqhijdVgU7tY4ArdUq/Rb6o5s+dNgaueyc2hklWQNQWz+Q3SNjXWkiJvm5gBxCoYbsIpILjcfta81Fl/wzcU4Sswx33Of690mNu4W3ezAxzgj2ezhSdlI0aLNEXz+DY3TmMB+quzTRDGXEy7GBIOKz+mOElkd3MZOZdK2Imfz7OyhMhcLYp1B6W6SE37ja5rKMj4QAWO/h9lmFViDtKdpP76gPoScsOvkgKuCal6Y7JAwpF5V4tj2zx4kyo9yeuSTSKglgtCKmPunOABIwNwPg9aPN1byretv6OspcgitQ/u/dHTxGSUMoMA6P26CzL1i9EPh/dSc7JGn5ckD6l8mdm3YBc7eHsq44bVf0E7hZGxpPhONpsGMPbLlAJIsibFlCq2b9AiwYGP301jcdyA8bl28fZQ+sOjAEEIFL98kcLMWOzKBe33sY= x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:BL1PR12MB5362.namprd12.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230001)(4636009)(366004)(122000001)(2906002)(8936002)(5660300002)(83380400001)(110136005)(38100700002)(38070700005)(54906003)(4326008)(508600001)(76116006)(66446008)(966005)(71200400001)(107886003)(66556008)(66946007)(316002)(8676002)(186003)(66476007)(64756008)(52536014)(66574015)(7696005)(26005)(6506007)(53546011)(55016003)(9686003)(33656002)(86362001)(10090945011); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?iso-8859-1?Q?NMPVX7Z8x3KvP7LGgW7fTdO3omrSthWq7l8HFlSoclKSKGTBiwc1HSdaRr?= =?iso-8859-1?Q?jYfbYrZB4IycSzDZ4F7OAg+OGocinysi2wRiY1j7lHSJ/XR2bWPuVDD5w+?= =?iso-8859-1?Q?xLL+M/Qt6+0ROzR5aZlyPzSJgrBbyGv23N9HqGdbDA6gRpZTTy+/BnXLrf?= =?iso-8859-1?Q?PO5ZbBEWo/slo6z3Jacamy0xqYmMTxLaSizzMuL2qH+ifLpfmc1RDLWmeM?= =?iso-8859-1?Q?6AjwKR/RhL2QQW9QgRa69gGL57aqBT7NEJaOy2BO688UQV0Q3i89d5wIg8?= =?iso-8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oad5yXpjbRxZ6b6q2V3urFSNrzoMf2EkXLS?= =?iso-8859-1?Q?DaQVffKBlw/qbP5uXDE/IxH0kvrM6qZ6iiLLLwPSLM1eWqfYrwaFlwN4nt?= =?iso-8859-1?Q?7mF5cjaRyd8lF0jiePq/1pQeS8BhG7iIlxWQ8e8UXaHwqIO2t9Z+W/0uqE?= =?iso-8859-1?Q?43v8mtMOKZzReMpjyY28VY9gBeJR3CngbG/p/9bgJdnIlVXk0/Zdt+Mvyj?= =?iso-8859-1?Q?YEp57kB7fQ2DAZJo+akt1rZ/8ur68scSBo2NC9Gkyu16qJ6Icc0fqMGoaz?= =?iso-8859-1?Q?qWIQUhs/OvcKDV0pJwp189zk79T8eyjLMzu2yijjKvOlXxtKM+3sx/MM54?= =?iso-8859-1?Q?Xxdn2y+LXKPoQCiG0a+QxoODPmjHkqyifcKb0ZbNYWY8ELeJh2ddGay1+o?= =?iso-8859-1?Q?k9nxVhQkM1poliIQQZAvdbzbZKxiafu/UVtihjaNMdNPEoqUis7WHRtzoG?= =?iso-8859-1?Q?PSdqknOjW/2tYGa89dFqcbILIxuL9Q4P6WFTjeoQnoI+eW8iEpQQlEN6MD?= =?iso-8859-1?Q?oewu4BIIkBIrJuNhF7jSwqLPjIekuw3b4fAMN912g+d6hdSEIWKfFaRnf/?= =?iso-8859-1?Q?p8rAuFTTzgCZvXGKkvkqicO+ipPYrzJvQgGb1xyTOwHEbB9QLiw/qQnoXH?= =?iso-8859-1?Q?KKoqcDdFig=3D=3D?= Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: BL1PR12MB5362.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 2db2b761-f43a-4572-bb59-08da30fe09c2 X-MS-Exchange-CrossTenant-originalarrivaltime: 08 May 2022 14:21:26.9773 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: emlsopKu0TloPAdF8QkObX+BTd9naZcJfdulfjsnhbJ3kp4GId752UlVSGlFzz01aGxTiyt5sk6AH1p9KTFzug== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR12MB4973 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org > -----Original Message----- > From: Geoffrey Le Gourri=E9rec > Sent: Thursday, March 17, 2022 15:24 > To: dev@dpdk.org > Cc: Didier Pallard ; Matan Azrad > ; Slava Ovsiienko > Subject: [PATCH] net/mlx5: fix linux stats gathering function >=20 > [Some people who received this message don't often get email from > geoffrey.le_gourrierec@6wind.com. Learn why this is important at > http://aka.ms/LearnAboutSenderIdentification.] >=20 > External email: Use caution opening links or attachments >=20 >=20 > This patch encompasses a few fixes carried by a previous patch that aimed > to support bonding device stats counting. >=20 > - If mlx5_os_read_dev_stat fails, it returns 1 instead of a > negative value, causing mlx5_xstats_get to return an invalid > number of counters. Since this error is not blocking, do not > mess ret value with mlx5_os_read_dev_stat returned value. >=20 > This allows avoiding the very annoying log: > "n_xstats !=3D n_xstats_names =3D> skipping" >=20 > - Invert the check for mlx5_os_read_dev_stat(), currently leading > us to store the result if the function failed, and use a > backup value if it succeeded, which is the opposite of what we > actually want. Revert to the original (correct) test. >=20 > - Add missing test on _mlx5_os_read_dev_counters() to prevent > using trash stats values. >=20 > Fixes: 7ed15acdcd69 ("net/mlx5: improve xstats of bonding port") > Signed-off-by: Didier Pallard > Signed-off-by: Geoffrey Le Gourri=E9rec > --- > drivers/net/mlx5/linux/mlx5_ethdev_os.c | 7 ++++--- > 1 file changed, 4 insertions(+), 3 deletions(-) >=20 > diff --git a/drivers/net/mlx5/linux/mlx5_ethdev_os.c > b/drivers/net/mlx5/linux/mlx5_ethdev_os.c > index 8fe73f1adb58..b5819cc656ff 100644 > --- a/drivers/net/mlx5/linux/mlx5_ethdev_os.c > +++ b/drivers/net/mlx5/linux/mlx5_ethdev_os.c > @@ -1386,15 +1386,16 @@ mlx5_os_read_dev_counters(struct > rte_eth_dev *dev, uint64_t *stats) > } > } else { > ret =3D _mlx5_os_read_dev_counters(dev, -1, stats); > + if (ret) > + return ret; > } > /* Read IB counters. */ > for (i =3D 0; i !=3D xstats_ctrl->mlx5_stats_n; ++i) { > if (!xstats_ctrl->info[i].dev) > continue; > - ret =3D mlx5_os_read_dev_stat(priv, xstats_ctrl->info[i].= ctr_name, > - &stats[i]); > /* return last xstats counter if fail to read. */ > - if (ret !=3D 0) > + if (mlx5_os_read_dev_stat(priv, xstats_ctrl->info[i].ctr_= name, > + &stats[i]) =3D=3D 0) > xstats_ctrl->xstats[i] =3D stats[i]; > else > stats[i] =3D xstats_ctrl->xstats[i]; > -- > 2.30.2 Tested-by: Bassam Zaid AlKilani Best, Bassam