]> git.baikalelectronics.ru Git - kernel.git/commitdiff
net: gianfar: add support for software TX timestamping
authorVladimir Oltean <vladimir.oltean@nxp.com>
Wed, 29 Jun 2022 18:13:35 +0000 (21:13 +0300)
committerJakub Kicinski <kuba@kernel.org>
Fri, 1 Jul 2022 04:09:05 +0000 (21:09 -0700)
These are required by certain network profiling applications in order to
measure delays.

Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Acked-by: Richard Cochran <richardcochran@gmail.com>
Reviewed-by: Claudiu Manoil <claudiu.manoil@nxp.com>
Link: https://lore.kernel.org/r/20220629181335.3800821-1-vladimir.oltean@nxp.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/freescale/gianfar.c
drivers/net/ethernet/freescale/gianfar_ethtool.c

index 3dc9369a33f77d73c4a7755cf4849a27c2b5924b..e7bf1524b68ee6b17667457e99eac8705840a6c2 100644 (file)
@@ -1944,6 +1944,7 @@ static netdev_tx_t gfar_start_xmit(struct sk_buff *skb, struct net_device *dev)
                lstatus |= BD_LFLAG(TXBD_CRC | TXBD_READY) | skb_headlen(skb);
        }
 
+       skb_tx_timestamp(skb);
        netdev_tx_sent_queue(txq, bytes_sent);
 
        gfar_wmb();
index 9a2c16d69e2c1ae7657811cd6060d4187ee719b7..81fb687301381313c9a4968cb38f7f5d5caf174e 100644 (file)
@@ -1457,6 +1457,7 @@ static int gfar_get_ts_info(struct net_device *dev,
 
        if (!(priv->device_flags & FSL_GIANFAR_DEV_HAS_TIMER)) {
                info->so_timestamping = SOF_TIMESTAMPING_RX_SOFTWARE |
+                                       SOF_TIMESTAMPING_TX_SOFTWARE |
                                        SOF_TIMESTAMPING_SOFTWARE;
                return 0;
        }
@@ -1474,7 +1475,10 @@ static int gfar_get_ts_info(struct net_device *dev,
 
        info->so_timestamping = SOF_TIMESTAMPING_TX_HARDWARE |
                                SOF_TIMESTAMPING_RX_HARDWARE |
-                               SOF_TIMESTAMPING_RAW_HARDWARE;
+                               SOF_TIMESTAMPING_RAW_HARDWARE |
+                               SOF_TIMESTAMPING_RX_SOFTWARE |
+                               SOF_TIMESTAMPING_TX_SOFTWARE |
+                               SOF_TIMESTAMPING_SOFTWARE;
        info->tx_types = (1 << HWTSTAMP_TX_OFF) |
                         (1 << HWTSTAMP_TX_ON);
        info->rx_filters = (1 << HWTSTAMP_FILTER_NONE) |