enetc: add software timestamping
authorMichael Walle <michael@walle.cc>
Tue, 10 Dec 2019 00:15:37 +0000 (01:15 +0100)
committerDavid S. Miller <davem@davemloft.net>
Wed, 11 Dec 2019 01:32:06 +0000 (17:32 -0800)
Provide a software TX timestamp and add it to the ethtool query
interface.

skb_tx_timestamp() is also needed if one would like to use PHY
timestamping.

Signed-off-by: Michael Walle <michael@walle.cc>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/freescale/enetc/enetc.c
drivers/net/ethernet/freescale/enetc/enetc_ethtool.c

index 17739906c966c455cf387d9aa6866f2c00a95fdf..2ee4a2cd47805ba0870e1205e3f968f5c369cc4a 100644 (file)
@@ -227,6 +227,8 @@ static int enetc_map_tx_buffs(struct enetc_bdr *tx_ring, struct sk_buff *skb,
        enetc_bdr_idx_inc(tx_ring, &i);
        tx_ring->next_to_use = i;
 
+       skb_tx_timestamp(skb);
+
        /* let H/W know BD ring has been updated */
        enetc_wr_reg(tx_ring->tpir, i); /* includes wmb() */
 
index 880a8ed8bb4743dee4619daf1bd1da8b672a04c6..301ee0dde02d784acd9f1c7952bc7b0ac751e929 100644 (file)
@@ -579,6 +579,7 @@ static int enetc_get_ts_info(struct net_device *ndev,
                           (1 << HWTSTAMP_FILTER_ALL);
 #else
        info->so_timestamping = SOF_TIMESTAMPING_RX_SOFTWARE |
+                               SOF_TIMESTAMPING_TX_SOFTWARE |
                                SOF_TIMESTAMPING_SOFTWARE;
 #endif
        return 0;