aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBert Kenward <bkenward@solarflare.com>2022-04-07 16:24:02 +0100
committerJakub Kicinski <kuba@kernel.org>2022-04-08 14:43:10 -0700
commitbd4a2697e5e27a33d345827dfbdebb8f28f4aa87 (patch)
treee998456ff4e469ee20993a5eba0b8697bf48327a
parentnet: phy: micrel: ksz9031/ksz9131: add cabletest support (diff)
downloadlinux-dev-bd4a2697e5e27a33d345827dfbdebb8f28f4aa87.tar.xz
linux-dev-bd4a2697e5e27a33d345827dfbdebb8f28f4aa87.zip
sfc: use hardware tx timestamps for more than PTP
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. Signed-off-by: Bert Kenward <bkenward@solarflare.com> Signed-off-by: Edward Cree <ecree@xilinx.com> Link: https://lore.kernel.org/r/510652dc-54b4-0e11-657e-e37ee3ca26a9@gmail.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
-rw-r--r--drivers/net/ethernet/sfc/tx.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/net/ethernet/sfc/tx.c b/drivers/net/ethernet/sfc/tx.c
index 6983799e1c05..138bca611341 100644
--- a/drivers/net/ethernet/sfc/tx.c
+++ b/drivers/net/ethernet/sfc/tx.c
@@ -527,7 +527,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.