]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
enic: add sw timestamp support
authorGovindarajulu Varadarajan <gvaradar@cisco.com>
Fri, 1 Dec 2017 18:21:40 +0000 (10:21 -0800)
committerJack Vogel <jack.vogel@oracle.com>
Wed, 7 Mar 2018 04:28:36 +0000 (20:28 -0800)
Add ethtool ops to advertise sw timestamping.
Call skb_tx_timestamp() just before ringing the wq doorbell.

Signed-off-by: Govindarajulu Varadarajan <gvaradar@cisco.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Orabug: 27587345
(cherry picked from commit fb7516d42478ebc8e2f00efb76ef96f7b68fd8d3)
Signed-off-by: Jack Vogel <jack.vogel@oracle.com>
Reviewed-by: Kirtikar Kashyap <kirtikar.kashyap@oracle.com>
drivers/net/ethernet/cisco/enic/enic_ethtool.c
drivers/net/ethernet/cisco/enic/enic_main.c

index d0aa50e9c4392dc8a664e34cebeae17203e1067e..1990a2c5a44c42b4010fc11a5fa882f53d05b4ae 100644 (file)
@@ -18,6 +18,7 @@
 
 #include <linux/netdevice.h>
 #include <linux/ethtool.h>
+#include <linux/net_tstamp.h>
 
 #include "enic_res.h"
 #include "enic.h"
@@ -574,6 +575,16 @@ static int enic_set_rxfh(struct net_device *netdev, const u32 *indir,
        return __enic_set_rsskey(enic);
 }
 
+static int enic_get_ts_info(struct net_device *netdev,
+                           struct ethtool_ts_info *info)
+{
+       info->so_timestamping = SOF_TIMESTAMPING_TX_SOFTWARE |
+                               SOF_TIMESTAMPING_RX_SOFTWARE |
+                               SOF_TIMESTAMPING_SOFTWARE;
+
+       return 0;
+}
+
 static const struct ethtool_ops enic_ethtool_ops = {
        .get_settings = enic_get_settings,
        .get_drvinfo = enic_get_drvinfo,
@@ -593,6 +604,7 @@ static const struct ethtool_ops enic_ethtool_ops = {
        .get_rxfh_key_size = enic_get_rxfh_key_size,
        .get_rxfh = enic_get_rxfh,
        .set_rxfh = enic_set_rxfh,
+       .get_ts_info = enic_get_ts_info,
 };
 
 void enic_set_ethtool_ops(struct net_device *netdev)
index 9405ac6e50dfaa8cd69b8f5bc47e25aa917897f7..a047158a93daa16b813a8456f330fb3d795e3af8 100644 (file)
@@ -674,6 +674,7 @@ static netdev_tx_t enic_hard_start_xmit(struct sk_buff *skb,
 
        if (vnic_wq_desc_avail(wq) < MAX_SKB_FRAGS + ENIC_DESC_MAX_SPLITS)
                netif_tx_stop_queue(txq);
+       skb_tx_timestamp(skb);
        if (!skb->xmit_more || netif_xmit_stopped(txq))
                vnic_wq_doorbell(wq);