e1000e: add support for hardware timestamping on some devices
On 82574, 82583, 82579, I217 and I218 add support for hardware time stamping of all or no Rx packets and Tx packets which have the SKBTX_HW_TSTAMP flag set. Update the .get_ts_info ethtool operation to report the supported time stamping modes, and enable and disable hardware time stamping with the SIOCSHWTSTAMP ioctl. Signed-off-by: Bruce Allan <bruce.w.allan@intel.com> Tested-by: Jeff Pieper <jeffrey.e.pieper@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
This commit is contained in:
parent
ffe0b2ff17
commit
b67e191307
7 changed files with 462 additions and 8 deletions
|
@ -108,6 +108,7 @@ static const struct e1000_stats e1000_gstrings_stats[] = {
|
|||
E1000_STAT("dropped_smbus", stats.mgpdc),
|
||||
E1000_STAT("rx_dma_failed", rx_dma_failed),
|
||||
E1000_STAT("tx_dma_failed", tx_dma_failed),
|
||||
E1000_STAT("rx_hwtstamp_cleared", rx_hwtstamp_cleared),
|
||||
};
|
||||
|
||||
#define E1000_GLOBAL_STATS_LEN ARRAY_SIZE(e1000_gstrings_stats)
|
||||
|
@ -2182,6 +2183,28 @@ static int e1000e_set_eee(struct net_device *netdev, struct ethtool_eee *edata)
|
|||
return 0;
|
||||
}
|
||||
|
||||
static int e1000e_get_ts_info(struct net_device *netdev,
|
||||
struct ethtool_ts_info *info)
|
||||
{
|
||||
struct e1000_adapter *adapter = netdev_priv(netdev);
|
||||
|
||||
ethtool_op_get_ts_info(netdev, info);
|
||||
|
||||
if (!(adapter->flags & FLAG_HAS_HW_TIMESTAMP))
|
||||
return 0;
|
||||
|
||||
info->so_timestamping |= (SOF_TIMESTAMPING_TX_HARDWARE |
|
||||
SOF_TIMESTAMPING_RX_HARDWARE |
|
||||
SOF_TIMESTAMPING_RAW_HARDWARE);
|
||||
|
||||
info->tx_types = (1 << HWTSTAMP_TX_OFF) | (1 << HWTSTAMP_TX_ON);
|
||||
|
||||
info->rx_filters = ((1 << HWTSTAMP_FILTER_NONE) |
|
||||
(1 << HWTSTAMP_FILTER_ALL));
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static const struct ethtool_ops e1000_ethtool_ops = {
|
||||
.get_settings = e1000_get_settings,
|
||||
.set_settings = e1000_set_settings,
|
||||
|
@ -2209,7 +2232,7 @@ static const struct ethtool_ops e1000_ethtool_ops = {
|
|||
.get_coalesce = e1000_get_coalesce,
|
||||
.set_coalesce = e1000_set_coalesce,
|
||||
.get_rxnfc = e1000_get_rxnfc,
|
||||
.get_ts_info = ethtool_op_get_ts_info,
|
||||
.get_ts_info = e1000e_get_ts_info,
|
||||
.get_eee = e1000e_get_eee,
|
||||
.set_eee = e1000e_set_eee,
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue