From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id E682CA0540; Mon, 20 Jul 2020 09:20:26 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 9ABEF1BEDE; Mon, 20 Jul 2020 09:20:25 +0200 (CEST) Received: from EUR04-HE1-obe.outbound.protection.outlook.com (mail-eopbgr70083.outbound.protection.outlook.com [40.107.7.83]) by dpdk.org (Postfix) with ESMTP id 6C9132BF3; Mon, 20 Jul 2020 09:20:24 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=NrkFfboNzO8xYQfgU3nX23C0ksW/W66RUDGEkuOFWycg4LuK6nEj+bIZCmkJAi8L/iMhaYpBDJGuLlSV7uP4OfiTla2UFl1nCs1ujQW6O1JPcbXxe4j/yG1I1e+F7tK19uCY0WyAKYeHlT1tZYUv5ggZVKrD2t90qLoTLN14hlyOvweo/SefvmyTJ4hmteVTU9oG3UfHusoaBA0m7zuBwIUmaqiUtvxs3qLxW5xIRYe88UkQeVHRKwNomYQyUJOKLVTqpYLPz9+/JdF/6FsluHRi9Kn89BRe3d7XQcJGCIGQ1z6CogOGL9RhnlSUlZc/aTW7j4hvxId4efU9ARFBRw== 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-SenderADCheck; bh=yQYzXbwkFpx0Bgv0GYDDh1sdFkr+OLuycJTySsW1ijM=; b=gEGbjzr1dCELBX3VYScaz+G2YSX/Of0mHDv7opQJG9IAdBpoRIABOa16sGWdLk4cLntI68HIgGdcd7QISrvclQTyViJd9pyq2SREB/K7dXAQ6sVvlkfqr4enB43kt05ziBnUa+FdOLfL1+lcTHWjq8YAoAWsVNDViZRCHXRf4sGV6XNi6zY4SwzFoHjQnKlNpsis+/kSM1YfVVKvhyt1wv2+FMxEH7qnxup03kpBSdrwMZZUsfVqnzaO0mTKYUj8cUG4aO48u99hD3ZvOpf7UPD75F6/M8VWOJQzhnSs6Po4eqEkcjltSMHP/aaUBQUYP1UaotSlpf/6XAqhWxzOgw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=mellanox.com; dmarc=pass action=none header.from=mellanox.com; dkim=pass header.d=mellanox.com; arc=none 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=yQYzXbwkFpx0Bgv0GYDDh1sdFkr+OLuycJTySsW1ijM=; b=Als2H06VhCgYZqZJ2yV5qNwUZtkGZw6E5s3lpierDYR4EIXyZzPRBEz1I6izbEw5eIy4mTQ6pJQ0nsilxPtpKzW7bpdPMUIWUaz/LIUCDWkPh8pOvAi0qDpP8kScWhwPrMgczOpFhEeO/lnDYtq/cfHZ8YoYFajZeEQDeEFaXA8= Received: from AM0PR05MB6707.eurprd05.prod.outlook.com (2603:10a6:20b:15b::17) by AM4PR05MB3459.eurprd05.prod.outlook.com (2603:10a6:205:8::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3195.23; Mon, 20 Jul 2020 07:20:21 +0000 Received: from AM0PR05MB6707.eurprd05.prod.outlook.com ([fe80::ecd3:6008:3784:4012]) by AM0PR05MB6707.eurprd05.prod.outlook.com ([fe80::ecd3:6008:3784:4012%5]) with mapi id 15.20.3195.025; Mon, 20 Jul 2020 07:20:21 +0000 From: Raslan Darawsheh To: Shy Shyman , "dev@dpdk.org" CC: Slava Ovsiienko , "stable@dpdk.org" Thread-Topic: [dpdk-dev] [PATCH] net/mlx5: fix file path location of HW counters Thread-Index: AQHWWpXY8CvigwdkD0iCfq2HWC2lWqkQFzJQ Date: Mon, 20 Jul 2020 07:20:21 +0000 Message-ID: References: <20200715105055.80089-1-shys@mellanox.com> In-Reply-To: <20200715105055.80089-1-shys@mellanox.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: mellanox.com; dkim=none (message not signed) header.d=none;mellanox.com; dmarc=none action=none header.from=mellanox.com; x-originating-ip: [84.242.49.134] x-ms-publictraffictype: Email x-ms-office365-filtering-ht: Tenant x-ms-office365-filtering-correlation-id: 921fe097-b731-4877-ed4b-08d82c7d5d00 x-ms-traffictypediagnostic: AM4PR05MB3459: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:3968; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: e4H7JUkJ/sQh+w3jQjTOAGKtSJ/NVpF/RlFcY0uRqCaiveGMSzQGnAIbWqDu7Cw4GtSFFo2VP/K/Zlf1qtTLggHkIrMeJdzu+eiLmqpGTrwjjZ6kZob8vKoFFf1886CjtFPzPQNHUC8n7gEJ8cy4WT8KE67mFqxzyd4g0yF2hn8mZo8m4z3foXrW6edjrNRFVktdSfcggegL9VGeAC/G1H/mF9YiGyg16/tQueYj30TFpUS4PzjtXmouYu9nd5xLW3EhFEMfCaxfbX/Qrn4l2K8gdEATFEcd+S4lWvRckG+KtVtxxwYiICbyn0dZSmP2tB+qdKjP2Lw2sCrKpCLesw== x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:AM0PR05MB6707.eurprd05.prod.outlook.com; PTR:; CAT:NONE; SFTY:; SFS:(4636009)(366004)(376002)(39860400002)(396003)(136003)(346002)(6506007)(53546011)(83380400001)(86362001)(71200400001)(110136005)(26005)(478600001)(9686003)(7696005)(54906003)(8676002)(55016002)(316002)(66476007)(76116006)(2906002)(4326008)(186003)(52536014)(64756008)(5660300002)(33656002)(66446008)(66556008)(8936002)(66946007)(450100002); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata: PQTCC6eaDoEf+VGYYmBeQF4iOd0iZuu0M7z20QHgIv2qYG4vwKod3MICXvMl+qy+voEinT8IvO4tKPZ5omtRn+eAgXNnRYsVh6g1a/ngLQYvsMBVcVyv+/7TCsTWQ6c4livHpjSjDzTGrbE6/h0jyLTm2fpS9ay9GrfY86Lgull+n5h2gwHI2GSv5VAjzKBe/q4Q2Jljz9IIGKO0gbPh5WQVE5+duGIpSJimfpOLlMb6XunTvD2k7hoWqY7runMgleRDTZe9KxdaY38oqh1m0aMxsOk0e12+qdJ8w99B9qRd31dnvmnf6aKAhEeD9UWrXGMp7SsSnzrbSnrn4Y8MsYFHThY3uZ1JWchoBTZ/mW6Swb7kCGPZzEsfj8Mj8wN/0XHQrulPoRS6RSg8jcSaMsIbjs7wP0l6O2hu5sMB1ZpOIvUeNyG0KJ+7jtBYqYMLnp7+SwTOvbe07YjWW1XZgepkepXqmJjlXzkWndoOnB0zZ4y50AiDBZevF8bPclxk Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: AM0PR05MB6707.eurprd05.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 921fe097-b731-4877-ed4b-08d82c7d5d00 X-MS-Exchange-CrossTenant-originalarrivaltime: 20 Jul 2020 07:20:21.4228 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: +cn38DKah+cLM7L+UJObbBgZUqmAK1OdSlMc47ij4lwC4o5KgGNAZ0b5t8GuiY4GGUKbMQDSsaf4Aex6HkI4aA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM4PR05MB3459 Subject: Re: [dpdk-dev] [PATCH] net/mlx5: fix file path location of HW counters 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: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Hi, > -----Original Message----- > From: dev On Behalf Of Shy Shyman > Sent: Wednesday, July 15, 2020 1:51 PM > To: dev@dpdk.org > Cc: Slava Ovsiienko ; stable@dpdk.org > Subject: [dpdk-dev] [PATCH] net/mlx5: fix file path location of HW counte= rs >=20 > When debugging performance of a DPDK application the user may > need to view the different statistics of DPDK(for example out_of_buffer) > This can be enabled by using testpmd command 'show port xstats > ' for example. >=20 > The current implementation assumes legacy mode in which the > counters > are at //hw_counters/. > In switchdev mode the counters file is located right after the device > name, hence resides at /hw_counters. >=20 > The fix tries to open the path in the second location after a failure > to open the file from the first location. >=20 > Fixes: 9c0a9eed37f1 ("net/mlx5: switch to the names in the shared IB > context") >=20 > Cc: stable@dpdk.org > Cc: viacheslavo@mellanox.com >=20 > Signed-off-by: Shy Shyman > --- > drivers/net/mlx5/linux/mlx5_os.c | 16 +++++++++++++--- > 1 file changed, 13 insertions(+), 3 deletions(-) >=20 > diff --git a/drivers/net/mlx5/linux/mlx5_os.c > b/drivers/net/mlx5/linux/mlx5_os.c > index 2dc57b20ef..0edc96299c 100644 > --- a/drivers/net/mlx5/linux/mlx5_os.c > +++ b/drivers/net/mlx5/linux/mlx5_os.c > @@ -1948,10 +1948,20 @@ mlx5_os_read_dev_stat(struct mlx5_priv *priv, > const char *ctr_name, >=20 > if (priv->sh) { > MKSTR(path, "%s/ports/%d/hw_counters/%s", > - priv->sh->ibdev_path, > - priv->dev_port, > - ctr_name); > + priv->sh->ibdev_path, > + priv->dev_port, > + ctr_name); > fd =3D open(path, O_RDONLY); > + /* > + * in switchdev the file location is not per port > + * but rather in /hw_counters/. > + */ > + if (fd =3D=3D -1) { > + MKSTR(path1, "%s/hw_counters/%s", > + priv->sh->ibdev_path, > + ctr_name); > + fd =3D open(path1, O_RDONLY); > + } > if (fd !=3D -1) { > char buf[21] =3D {'\0'}; > ssize_t n =3D read(fd, buf, sizeof(buf)); > -- > 2.21.0 Patch applied to next-net-mlx, Kindest regards, Raslan Darawsheh