Skip to contentSkip to conversation

sfc: use hardware tx timestamps for more than PTP

PATCH Applied Edward Cree 2 participants 2 messages Apr 7, 2022 – Apr 8, 2022

Subsystems (3)
lore
Share & tools
lore

Edward Cree

author maintainer
#0 lore raw

PATCH 1/1 sfc: use hardware tx timestamps for more than PTP

From: Bert Kenward <[email protected]>

The 8000 series and newer NICs all get hardware timestamps from the MAC
and can provide timestamps on a normal TX queue, rather than via a slow path through the MC. As such we can use this path for any packet where a hardware timestamp is requested.
This also enables support for PTP over transports other than IPv4+UDP.

---
 drivers/net/ethernet/sfc/tx.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/net/ethernet/sfc/tx.c +2 -1
index d16e031e95f4..35240eb6e903 100644
@@ -524,7 +524,8 @@ netdev_tx_t efx_hard_start_xmit(struct sk_buff *skb,
 
 	/* PTP "event" packet */
 	if (unlikely(efx_xmit_with_hwtstamp(skb)) &&
-	    unlikely(efx_ptp_is_ptp_tx(efx, skb))) {
+	    ((efx_ptp_use_mac_tx_timestamps(efx) && efx->ptp_data) ||
+	    unlikely(efx_ptp_is_ptp_tx(efx, skb)))) {
 		/* There may be existing transmits on the channel that are
 		 * waiting for this packet to trigger the doorbell write.
 		 * We need to send the packets at this point.
#1 lore raw
This patch was applied to netdev/net-next.git (master) by Jakub Kicinski <[email protected]>:

Hello:

This patch was applied to netdev/net-next.git (master) by Jakub Kicinski <[email protected]>:

Quoted 9 lines · On Thu, 7 Apr 2022 16:24:02 +0100 you wrote:

From: Bert Kenward <[email protected]>

The 8000 series and newer NICs all get hardware timestamps from the MAC
and can provide timestamps on a normal TX queue, rather than via a slow path through the MC. As such we can use this path for any packet where a hardware timestamp is requested.
This also enables support for PTP over transports other than IPv4+UDP.

[...]

Here is the summary with links:
- [net-next] sfc: use hardware tx timestamps for more than PTP

    https://git.kernel.org/netdev/net-next/c/bd4a2697e5e2

You are awesome, thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html