netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next v2] net: mvneta: add support for hardware timestamps
@ 2025-09-10 12:50 Russell King
  2025-09-12  1:55 ` Jakub Kicinski
  2025-09-13  0:10 ` patchwork-bot+netdevbpf
  0 siblings, 2 replies; 5+ messages in thread
From: Russell King @ 2025-09-10 12:50 UTC (permalink / raw)
  To: Andrew Lunn, Heiner Kallweit
  Cc: Andrew Lunn, David S. Miller, Eric Dumazet, Jakub Kicinski,
	Marcin Wojtas, netdev, Paolo Abeni

Add support for hardware timestamps in (e.g.) the PHY by calling
skb_tx_timestamp() as close as reasonably possible to the point that
the hardware is instructed to send the queued packets.

Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
---
v2: add ethtool_op_get_ts_info(), remove FIXME from comment.

 drivers/net/ethernet/marvell/mvneta.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/drivers/net/ethernet/marvell/mvneta.c b/drivers/net/ethernet/marvell/mvneta.c
index 476e73e502fe..01eedc3e54d9 100644
--- a/drivers/net/ethernet/marvell/mvneta.c
+++ b/drivers/net/ethernet/marvell/mvneta.c
@@ -2985,6 +2985,13 @@ static netdev_tx_t mvneta_tx(struct sk_buff *skb, struct net_device *dev)
 		if (txq->count >= txq->tx_stop_threshold)
 			netif_tx_stop_queue(nq);
 
+		/* This is not really the true transmit point, since we batch
+		 * up several before hitting the hardware, but is the best we
+		 * can do without more complexity to walk the packets in the
+		 * pending section of the transmit queue.
+		 */
+		skb_tx_timestamp(skb);
+
 		if (!netdev_xmit_more() || netif_xmit_stopped(nq) ||
 		    txq->pending + frags > MVNETA_TXQ_DEC_SENT_MASK)
 			mvneta_txq_pend_desc_add(pp, txq, frags);
@@ -5357,6 +5364,7 @@ static const struct ethtool_ops mvneta_eth_tool_ops = {
 	.set_link_ksettings = mvneta_ethtool_set_link_ksettings,
 	.get_wol        = mvneta_ethtool_get_wol,
 	.set_wol        = mvneta_ethtool_set_wol,
+	.get_ts_info	= ethtool_op_get_ts_info,
 	.get_eee	= mvneta_ethtool_get_eee,
 	.set_eee	= mvneta_ethtool_set_eee,
 };
-- 
2.47.3


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH net-next v2] net: mvneta: add support for hardware timestamps
  2025-09-10 12:50 [PATCH net-next v2] net: mvneta: add support for hardware timestamps Russell King
@ 2025-09-12  1:55 ` Jakub Kicinski
  2025-09-12  1:58   ` Jakub Kicinski
  2025-09-13  0:10 ` patchwork-bot+netdevbpf
  1 sibling, 1 reply; 5+ messages in thread
From: Jakub Kicinski @ 2025-09-12  1:55 UTC (permalink / raw)
  To: Russell King
  Cc: Andrew Lunn, Heiner Kallweit, Andrew Lunn, David S. Miller,
	Eric Dumazet, Marcin Wojtas, netdev, Paolo Abeni

On Wed, 10 Sep 2025 13:50:46 +0100 Russell King wrote:
> Subject: [PATCH net-next v2] net: mvneta: add support for hardware timestamps
> Date: Wed, 10 Sep 2025 13:50:46 +0100
> Sender: Russell King <rmk@armlinux.org.uk>
> 
> Add support for hardware timestamps in (e.g.) the PHY by calling

These are _software_ timestamps.. (in the subject as well)

Fixed when applying.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH net-next v2] net: mvneta: add support for hardware timestamps
  2025-09-12  1:55 ` Jakub Kicinski
@ 2025-09-12  1:58   ` Jakub Kicinski
  2025-09-12  8:24     ` Russell King (Oracle)
  0 siblings, 1 reply; 5+ messages in thread
From: Jakub Kicinski @ 2025-09-12  1:58 UTC (permalink / raw)
  To: Russell King
  Cc: Andrew Lunn, Heiner Kallweit, Andrew Lunn, David S. Miller,
	Eric Dumazet, Marcin Wojtas, netdev, Paolo Abeni

On Thu, 11 Sep 2025 18:55:06 -0700 Jakub Kicinski wrote:
> On Wed, 10 Sep 2025 13:50:46 +0100 Russell King wrote:
> > Subject: [PATCH net-next v2] net: mvneta: add support for hardware timestamps
> > Date: Wed, 10 Sep 2025 13:50:46 +0100
> > Sender: Russell King <rmk@armlinux.org.uk>
> > 
> > Add support for hardware timestamps in (e.g.) the PHY by calling  
> 
> These are _software_ timestamps.. (in the subject as well)
> 
> Fixed when applying.

Let me take that back, you may actually mean HW because of the PHY
handling detour. Maybe call out both software and PHY (hardware)?

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH net-next v2] net: mvneta: add support for hardware timestamps
  2025-09-12  1:58   ` Jakub Kicinski
@ 2025-09-12  8:24     ` Russell King (Oracle)
  0 siblings, 0 replies; 5+ messages in thread
From: Russell King (Oracle) @ 2025-09-12  8:24 UTC (permalink / raw)
  To: Jakub Kicinski
  Cc: Andrew Lunn, Heiner Kallweit, Andrew Lunn, David S. Miller,
	Eric Dumazet, Marcin Wojtas, netdev, Paolo Abeni

On Thu, Sep 11, 2025 at 06:58:41PM -0700, Jakub Kicinski wrote:
> On Thu, 11 Sep 2025 18:55:06 -0700 Jakub Kicinski wrote:
> > On Wed, 10 Sep 2025 13:50:46 +0100 Russell King wrote:
> > > Subject: [PATCH net-next v2] net: mvneta: add support for hardware timestamps
> > > Date: Wed, 10 Sep 2025 13:50:46 +0100
> > > Sender: Russell King <rmk@armlinux.org.uk>
> > > 
> > > Add support for hardware timestamps in (e.g.) the PHY by calling  
> > 
> > These are _software_ timestamps.. (in the subject as well)
> > 
> > Fixed when applying.
> 
> Let me take that back, you may actually mean HW because of the PHY
> handling detour. Maybe call out both software and PHY (hardware)?

I do mean PHY based hardware timestamps, because that is exactly why
I'm making the change (for my Marvell PHY PTP core.) The software
timestamping is a side effect.

-- 
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTP is here! 80Mbps down 10Mbps up. Decent connectivity at last!

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH net-next v2] net: mvneta: add support for hardware timestamps
  2025-09-10 12:50 [PATCH net-next v2] net: mvneta: add support for hardware timestamps Russell King
  2025-09-12  1:55 ` Jakub Kicinski
@ 2025-09-13  0:10 ` patchwork-bot+netdevbpf
  1 sibling, 0 replies; 5+ messages in thread
From: patchwork-bot+netdevbpf @ 2025-09-13  0:10 UTC (permalink / raw)
  To: Russell King
  Cc: andrew, hkallweit1, andrew+netdev, davem, edumazet, kuba,
	marcin.s.wojtas, netdev, pabeni

Hello:

This patch was applied to netdev/net-next.git (main)
by Jakub Kicinski <kuba@kernel.org>:

On Wed, 10 Sep 2025 13:50:46 +0100 you wrote:
> Add support for hardware timestamps in (e.g.) the PHY by calling
> skb_tx_timestamp() as close as reasonably possible to the point that
> the hardware is instructed to send the queued packets.
> 
> Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
> ---
> v2: add ethtool_op_get_ts_info(), remove FIXME from comment.
> 
> [...]

Here is the summary with links:
  - [net-next,v2] net: mvneta: add support for hardware timestamps
    https://git.kernel.org/netdev/net-next/c/903e6d05876f

You are awesome, thank you!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2025-09-13  0:10 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-09-10 12:50 [PATCH net-next v2] net: mvneta: add support for hardware timestamps Russell King
2025-09-12  1:55 ` Jakub Kicinski
2025-09-12  1:58   ` Jakub Kicinski
2025-09-12  8:24     ` Russell King (Oracle)
2025-09-13  0:10 ` patchwork-bot+netdevbpf

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).