hc
2024-05-10 23fa18eaa71266feff7ba8d83022d9e1cc83c65a
kernel/drivers/net/ethernet/intel/ixgbevf/ethtool.c
....@@ -31,14 +31,14 @@
3131 #define IXGBEVF_STAT(_name, _stat) { \
3232 .stat_string = _name, \
3333 .type = IXGBEVF_STATS, \
34
- .sizeof_stat = FIELD_SIZEOF(struct ixgbevf_adapter, _stat), \
34
+ .sizeof_stat = sizeof_field(struct ixgbevf_adapter, _stat), \
3535 .stat_offset = offsetof(struct ixgbevf_adapter, _stat) \
3636 }
3737
3838 #define IXGBEVF_NETDEV_STAT(_net_stat) { \
3939 .stat_string = #_net_stat, \
4040 .type = NETDEV_STATS, \
41
- .sizeof_stat = FIELD_SIZEOF(struct net_device_stats, _net_stat), \
41
+ .sizeof_stat = sizeof_field(struct net_device_stats, _net_stat), \
4242 .stat_offset = offsetof(struct net_device_stats, _net_stat) \
4343 }
4444
....@@ -55,6 +55,8 @@
5555 IXGBEVF_STAT("alloc_rx_page", alloc_rx_page),
5656 IXGBEVF_STAT("alloc_rx_page_failed", alloc_rx_page_failed),
5757 IXGBEVF_STAT("alloc_rx_buff_failed", alloc_rx_buff_failed),
58
+ IXGBEVF_STAT("tx_ipsec", tx_ipsec),
59
+ IXGBEVF_STAT("rx_ipsec", rx_ipsec),
5860 };
5961
6062 #define IXGBEVF_QUEUE_STATS_LEN ( \
....@@ -83,22 +85,16 @@
8385 struct ethtool_link_ksettings *cmd)
8486 {
8587 struct ixgbevf_adapter *adapter = netdev_priv(netdev);
86
- struct ixgbe_hw *hw = &adapter->hw;
87
- u32 link_speed = 0;
88
- bool link_up;
8988
9089 ethtool_link_ksettings_zero_link_mode(cmd, supported);
9190 ethtool_link_ksettings_add_link_mode(cmd, supported, 10000baseT_Full);
9291 cmd->base.autoneg = AUTONEG_DISABLE;
9392 cmd->base.port = -1;
9493
95
- hw->mac.get_link_status = 1;
96
- hw->mac.ops.check_link(hw, &link_speed, &link_up, false);
97
-
98
- if (link_up) {
94
+ if (adapter->link_up) {
9995 __u32 speed = SPEED_10000;
10096
101
- switch (link_speed) {
97
+ switch (adapter->link_speed) {
10298 case IXGBE_LINK_SPEED_10GB_FULL:
10399 speed = SPEED_10000;
104100 break;
....@@ -222,8 +218,6 @@
222218 struct ixgbevf_adapter *adapter = netdev_priv(netdev);
223219
224220 strlcpy(drvinfo->driver, ixgbevf_driver_name, sizeof(drvinfo->driver));
225
- strlcpy(drvinfo->version, ixgbevf_driver_version,
226
- sizeof(drvinfo->version));
227221 strlcpy(drvinfo->bus_info, pci_name(adapter->pdev),
228222 sizeof(drvinfo->bus_info));
229223
....@@ -972,6 +966,7 @@
972966 }
973967
974968 static const struct ethtool_ops ixgbevf_ethtool_ops = {
969
+ .supported_coalesce_params = ETHTOOL_COALESCE_USECS,
975970 .get_drvinfo = ixgbevf_get_drvinfo,
976971 .get_regs_len = ixgbevf_get_regs_len,
977972 .get_regs = ixgbevf_get_regs,