lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240403212931.128541-8-rrameshbabu@nvidia.com>
Date: Wed,  3 Apr 2024 14:28:45 -0700
From: Rahul Rameshbabu <rrameshbabu@...dia.com>
To: netdev@...r.kernel.org,
	linux-kernel@...r.kernel.org,
	linux-doc@...r.kernel.org
Cc: ahmed.zaki@...el.com,
	aleksander.lobakin@...el.com,
	alexandre.torgue@...s.st.com,
	andrew@...n.ch,
	cjubran@...dia.com,
	corbet@....net,
	davem@...emloft.net,
	dtatulea@...dia.com,
	edumazet@...gle.com,
	gal@...dia.com,
	hkallweit1@...il.com,
	jacob.e.keller@...el.com,
	jiri@...nulli.us,
	joabreu@...opsys.com,
	justinstitt@...gle.com,
	kory.maincent@...tlin.com,
	kuba@...nel.org,
	leon@...nel.org,
	liuhangbin@...il.com,
	maxime.chevallier@...tlin.com,
	pabeni@...hat.com,
	paul.greenwalt@...el.com,
	przemyslaw.kitszel@...el.com,
	rdunlap@...radead.org,
	richardcochran@...il.com,
	saeed@...nel.org,
	tariqt@...dia.com,
	vadim.fedorenko@...ux.dev,
	vladimir.oltean@....com,
	wojciech.drewek@...el.com,
	Rahul Rameshbabu <rrameshbabu@...dia.com>
Subject: [PATCH net-next v2 6/6] tools: ynl: ethtool.py: Output timestamping statistics from tsinfo-get operation

Print the nested stats attribute containing timestamping statistics when
the --show-time-stamping flag is used.

  [root@...ary-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 <rrameshbabu@...dia.com>
Reviewed-by: Dragos Tatulea <dtatulea@...dia.com>
---
 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}:')
-- 
2.42.0


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ