netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jacob Keller <jacob.e.keller@intel.com>
To: Rahul Rameshbabu <rrameshbabu@nvidia.com>,
	Saeed Mahameed <saeed@kernel.org>,
	Leon Romanovsky <leon@kernel.org>,
	"David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
	Jonathan Corbet <corbet@lwn.net>,
	Richard Cochran <richardcochran@gmail.com>,
	Tariq Toukan <tariqt@nvidia.com>, Gal Pressman <gal@nvidia.com>,
	Vadim Fedorenko <vadim.fedorenko@linux.dev>,
	Andrew Lunn <andrew@lunn.ch>,
	Heiner Kallweit <hkallweit1@gmail.com>,
	Przemek Kitszel <przemyslaw.kitszel@intel.com>,
	Ahmed Zaki <ahmed.zaki@intel.com>,
	Alexander Lobakin <aleksander.lobakin@intel.com>,
	Hangbin Liu <liuhangbin@gmail.com>,
	"Paul Greenwalt" <paul.greenwalt@intel.com>,
	Justin Stitt <justinstitt@google.com>,
	Randy Dunlap <rdunlap@infradead.org>,
	Maxime Chevallier <maxime.chevallier@bootlin.com>,
	Kory Maincent <kory.maincent@bootlin.com>,
	Wojciech Drewek <wojciech.drewek@intel.com>,
	Vladimir Oltean <vladimir.oltean@nxp.com>,
	Jiri Pirko <jiri@resnulli.us>,
	Alexandre Torgue <alexandre.torgue@foss.st.com>,
	Jose Abreu <joabreu@synopsys.com>,
	"Dragos Tatulea" <dtatulea@nvidia.com>
Cc: <netdev@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
	<linux-doc@vger.kernel.org>
Subject: Re: [PATCH RFC net-next v1 1/6] ethtool: add interface to read Tx hardware timestamping statistics
Date: Fri, 23 Feb 2024 13:07:08 -0800	[thread overview]
Message-ID: <abbff26c-c626-42ce-82a9-4dc983372de3@intel.com> (raw)
In-Reply-To: <20240223192658.45893-2-rrameshbabu@nvidia.com>



On 2/23/2024 11:24 AM, Rahul Rameshbabu wrote:
> +/**
> + * struct ethtool_ts_stats - HW timestamping statistics
> + * @layer: input field denoting whether stats should be queried from the DMA or
> + *        PHY timestamping layer. Defaults to the active layer for packet
> + *        timestamping.
> + * @tx_stats: struct group for TX HW timestamping
> + *	@pkts: Number of packets successfully timestamped by the queried
> + *	      layer.
> + *	@lost: Number of packet timestamps that failed to get applied on a
> + *	      packet by the queried layer.
> + *	@late: Number of packet timestamps that were delivered by the
> + *	      hardware but were lost due to arriving too late.
> + *	@err: Number of timestamping errors that occurred on the queried
> + *	     layer.
> + */
> +struct ethtool_ts_stats {
> +	enum ethtool_ts_stats_layer layer;
> +	struct_group(tx_stats,
> +		u64 pkts;
> +		u64 lost;
> +		u64 late;
> +		u64 err;
> +	);
> +};

The Intel ice drivers has the following Tx timestamp statistics:

tx_hwtstamp_skipped - indicates when we get a Tx timestamp request but
are unable to fulfill it.
tx_hwtstamp_timeouts - indicates we had a Tx timestamp skb waiting for a
timestamp from hardware but it didn't get received within some internal
time limit.
tx_hwtstamp_flushed - indicates that we flushed an outstanding timestamp
before it completed, such as if the link resets or similar.
tx_hwtstamp_discarded - indicates that we obtained a timestamp from
hardware but were unable to complete it due to invalid cached data used
for timestamp extension.

I think these could be translated roughly to one of the lost, late, or
err stats. I am a bit confused as to how drivers could distinguish
between lost and late, but I guess that depends on the specific hardware
design.

In theory we could keep some of these more detailed stats but I don't
think we strictly need to be as detailed as the ice driver is.

The only major addition I think is the skipped stat, which I would
prefer to have. Perhaps that could be tracked in the netdev layer by
checking whether the skb flags to see whether or not the driver actually
set the appropriate flag?

I think i can otherwise translate the flushed status to the lost
category, the timeout to the late category, and everything else to the
error category. I can easily add a counter to track completed timestamps
as well.

TL;DR; I would like to see a "skipped" category since I think that
should be distinguished from general errors.

Thanks!

  reply	other threads:[~2024-02-23 21:07 UTC|newest]

Thread overview: 57+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-23 19:24 [PATCH RFC net-next v1 0/6] ethtool HW timestamping statistics Rahul Rameshbabu
2024-02-23 19:24 ` [PATCH RFC net-next v1 1/6] ethtool: add interface to read Tx hardware " Rahul Rameshbabu
2024-02-23 21:07   ` Jacob Keller [this message]
2024-02-23 22:21     ` Rahul Rameshbabu
2024-02-23 22:48       ` Jacob Keller
2024-02-23 23:43         ` Rahul Rameshbabu
2024-02-26 19:54           ` Jacob Keller
2024-03-07 18:47             ` Rahul Rameshbabu
2024-03-08  3:29               ` Jacob Keller
2024-03-08  5:09                 ` Rahul Rameshbabu
2024-03-08 22:28                   ` Jacob Keller
2024-03-08 22:30                     ` Rahul Rameshbabu
2024-02-26  8:59   ` Köry Maincent
2024-02-26 10:09   ` Köry Maincent
2024-02-29  2:05   ` Jakub Kicinski
2024-02-29 22:20     ` Rahul Rameshbabu
2024-02-23 19:24 ` [PATCH RFC net-next v1 2/6] net/mlx5e: Introduce lost_cqe statistic counter for PTP Tx port timestamping CQ Rahul Rameshbabu
2024-02-23 19:24 ` [PATCH RFC net-next v1 3/6] net/mlx5e: Introduce timestamps statistic counter for Tx DMA layer Rahul Rameshbabu
2024-02-23 19:24 ` [PATCH RFC net-next v1 4/6] net/mlx5e: Implement ethtool hardware timestamping statistics Rahul Rameshbabu
2024-02-26  9:26   ` Köry Maincent
2024-02-23 19:24 ` [PATCH RFC net-next v1 5/6] tools: ynl: ethtool.py: Make tool invokable from any CWD Rahul Rameshbabu
2024-02-23 21:08   ` Jacob Keller
2024-02-23 22:39     ` Rahul Rameshbabu
2024-02-29  2:08       ` Jakub Kicinski
2024-02-23 19:24 ` [PATCH RFC net-next v1 6/6] tools: ynl: ethtool.py: Add ts ethtool statistics group Rahul Rameshbabu
2024-02-23 21:00 ` [PATCH RFC net-next v1 0/6] ethtool HW timestamping statistics Jacob Keller
2024-02-23 21:12   ` Jacob Keller
2024-02-23 22:47   ` Rahul Rameshbabu
2024-03-09  8:44 ` [PATCH RFC v2 " Rahul Rameshbabu
2024-03-09  8:44   ` [PATCH RFC v2 1/6] ethtool: add interface to read Tx hardware " Rahul Rameshbabu
2024-03-12 23:53     ` Jakub Kicinski
2024-03-14  0:26       ` Rahul Rameshbabu
2024-03-14  0:41         ` Jakub Kicinski
2024-03-14  0:50           ` Rahul Rameshbabu
2024-03-14  1:40             ` Jakub Kicinski
2024-03-14  4:19               ` Rahul Rameshbabu
2024-03-14 17:50               ` Keller, Jacob E
2024-03-14 18:48                 ` Rahul Rameshbabu
2024-03-14 17:01       ` Rahul Rameshbabu
2024-03-14 17:59         ` Jakub Kicinski
2024-03-14 18:43           ` Rahul Rameshbabu
2024-03-14 19:06             ` Jakub Kicinski
2024-03-14 20:16               ` Rahul Rameshbabu
2024-03-09  8:44   ` [PATCH RFC v2 2/6] net/mlx5e: Introduce lost_cqe statistic counter for PTP Tx port timestamping CQ Rahul Rameshbabu
2024-03-09  8:44   ` [PATCH RFC v2 3/6] net/mlx5e: Introduce timestamps statistic counter for Tx DMA layer Rahul Rameshbabu
2024-03-09  8:44   ` [PATCH RFC v2 4/6] net/mlx5e: Implement ethtool hardware timestamping statistics Rahul Rameshbabu
2024-03-09  8:44   ` [PATCH RFC v2 5/6] tools: ynl: ethtool.py: Make tool invokable from any CWD Rahul Rameshbabu
2024-03-11 12:43     ` Köry Maincent
2024-03-09  8:44   ` [PATCH RFC v2 6/6] tools: ynl: ethtool.py: Output timestamping statistics from tsinfo-get operation Rahul Rameshbabu
2024-03-12 23:55     ` Jakub Kicinski
2024-03-14  0:22       ` Rahul Rameshbabu
2024-03-14  0:47         ` Jakub Kicinski
2024-03-14  6:07           ` Rahul Rameshbabu
2024-03-14 18:05             ` Jakub Kicinski
2024-03-14 18:39               ` Rahul Rameshbabu
2024-03-14 20:04           ` Jakub Kicinski
2024-03-14 20:05             ` Rahul Rameshbabu

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=abbff26c-c626-42ce-82a9-4dc983372de3@intel.com \
    --to=jacob.e.keller@intel.com \
    --cc=ahmed.zaki@intel.com \
    --cc=aleksander.lobakin@intel.com \
    --cc=alexandre.torgue@foss.st.com \
    --cc=andrew@lunn.ch \
    --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=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=rrameshbabu@nvidia.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;
as well as URLs for NNTP newsgroup(s).