Received: by 2002:a05:7208:9594:b0:7e:5202:c8b4 with SMTP id gs20csp132361rbb; Fri, 23 Feb 2024 14:42:27 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCWGihHovCyFqlSTk9zffo8ibVHXU4wyRZDvc47xYoeVISs8vwIUALTMqT6TDRpbTCgjEewtQr+xrXnAS447yPC4ZW4JYEekceqOs4UhlA== X-Google-Smtp-Source: AGHT+IGHBo+eIudQMiNea0lz789LdeCQzlRdHFbQ7aPgJ6Qq5EEXjZzZUAJcntYxInqXE5KuiZSX X-Received: by 2002:a17:906:ce5b:b0:a3e:cb18:d4f with SMTP id se27-20020a170906ce5b00b00a3ecb180d4fmr642441ejb.30.1708728147183; Fri, 23 Feb 2024 14:42:27 -0800 (PST) Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id f11-20020a1709062c4b00b00a3f7ca2bdadsi10042ejh.905.2024.02.23.14.42.27 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 23 Feb 2024 14:42:27 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-79277-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@Nvidia.com header.s=selector2 header.b=cBEV+Rt1; arc=fail (signature failed); spf=pass (google.com: domain of linux-kernel+bounces-79277-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-79277-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=nvidia.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id AFE261F22BC8 for ; Fri, 23 Feb 2024 22:42:26 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 2CDAA14DFDA; Fri, 23 Feb 2024 22:42:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=Nvidia.com header.i=@Nvidia.com header.b="cBEV+Rt1" Received: from NAM11-DM6-obe.outbound.protection.outlook.com (mail-dm6nam11on2077.outbound.protection.outlook.com [40.107.223.77]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6745F3D6C; Fri, 23 Feb 2024 22:41:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.223.77 ARC-Seal:i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708728133; cv=fail; b=rmv/PzS2ZMDZavgNLKdJMO/Ml6R0k+seEM7wPdy/QT5NzKbylhhUR/oGPemfy9LiBGS3UmPLLi7ZUZ/cUJw2ZeAq+ldIjUJdcocYxc10mAQtY+87qSYtpHUnEz/TAYc0pCjaggcTYAKeHQTylN77TExpAcVXxO4qYKSvMK/7rGk= ARC-Message-Signature:i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708728133; c=relaxed/simple; bh=gYthuSO+gjabyP0W+NTh+yhcZjesqY4QObU5H3VH4ns=; h=References:From:To:Cc:Subject:Date:In-reply-to:Message-ID: Content-Type:MIME-Version; b=NqJEB3KaFx/lY29qaySr9kvoRaWOhzOKoyFUfdGEU3Tz6dBCS7s1M19dsKJvZGE4TOOA/7SrG05YkCoPA+QorCTm6HEbWPLAkigAKaTyABLF1U1y+MUKTlxjU3e0LV199op+s95fqXo60jPub18UR1eiDKIWWMH20MpxfnM/VPQ= ARC-Authentication-Results:i=2; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=nvidia.com; spf=fail smtp.mailfrom=nvidia.com; dkim=pass (2048-bit key) header.d=Nvidia.com header.i=@Nvidia.com header.b=cBEV+Rt1; arc=fail smtp.client-ip=40.107.223.77 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=nvidia.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=nvidia.com ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=VmD+ymQBNDD+z1s50tplsT528chnZz4OseyB1oBmhL+NLIROWxJU3u6QE/P4n+phOgEVKLwQXiqFMZ24EPgDzBsSi0PVC/vggDVFeHiLmL5knUL3GVHR0oJfOoBdlR21v8MeROO1D9Hikc+unM3pW/VI2DqKW82Cy1lkGSTL1sihpUSbw4MlUHv8EIdd3u5wJGPJqlyALWmgilCQm9rgQFDSompAFUvFbmfwbUgP3JafMo1kBf1JNqnirO4p319yHpLfvt1d1H4ZXm3UmtrL53JZV0GFeR9YrhZny+G9xLS+YlQAhtfPyYgZ8wGsvcH4eMiCvSxanwNmG9TCCQ1F+Q== 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=H/Atow9ZHyedikTQcpANYUjM9E5prjHylIXWIHEGs5A=; b=YaC9R3ybQq5FGB3EVOkpm5bm+8uvMQfwAPaGtYupAvW5Sygh0yTP/gQ6Z0s78eOAjJAHgsrFRuzMW56ORb+lNjAyfq5+g5yVYYWws7RQn+c4/u59sOesuVICRkGiddDOfI3yO9oUEBSQWXkWzSRRSAsaDGGNX6EZO0fkTuwAslP8qVMXd8R3ncNasB3BnKBK4rSLNSxHQOUBeUB8ozo/IG+T35z32YtEdOM/oxRs8sGEmuHbwMCs3upYuySmVhTuEDgqAF7f9ykGKNgBZd3GtlJ6TtCYh1Z9nNAwOHU7VZHCRedD2iGYBhiLm55Y+IsOLJ/HTCZa405sYLxmHyyAPQ== 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=H/Atow9ZHyedikTQcpANYUjM9E5prjHylIXWIHEGs5A=; b=cBEV+Rt134Av+Ds+Vm3JUbpBhyGhDr9sotI5KzMHuFUrPqoNKZoSdCB4vgfkY8ATcU1MxuuV6oIUnZ7dfJc0h35eLyZkI5tPOw8/WO/hLuuVtisj+rv6bV0FRLO2wkoO+Jhz52eBF9KqPfxQ5od4JYjcu9kb1gkK3W3+XIZx5tcYvFB3XcOdBjIlZs/yeNff7NC91u/gvt4udo2PnlRuw+iaP9j4jvEUGyLmW0mpCzaFsvzgXjg5LfeNnSmzsUE3KXSlyPkMzT2Nku+in/+XjPXAuEjFc2yyYvHhWJs6MzlrDtDp9HrHmMOJD/pmIOrZQMb89vUPBWKs3IyStYJKcA== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nvidia.com; Received: from BYAPR12MB2743.namprd12.prod.outlook.com (2603:10b6:a03:61::28) by DM4PR12MB6010.namprd12.prod.outlook.com (2603:10b6:8:6a::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7316.24; Fri, 23 Feb 2024 22:41:49 +0000 Received: from BYAPR12MB2743.namprd12.prod.outlook.com ([fe80::459b:b6fe:a74c:5fbf]) by BYAPR12MB2743.namprd12.prod.outlook.com ([fe80::459b:b6fe:a74c:5fbf%6]) with mapi id 15.20.7316.023; Fri, 23 Feb 2024 22:41:49 +0000 References: <20240223192658.45893-1-rrameshbabu@nvidia.com> <20240223192658.45893-6-rrameshbabu@nvidia.com> <6e0a725f-3bd8-4e14-afda-860f1e4c1dc5@intel.com> User-agent: mu4e 1.10.8; emacs 28.2 From: Rahul Rameshbabu To: Jacob Keller Cc: Saeed Mahameed , Leon Romanovsky , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Jonathan Corbet , Richard Cochran , Tariq Toukan , Gal Pressman , Vadim Fedorenko , Andrew Lunn , Heiner Kallweit , Przemek Kitszel , Ahmed Zaki , Alexander Lobakin , Hangbin Liu , Paul Greenwalt , Justin Stitt , Randy Dunlap , Maxime Chevallier , Kory Maincent , Wojciech Drewek , Vladimir Oltean , Jiri Pirko , Alexandre Torgue , Jose Abreu , Dragos Tatulea , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org Subject: Re: [PATCH RFC net-next v1 5/6] tools: ynl: ethtool.py: Make tool invokable from any CWD Date: Fri, 23 Feb 2024 14:39:07 -0800 In-reply-to: <6e0a725f-3bd8-4e14-afda-860f1e4c1dc5@intel.com> Message-ID: <87y1bavm50.fsf@nvidia.com> Content-Type: text/plain X-ClientProxiedBy: BY3PR05CA0021.namprd05.prod.outlook.com (2603:10b6:a03:254::26) To BYAPR12MB2743.namprd12.prod.outlook.com (2603:10b6:a03:61::28) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BYAPR12MB2743:EE_|DM4PR12MB6010:EE_ X-MS-Office365-Filtering-Correlation-Id: 124c3f4d-259e-4e04-8907-08dc34c09f12 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: lKMESuvTzENIbWRlf5/Au9qT8YtN4A9B2v8usu7Agyu+VFhlwb4hfREMtO2f0l1VMCRTRIgshR7gWmr2oUIWM51OIvncfto6svaZVLpsoDbggwlROWU1CAKLXA1Xp0toX9wF/ocsHJ9bDvn+jqj00dtftPU/JEdnf5P4OWTzOcp4H6wfz/RGpr574t/ivb91uM5900UHuG8pPeCm4uH3oqtz/cVj0RNGqDeUA41Ar2ueO3U5ij5IOZbm01HhRx0RjtD4opjrgTCWRujvhPCKUOJXhQq2RNc8w2WkVfM/2u9ksP35hye3M4bdFEiYJhCNh4RFQPO/0QGxX0e/D7aILSKN99Ih42s8QSuK3y0Hb3wJyMgL4Png2FFYqRGD0Fx1PkFrvMrR+cAGNCn+ps13YvVchYZQ5i2EhXUn1iFOaR1K245dk1iPuDs9B+XZScDLPSfvPBASchQPRzAnOZgp3RaCjHtNmHOqEdpTkHvoPt2yJ7dGodITfayesd0sSmub4t58FRw4wbkSU0wLEKcoHgAAFJv8ZkvgchHASq0N0z4= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BYAPR12MB2743.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?WB9Y+/BFhuYlwblQgGOTZ5xfc+8jFpkqWcv/oQbndYVoEh8CJE8pFd8vmCv/?= =?us-ascii?Q?maFWxpJPR9TupRX7QJjY2uvRkB+tQGhJjftkMc+LiyJzXYRY+oM3XcDKe2cb?= =?us-ascii?Q?DrfGK0b/4MMw0x58UyDkGL8OOa+pCqkluZG8ToTPmHex9FLIRKpwEVMA0rIT?= =?us-ascii?Q?62hTjoz8lyOJFOQkMaMylgZunUP6tKu+OovYufj7z1j+la835hGrZcTXSA57?= =?us-ascii?Q?EJZMSKhkzW88ZuIycImJr23cNrpnQejvugqp2xsPWXJJtQhDRSWtrYO9BIav?= =?us-ascii?Q?4Wlkgd6AmR9NI+XknzO3utR0Mz+1gOdLf0xH+oM7zkNZs4Bgq/cq3m5t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hociBU4DPqj9lbChwp29lxGZT?= =?us-ascii?Q?JeFmCmbcW025kCLUC6bA1IL3Hhy3l/lKmxb+dy8w82ZFp21VjZ5jlRFp6eWE?= =?us-ascii?Q?Et0E8xAa/EtYKZ/aUMGO8nODtwpgz93W/4y+jHMA1pVLWfRZaKuWWqicoJzz?= =?us-ascii?Q?n614cNGihXBBajHKGR458LO3EKjS7/WeVA3bUM4mT0qkF0IueZmohoBHqs/y?= =?us-ascii?Q?AziWuLE9LQX1Vg+ErLqFAO7CbMA/IFW18M2Rlop+U/z5UixotKlRGcnsMCfy?= =?us-ascii?Q?v4uPRUP+GV1q3l+t+2z7JUFluMhT+SyI1N4qkr5A9Z+8XpAWNJunEcr2k7g5?= =?us-ascii?Q?goWPpVwOnjq8tEiqACqMnzRlsnylkLNkunHhmI2Jo+GUfz9KUCz+ZYJ1/nnJ?= =?us-ascii?Q?Jw=3D=3D?= X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-Network-Message-Id: 124c3f4d-259e-4e04-8907-08dc34c09f12 X-MS-Exchange-CrossTenant-AuthSource: BYAPR12MB2743.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Feb 2024 22:41:48.8967 (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: hWcI/UU7JlXx5nhzQT/NQAWssDf7PUPDzWOOBKDPROXCCBZkJbJVn605rmlDcsAx6vwkHIoyu+DU5XATvHmlHg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM4PR12MB6010 On Fri, 23 Feb, 2024 13:08:34 -0800 Jacob Keller wrote: > On 2/23/2024 11:24 AM, Rahul Rameshbabu wrote: >> ethtool.py depends on yml files in a specific location of the linux kernel >> tree. Using relative lookup for those files means that ethtool.py would >> need to be run under tools/net/ynl/. Lookup needed yml files without >> depending on the current working directory that ethtool.py is invoked from. >> >> Signed-off-by: Rahul Rameshbabu >> Reviewed-by: Dragos Tatulea >> --- >> tools/net/ynl/ethtool.py | 8 ++++++-- >> 1 file changed, 6 insertions(+), 2 deletions(-) >> >> diff --git a/tools/net/ynl/ethtool.py b/tools/net/ynl/ethtool.py >> index 6c9f7e31250c..44ba3ba58ed9 100755 >> --- a/tools/net/ynl/ethtool.py >> +++ b/tools/net/ynl/ethtool.py >> @@ -6,6 +6,7 @@ import json >> import pprint >> import sys >> import re >> +import os >> >> from lib import YnlFamily >> >> @@ -152,8 +153,11 @@ def main(): >> global args >> args = parser.parse_args() >> >> - spec = '../../../Documentation/netlink/specs/ethtool.yaml' >> - schema = '../../../Documentation/netlink/genetlink-legacy.yaml' >> + script_abs_dir = os.path.dirname(os.path.abspath(sys.argv[0])) >> + spec = os.path.join(script_abs_dir, >> + '../../../Documentation/netlink/specs/ethtool.yaml') >> + schema = os.path.join(script_abs_dir, >> + '../../../Documentation/netlink/genetlink-legacy.yaml') >> > > This seems like a worthwhile improvement to make the tool more usable. > Unfortunately, even though in the next patch after this one where I add the ts stats group as a comment, the tool seems to fail at rendering the actual counters of the stats group, so I had to use the ethtool tree to test. I should look into that, so that way other contributors such as Intel can simply use this script to test that they hooked into the ethtool ts stats interface correctly. -- Thanks, Rahul Rameshbabu