mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Rahul Rameshbabu <rrameshbabu@nvidia.com>
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 <rrameshbabu@nvidia.com>
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	[thread overview]
Message-ID: <20240403212931.128541-8-rrameshbabu@nvidia.com> (raw)
In-Reply-To: <20240403212931.128541-1-rrameshbabu@nvidia.com>

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 <rrameshbabu@nvidia.com>
Reviewed-by: Dragos Tatulea <dtatulea@nvidia.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


  parent reply	other threads:[~2024-04-03 21:29 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-03 21:28 [PATCH net-next v2 0/6] ethtool HW timestamping statistics Rahul Rameshbabu
2024-04-03 21:28 ` [PATCH net-next v2 1/6] ethtool: add interface to read Tx hardware " Rahul Rameshbabu
2024-04-03 21:28 ` [PATCH net-next v2 2/6] net/mlx5e: Introduce lost_cqe statistic counter for PTP Tx port timestamping CQ Rahul Rameshbabu
2024-04-03 21:28 ` [PATCH net-next v2 3/6] net/mlx5e: Introduce timestamps statistic counter for Tx DMA layer Rahul Rameshbabu
2024-04-03 21:28 ` [PATCH net-next v2 4/6] net/mlx5e: Implement ethtool hardware timestamping statistics Rahul Rameshbabu
2024-04-03 21:28 ` [PATCH net-next v2 5/6] netlink: specs: ethtool: add header-flags enumeration Rahul Rameshbabu
2024-04-03 21:28 ` [PATCH RFC v2 5/6] tools: ynl: ethtool.py: Make tool invokable from any CWD Rahul Rameshbabu
2024-04-03 21:34   ` Rahul Rameshbabu
2024-04-03 21:28 ` Rahul Rameshbabu [this message]
2024-04-06  6:10 ` [PATCH net-next v2 0/6] ethtool HW timestamping statistics patchwork-bot+netdevbpf

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240403212931.128541-8-rrameshbabu@nvidia.com \
    --to=rrameshbabu@nvidia.com \
    --cc=ahmed.zaki@intel.com \
    --cc=aleksander.lobakin@intel.com \
    --cc=alexandre.torgue@foss.st.com \
    --cc=andrew@lunn.ch \
    --cc=cjubran@nvidia.com \
    --cc=corbet@lwn.net \
    --cc=davem@davemloft.net \
    --cc=dtatulea@nvidia.com \
    --cc=edumazet@google.com \
    --cc=gal@nvidia.com \
    --cc=hkallweit1@gmail.com \
    --cc=jacob.e.keller@intel.com \
    --cc=jiri@resnulli.us \
    --cc=joabreu@synopsys.com \
    --cc=justinstitt@google.com \
    --cc=kory.maincent@bootlin.com \
    --cc=kuba@kernel.org \
    --cc=leon@kernel.org \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=liuhangbin@gmail.com \
    --cc=maxime.chevallier@bootlin.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=paul.greenwalt@intel.com \
    --cc=przemyslaw.kitszel@intel.com \
    --cc=rdunlap@infradead.org \
    --cc=richardcochran@gmail.com \
    --cc=saeed@kernel.org \
    --cc=tariqt@nvidia.com \
    --cc=vadim.fedorenko@linux.dev \
    --cc=vladimir.oltean@nxp.com \
    --cc=wojciech.drewek@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®