Received: by 2002:a05:7208:9594:b0:7e:5202:c8b4 with SMTP id gs20csp54333rbb; Fri, 23 Feb 2024 11:28:57 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCWsQFL3VTqVO67VckmnLxn2mCLXlgQgC4z+E90UXXpkg4+f0WCB+NwL+9UeLcMtaQAwPzQ+z7hVB0X2K+Vp2/J7aVwNDfqsKiy60G+j7g== X-Google-Smtp-Source: AGHT+IGYCjAXhd9zlogF8aukm6SDbweDx7H7LZbqrdDhSUCQFYx40PI1/0rG0I85GevoHpoSo5gi X-Received: by 2002:a05:6402:643:b0:563:bd95:4ef8 with SMTP id u3-20020a056402064300b00563bd954ef8mr515187edx.23.1708716537227; Fri, 23 Feb 2024 11:28:57 -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 n23-20020a056402061700b00564f3d36aecsi2704516edv.48.2024.02.23.11.28.57 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 23 Feb 2024 11:28:57 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-79027-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=jnOuPH3u; arc=fail (signature failed); spf=pass (google.com: domain of linux-kernel+bounces-79027-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-79027-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 C9EBE1F24DFF for ; Fri, 23 Feb 2024 19:28:56 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id DC91214533D; Fri, 23 Feb 2024 19:28:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=Nvidia.com header.i=@Nvidia.com header.b="jnOuPH3u" Received: from NAM10-BN7-obe.outbound.protection.outlook.com (mail-bn7nam10on2080.outbound.protection.outlook.com [40.107.92.80]) (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 4F36014533C; Fri, 23 Feb 2024 19:27:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.92.80 ARC-Seal:i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708716473; cv=fail; b=KiOfDhM0D5a/XmI68rRd/2YIzHHc9Mw2kxjn3wN5UjcwY0oH72HTxQ/ndAos2piR+ZEWadP42Dz3rf4UtEJHd6z3xa1Nurytnh4hp1pQJz1ZNxqmDL+oVdNaVQvjBLWiUliTxa8nIBbVAAyOXgmqvgo1TY5Rv8iiLvsetlIrw1Y= ARC-Message-Signature:i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708716473; c=relaxed/simple; bh=CNAzUr4GyhhisfblkF/c2qTSaiAj6DN7DqMBTN+YdJ0=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: Content-Type:MIME-Version; b=lmhvP1bh3uWTrE2tFvBS/+A6mIJGDsK78dAnxbYVIa0KNJKndbIC59u0j2tkL86v2NBwjsxwuESHkiLQGTJgok2j1IZxflW5o7sZ5ikoqhfo1aN6tN/bad0FuMVVRQszoSCREzuiiNoW4iEOBqfMaP1kMLZK+Us3c02qSF6D6+Y= 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=jnOuPH3u; arc=fail smtp.client-ip=40.107.92.80 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=N/P/xtqDxQSNEEOJ4+kzbifOoBKTx1CCZyL0FXVLZcELtAKhVYKbjrsyI/f7F54qLmSTEwDhy6TZh2hA9O/WMatIi3v+/RZaVhSMY9Ffw6VFEg4K70O3xI93njGlmA8zd8oexeSzK37oZW4dJUCimqVcuqOFUUkl158KDHA/+3RbuGgmdcaLiFiUNmPRCXPEPIaPtv+JzKRPXS8WzK6rdEf7FaSEAUB1dDwoThpDjtv9rWGeO2k8rHRaJF9B1Ntgvndssq4dncNY4fq5cWLtZByALzuW3HgvRQRXgBM0lo1A8qDE59J57iLhpQwxLDkfycQRpWZADBzuV0b+Fr761Q== 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=yXZtvN1TXjwbqsyoBsYP95PkqT7reIHbTJbL59LhaDE=; b=ibxz5FiN3B/X16df6rxR0ScUX/kSRx1pVfPsdHbPCZb6N/VwRp/GRU1DS1eNyFF9nr7FUp/seE84SwfJUwpkifuUefuAuBjU9agWW4nPMLonerg/zBYZ7YeVAH0DUuceg1N2FzWllerwAbyAR/9eZh84VhHcR5tAf5Y7U5wAeaUxLA+ugLJryoCxFc0e1Ea4f8sxairO/NHFEpEtPzcyCHTDONpC9YgaHge9gt+6x+spUhirw1hGidibPCE0aSaSPQr5GYodGGRMLrbcgvXM3CJrzejPAcbBAWfntADHXRHvyNT650QfWZnAezPmGQgpvPWzbTfU2Mqy3jefgT8+5A== 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=yXZtvN1TXjwbqsyoBsYP95PkqT7reIHbTJbL59LhaDE=; b=jnOuPH3ujxaxMxCPoPu3ezNHNCvDa8ljPBW5PtKM+zyQCMk9unacFmdSSCdPLFLXczv6JFJMO1kJyuuKdVBBZvebzI6bBWa+NMoHzUVsqkuhK+N5WMk5X/n9blEYPTfNtUCT2SkBYOsUS2HzBBEW2ecXCJW+Ij42/F5cB7TqNbaYo4wCI+EaJ+lXkuYKcti/M237s8KexrLaLJ+kklm6KKbw/T4wGZORRdK8bZFMhpfoB93XCWmjnAK+J3rAMf/WXoJXIsgS9duQsx8mbsVprznlZHnylk96QTqmWJyZRQ1QxRqUZiHJfhznTMkQ3LKcpI7Bam0X0aeEetmVV2XYEQ== 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 SJ0PR12MB6831.namprd12.prod.outlook.com (2603:10b6:a03:47d::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7316.20; Fri, 23 Feb 2024 19:27:23 +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 19:27:23 +0000 From: Rahul Rameshbabu To: 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 , Jacob Keller , Alexandre Torgue , Jose Abreu , Dragos Tatulea Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org, Rahul Rameshbabu Subject: [PATCH RFC net-next v1 5/6] tools: ynl: ethtool.py: Make tool invokable from any CWD Date: Fri, 23 Feb 2024 11:24:49 -0800 Message-ID: <20240223192658.45893-6-rrameshbabu@nvidia.com> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20240223192658.45893-1-rrameshbabu@nvidia.com> References: <20240223192658.45893-1-rrameshbabu@nvidia.com> Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: SJ0PR13CA0050.namprd13.prod.outlook.com (2603:10b6:a03:2c2::25) 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_|SJ0PR12MB6831:EE_ X-MS-Office365-Filtering-Correlation-Id: c4945d52-3b49-48fa-3a85-08dc34a575aa X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: vLLYZBJCaf0Hz5LXtJPQNNER5lNS3x5XvG8k2nDbgik85POITuDOT08MkfQAXlo5ctBOTlVSWNX6oop6ekpoEsbFaDfXZub8r2RFTiStP76td+uGP/+hwtSfv6gF7vnZiU6gKw+OHFyudRNRs7JrMRVnZw7OQ0P0QgEvfd9wmwuUXhw3WhrQtfK90jWGvujxlqGH3Af3sRiO9lptCjrHqddO3F2bfToKTGJtY1EdE2RR4fZD/HUUKeXmiHtFBUyJ+BuAsbEmH3MTvwVDGbka3xIAeOwWnFDNg9Khqgu0hlBZd+VdTfQ+nhIL/Fqgyp7EA7drFkKSN2TvTp4mPa1rCGMER5tjx3plJ4R4trGbTiOTzWOk5cI+JjH/vgHRWoecf5Tg8wM0xN1kJjzszo+akspYwZdpj6/QCQibYSB0tYp29KoFPakuSGLwh+vWVhneWeFg3mDZkz5TXgdGI+2V8RFbK+ksGQ/n5p961K/+XE7Ym8H319YESPiTGTAsmItL3xwB0XOayeu04MxCGFfYrjhSR9VPfVvwr5rb2TNdmJpBAdAY/+oZDFyjwFjRxmlahPOc2W1fvUUkm+wAeXfaHwRt+PiwhypwxA9CZ5cV4Xk= 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)(921011);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?pQ/Rpc6ALawX3sCLXjmlK9TXMBdh1C7Y3HhvXW55BECzH/JpuXfoWZmv2yXD?= =?us-ascii?Q?BnlWMmBM1YOw5wXvisIN/CZAJyo3A/niXBjQ/ZKTCLw9HnZ3WzTtOrCY8lc5?= =?us-ascii?Q?aOnFkPAmc9+MR0wkeaOBrc4MKHcR61H4zYL2NKHXrem9oVflFZ0vApwhWiuu?= =?us-ascii?Q?Onq6yqpYSGUOyIuOpcp1IH2A9t7UfhLoqcmIRPzRB7ZAK9tFMxbd7BfXXtXM?= =?us-ascii?Q?4sazXsfC6nHOSD6vUx27IbWq/01xC+kiBbSRG8M1dUM5QgsVa00yqp8DjHpR?= =?us-ascii?Q?2LuQOn5KMba2iJ6dSwwLF7r9Fz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AN7EwLC?= =?us-ascii?Q?RmCklRg0VBx23Y+Zf31onHFMwixsBDj9xyBKOzyd1xsjXcZx0zieTI07Remk?= =?us-ascii?Q?LQTDgqpKZfmTu7TgAPLpNdP6Yvj5Ra1yP5oEch4H/bcj1YfVDo0vJzgbLcze?= =?us-ascii?Q?lYZB7JerLelZ77xTHpBM4ifGWpQVlKVq/e/rRi07aOlHwQ0ek1EHSMQvGDc3?= =?us-ascii?Q?k/EuYpOyp/fSMJWAO9RVn6Ucz1p6qCbP0YW6ZOsTCGFGqp+YOCURHMQcgkkE?= =?us-ascii?Q?WpCm3LUbMHNhD8H/c4v7Ni1qY8wNTTJ/TyoYZmoOy45Mux3fXQXxo8KbfTXq?= =?us-ascii?Q?L0akTIkQPtshqHTm3DQjTGy52XdVWod+x+Gn8nybzEZ4cHN+J/xLvQ58B5JH?= =?us-ascii?Q?woJ3xxkS7lrcbGvHb3uJdLSHyqOucjZ0f6w7DBX2a612uDLgTEJxAIOTVdNo?= =?us-ascii?Q?Hw=3D=3D?= X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-Network-Message-Id: c4945d52-3b49-48fa-3a85-08dc34a575aa X-MS-Exchange-CrossTenant-AuthSource: BYAPR12MB2743.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Feb 2024 19:27:22.9743 (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: +tEeavq0ocEnyhQcvYDECXfrUax80HQX5z7KopjkhAFp5LL1iq9S6wJT4Hcl/U7Eyr/xaSv4H0tET0jxlEhLaw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR12MB6831 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') ynl = YnlFamily(spec, schema) -- 2.42.0