From: Vladimir Oltean <vladimir.oltean@nxp.com>
To: Gerhard Engleder <gerhard@engleder-embedded.com>
Cc: netdev@vger.kernel.org, davem@davemloft.net, kuba@kernel.org,
edumazet@google.com, pabeni@redhat.com, andrew+netdev@lunn.ch
Subject: Re: [PATCH net v2] tsnep: fix timestamping with a stacked DSA driver
Date: Thu, 15 May 2025 12:16:35 +0300 [thread overview]
Message-ID: <20250515091635.gevpm33zszsbfpxu@skbuf> (raw)
In-Reply-To: <20250514195657.25874-1-gerhard@engleder-embedded.com> <20250514195657.25874-1-gerhard@engleder-embedded.com>
On Wed, May 14, 2025 at 09:56:57PM +0200, Gerhard Engleder wrote:
> This driver is susceptible to a form of the bug explained in commit
> c26a2c2ddc01 ("gianfar: Fix TX timestamping with a stacked DSA driver")
> and in Documentation/networking/timestamping.rst section "Other caveats
> for MAC drivers", specifically it timestamps any skb which has
> SKBTX_HW_TSTAMP, and does not consider if timestamping has been enabled
> in adapter->hwtstamp_config.tx_type.
>
> Evaluate the proper TX timestamping condition only once on the TX
> path (in tsnep_xmit_frame_ring()) and store the result in an additional
> TX entry flag. Evaluate the new TX entry flag in the TX confirmation path
> (in tsnep_tx_poll()).
>
> This way SKBTX_IN_PROGRESS is set by the driver as required, but never
> evaluated. SKBTX_IN_PROGRESS shall not be evaluated as it can be set
> by a stacked DSA driver and evaluating it would lead to unwanted
> timestamps.
>
> Fixes: 403f69bbdbad ("tsnep: Add TSN endpoint Ethernet MAC driver")
> Suggested-by: Vladimir Oltean <vladimir.oltean@nxp.com>
> Signed-off-by: Gerhard Engleder <gerhard@engleder-embedded.com>
> ---
> v2:
> - took over patch from Vladimir Oltean (thank you for your work, I hope
> the Suggested-by is ok for you, I was not sure about Co-developed-by)
> - do TX timestamp check only in tsnep_xmit_frame_ring() and store result
> in TX entry flag
> ---
Reviewed-by: Vladimir Oltean <vladimir.oltean@nxp.com>
next prev parent reply other threads:[~2025-05-15 9:16 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-05-14 19:56 [PATCH net v2] tsnep: fix timestamping with a stacked DSA driver Gerhard Engleder
2025-05-15 9:16 ` Vladimir Oltean [this message]
2025-05-15 15:10 ` 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=20250515091635.gevpm33zszsbfpxu@skbuf \
--to=vladimir.oltean@nxp.com \
--cc=andrew+netdev@lunn.ch \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=gerhard@engleder-embedded.com \
--cc=kuba@kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.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