From patchwork Wed Apr 3 21:28:45 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rahul Rameshbabu X-Patchwork-Id: 13616727 X-Patchwork-Delegate: kuba@kernel.org Received: from NAM10-MW2-obe.outbound.protection.outlook.com (mail-mw2nam10on2133.outbound.protection.outlook.com [40.107.94.133]) (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 3EC26156F28; Wed, 3 Apr 2024 21:29:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.94.133 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712179794; cv=fail; b=hjt8U83e2MxuHkRBtTXE8aMp1XBczHwZFE6nHuzr5JzIJWdJ/r4oXDsCJI5w8UB9Dlzb6MqxXol8j1eqbirBWhJJbJFvmUUcMqPuWHniMqA6UAAkbRyk8R8VRQOtzzCh8iiNW43XaTQBub0BJ2rPeS/kBIOV+z8bFkmD1T3E8iM= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712179794; c=relaxed/simple; bh=WcARV9EEmygFik7TxeEZLEIAzAFkt5zRbts9fcuh/9c=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: Content-Type:MIME-Version; b=MKDz9lLeFKintKyFYEsnD0URVs0AWQnaCVmOqu19wVvSIldaxuMMWiN3cpmryXotTYvJu0iMI3FH4Fldw8nzCYNnZFoXOSnS232Sgtl/OkFF8DdTfddugfPIh33EiUMPNloDaPbnbHE5jMsyVK87eAC1s6VHrcbPi0aJzppKwIU= 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=S+BpDJ1w; arc=fail smtp.client-ip=40.107.94.133 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=Nvidia.com header.i=@Nvidia.com header.b="S+BpDJ1w" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=kn54yxOLrZg+918IEeqGM6nKhFImeeBnoG7kvDUZLYt6qguIdN2rMPEUT4lS5ZA158GsSbjBFiqfve+PYDhrbJQeANTLzk4dH3KgWYWJpfPBGUQrSCrckcWlfQVTAPWdRgMve44lSIzhlQ35pbQN6qC7aKdKB2m3KeCmHdY+DooARlcAiwTxy3G3D/y89Mse68++3CCIufsyfhdJuBq1J/3pN+rMdjRt23wM3IMhj5GcNPxX1kZTnqO1H477QT5U5oSMYlwo5t+r7YJYBHHCuDpzMhhmoHKRMH6KvChbmWcWl4XyWTxssI/C8HP6UaJzZKWluq01u4Lci5iDnRsUBA== 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=yzu2h7owJYfaBza9LYpvZJNzfQg78YM7Kwm33ootnEo=; b=T8JgjBCBOCIRpuGgjCmZHyGac7BPHfWw2L7ozNxUc/dLeqoQ5wmShmUipH2PSgjuYTDZHt4vUfOtWSul/gsbayFJ8St+XSCmEdGTrPIlnY6LGJd2tf2SwVH7jVQc4HsQQ571nFhIpLIx2vToMApPenOIzG5MQXoDChhc5e08DTFCEclYhvyQTYbDE1ukWeKIz2abfeIxuqEvgCGZhxDJUl2Y+R10GDgsyJshjLsMGZHCDpV2KSjM69P3QNrOx+G6HrytoxDii2GEwPWog515TNL2qkGsfwoAG+dRhF3iMsEsFhGSH1sfonkIRXtlFHlxXe0tslKWPuJupuuERSBAtg== 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=yzu2h7owJYfaBza9LYpvZJNzfQg78YM7Kwm33ootnEo=; b=S+BpDJ1wPBJbbgfW2bjc0+pAS+fcB5tkxQ/wxZCNnioicFKVuytGieTBBKi4fF1LDn0Z4KLDrHeG6yDNxzgVGJ6c5xx0nO++TAeMYcLBQyJrGl1YyfdDZvlAANKO7FKRApjnyIz/IESpUBZPoSP5JOoNspRnlTQL0cX6xjW/8wFJEiQYuRrr3rXDZp9Xm166qq0Wby7Uzs/pO7AqHAEC8++/zE0CyYYZ14H4FOJHcFR7txQcdFROhVfMegBeTTpb6UxN21mk2FOp6b/CR71ZJGrrs0lRsLCVIG/9dcMmIYHYDIC4kzv+D4QxlaKD4U74BjnWfLTxZbgDmFtA9FmAPA== Received: from BYAPR12MB2743.namprd12.prod.outlook.com (2603:10b6:a03:61::28) by DS0PR12MB8317.namprd12.prod.outlook.com (2603:10b6:8:f4::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7409.46; Wed, 3 Apr 2024 21:29:48 +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.7409.042; Wed, 3 Apr 2024 21:29:48 +0000 From: Rahul Rameshbabu To: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org Cc: ahmed.zaki@intel.com, aleksander.lobakin@intel.com, alexandre.torgue@foss.st.com, andrew@lunn.ch, cjubran@nvidia.com, corbet@lwn.net, davem@davemloft.net, dtatulea@nvidia.com, edumazet@google.com, gal@nvidia.com, hkallweit1@gmail.com, jacob.e.keller@intel.com, jiri@resnulli.us, joabreu@synopsys.com, justinstitt@google.com, kory.maincent@bootlin.com, kuba@kernel.org, leon@kernel.org, liuhangbin@gmail.com, maxime.chevallier@bootlin.com, pabeni@redhat.com, paul.greenwalt@intel.com, przemyslaw.kitszel@intel.com, rdunlap@infradead.org, richardcochran@gmail.com, saeed@kernel.org, tariqt@nvidia.com, vadim.fedorenko@linux.dev, vladimir.oltean@nxp.com, wojciech.drewek@intel.com, Rahul Rameshbabu Subject: [PATCH net-next v2 6/6] tools: ynl: ethtool.py: Output timestamping statistics from tsinfo-get operation Date: Wed, 3 Apr 2024 14:28:45 -0700 Message-ID: <20240403212931.128541-8-rrameshbabu@nvidia.com> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20240403212931.128541-1-rrameshbabu@nvidia.com> References: <20240403212931.128541-1-rrameshbabu@nvidia.com> X-ClientProxiedBy: BYAPR11CA0072.namprd11.prod.outlook.com (2603:10b6:a03:80::49) To BYAPR12MB2743.namprd12.prod.outlook.com (2603:10b6:a03:61::28) Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BYAPR12MB2743:EE_|DS0PR12MB8317:EE_ X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: ZUMytboxh5Fwq1TJtTh1BVuMIzbrPGtxpRHwwHmnJ/1aFxQ3L12mhpv3Uo8UIMgbj6IFu/BtcOs3yUiokPIc/Fwuk82twNJqmbCG3HjRUQT4lLZEHVY7kfhujTCtovkjH7xQ9tToOSpOHlofvm560/bTHglvB4p5TTfDqj3h24G/YbHvyODkDpxAe4EGqQnD2k1K9K/Nw8u12BpfN41QZcpc+ok04vCFzvsPrCS+MmzPY46ncrpu1DJFJs4OhM35JlwHUI7nEWFXl9HeyVGrfwfOOnDQYIVLfuF+MKDtfUMdXIaAFCVsjzCSweGAPpF6VCnhHD0b12B1wnt5pfRLYXp6lN6alsLpIkR9+vTK+zhk2KTuETCJLeCW9RA9H9BePvX26c9XXS5EzTNzPFk/+EzWOb0EjqhzUQfE6rtcECBW24i6q/7sztkHfbspXb2zACAxiWCzkAJKVmAk0AJSG8wWt+dqrwZlSTjyrRgez/3UUKrQpWBnKengy5G/b9dp8vKxQgJrwHhIYoQ5LzDxmRerhqgkdp5Hnak7Nn7abrppgAb0NgqutxNJXOauZPqbSa0yfNIyKDhKT0/wd4YQiyr1dhrD4r2mw2Cz+oMpPXpjgEtIl4ZVQaDCI+VW3oAeB0syKM8F/0WkVhi5mWTilc/qMIVz7Dqpl6UKfSS7RT8= 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)(7416005)(366007)(376005)(1800799015);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: U/KSOzFYycLncG0Adi2zrSZPJINXEQaLp3lRqMcIVGaOxlOiQ/OZqGkNsx5ID22kjIYkuvvCXJl6kccNNG7PnTs6sAqPAy/4xa67ab+DS/8VR6jb+SN454Sdv7AyDt4XoLZCOb8gdMlQwF+MgKftmbjSWCNRyRYXrmGWDkmHPZ14oCW19ZeAlUOp/ZSToXjksfI2JLouNwQK5hiOH3AvmvtRE8XrOFDmOitFU6KZNzI+oWGZ9ktOizRTqGsmDArImiAqOYSismr29sI+qW9QtYdH53+vp/nGNz3EzANZTCornvgll98XueyrRwNfxc22Vujfj1A4/Bo06FT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pOVkJLD4/ujsPuQJhoNkEemCu82YWQOxoMQ70t8VA3l6AhRTgMJifcbm7ipoyYJD0eduqOQ4SmT9oAU0HXPBEZF+gnMOg6nwNVqAN7BAEwBYZMvb9S2MZZqb+RAIAZ2u27/A6GIw6aTAv6N8lQ8xl//9dfC6mc8X9TVbRfmp75JNoB79XlZf6X3SLUHaZ8ZfYyIaoxp1lFF7w== X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-Network-Message-Id: f2d2db69-b335-43ad-24f2-08dc54252cb2 X-MS-Exchange-CrossTenant-AuthSource: BYAPR12MB2743.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Apr 2024 21:29:42.1222 (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: E7O9mPw6b469gSPb702W4fmrpDNbnbIM1UR7SxlWow0R5REyufwYc+aSYrMLpoyTDyc5cOJdJL+ivFXTJeiMOQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS0PR12MB8317 X-Patchwork-Delegate: kuba@kernel.org Print the nested stats attribute containing timestamping statistics when the --show-time-stamping flag is used. [root@binary-eater-vm-01 linux-ethtool-ts]# ./tools/net/ynl/ethtool.py --show-time-stamping mlx5_1 Time stamping parameters for mlx5_1: Capabilities: hardware-transmit hardware-receive hardware-raw-clock PTP Hardware Clock: 0 Hardware Transmit Timestamp Modes: off on Hardware Receive Filter Modes: none all Statistics: tx-pkts: 8 tx-lost: 0 tx-err: 0 Signed-off-by: Rahul Rameshbabu Reviewed-by: Dragos Tatulea --- tools/net/ynl/ethtool.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/tools/net/ynl/ethtool.py b/tools/net/ynl/ethtool.py index 6c9f7e31250c..47264ae20036 100755 --- a/tools/net/ynl/ethtool.py +++ b/tools/net/ynl/ethtool.py @@ -320,7 +320,13 @@ def main(): return if args.show_time_stamping: - tsinfo = dumpit(ynl, args, 'tsinfo-get') + req = { + 'header': { + 'flags': 'stats', + }, + } + + tsinfo = dumpit(ynl, args, 'tsinfo-get', req) print(f'Time stamping parameters for {args.device}:') @@ -334,6 +340,9 @@ def main(): print('Hardware Receive Filter Modes:') [print(f'\t{v}') for v in bits_to_dict(tsinfo['rx-filters'])] + + print('Statistics:') + [print(f'\t{k}: {v}') for k, v in tsinfo['stats'].items()] return print(f'Settings for {args.device}:')