virtio_net: add software timestamp support
authorJacob Keller <jacob.e.keller@intel.com>
Wed, 25 Jun 2014 02:37:13 +0000 (02:37 +0000)
committerJeff Kirsher <jeffrey.t.kirsher@intel.com>
Fri, 23 Jan 2015 02:10:16 +0000 (18:10 -0800)
This patch enables the use of software timestamping via the virtio_net
driver.

Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
drivers/net/virtio_net.c

index 11e2e8131359cf609e75d65c1fd2e51cb03c64af..9bd71d53c5e06f2b19bb1fe80cd5903610af534e 100644 (file)
@@ -925,6 +925,9 @@ static netdev_tx_t start_xmit(struct sk_buff *skb, struct net_device *dev)
        /* Free up any pending old buffers before queueing new ones. */
        free_old_xmit_skbs(sq);
 
+       /* timestamp packet in software */
+       skb_tx_timestamp(skb);
+
        /* Try to transmit */
        err = xmit_skb(sq, skb);
 
@@ -1376,6 +1379,7 @@ static const struct ethtool_ops virtnet_ethtool_ops = {
        .get_ringparam = virtnet_get_ringparam,
        .set_channels = virtnet_set_channels,
        .get_channels = virtnet_get_channels,
+       .get_ts_info = ethtool_op_get_ts_info,
 };
 
 #define MIN_MTU 68