Commit fb7516d4 authored by Govindarajulu Varadarajan's avatar Govindarajulu Varadarajan Committed by David S. Miller

enic: add sw timestamp support

Add ethtool ops to advertise sw timestamping.
Call skb_tx_timestamp() just before ringing the wq doorbell.
Signed-off-by: default avatarGovindarajulu Varadarajan <gvaradar@cisco.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent b8278f2c
...@@ -18,6 +18,7 @@ ...@@ -18,6 +18,7 @@
#include <linux/netdevice.h> #include <linux/netdevice.h>
#include <linux/ethtool.h> #include <linux/ethtool.h>
#include <linux/net_tstamp.h>
#include "enic_res.h" #include "enic_res.h"
#include "enic.h" #include "enic.h"
...@@ -578,6 +579,16 @@ static int enic_set_rxfh(struct net_device *netdev, const u32 *indir, ...@@ -578,6 +579,16 @@ static int enic_set_rxfh(struct net_device *netdev, const u32 *indir,
return __enic_set_rsskey(enic); 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 = { static const struct ethtool_ops enic_ethtool_ops = {
.get_drvinfo = enic_get_drvinfo, .get_drvinfo = enic_get_drvinfo,
.get_msglevel = enic_get_msglevel, .get_msglevel = enic_get_msglevel,
...@@ -597,6 +608,7 @@ static const struct ethtool_ops enic_ethtool_ops = { ...@@ -597,6 +608,7 @@ static const struct ethtool_ops enic_ethtool_ops = {
.get_rxfh = enic_get_rxfh, .get_rxfh = enic_get_rxfh,
.set_rxfh = enic_set_rxfh, .set_rxfh = enic_set_rxfh,
.get_link_ksettings = enic_get_ksettings, .get_link_ksettings = enic_get_ksettings,
.get_ts_info = enic_get_ts_info,
}; };
void enic_set_ethtool_ops(struct net_device *netdev) void enic_set_ethtool_ops(struct net_device *netdev)
......
...@@ -856,6 +856,7 @@ static netdev_tx_t enic_hard_start_xmit(struct sk_buff *skb, ...@@ -856,6 +856,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) if (vnic_wq_desc_avail(wq) < MAX_SKB_FRAGS + ENIC_DESC_MAX_SPLITS)
netif_tx_stop_queue(txq); netif_tx_stop_queue(txq);
skb_tx_timestamp(skb);
if (!skb->xmit_more || netif_xmit_stopped(txq)) if (!skb->xmit_more || netif_xmit_stopped(txq))
vnic_wq_doorbell(wq); vnic_wq_doorbell(wq);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment