hc
2023-12-11 6778948f9de86c3cfaf36725a7c87dcff9ba247f
kernel/drivers/net/ethernet/intel/fm10k/fm10k_ethtool.c
....@@ -1,5 +1,5 @@
11 // SPDX-License-Identifier: GPL-2.0
2
-/* Copyright(c) 2013 - 2018 Intel Corporation. */
2
+/* Copyright(c) 2013 - 2019 Intel Corporation. */
33
44 #include <linux/vmalloc.h>
55
....@@ -18,7 +18,7 @@
1818
1919 #define FM10K_STAT_FIELDS(_type, _name, _stat) { \
2020 .stat_string = _name, \
21
- .sizeof_stat = FIELD_SIZEOF(_type, _stat), \
21
+ .sizeof_stat = sizeof_field(_type, _stat), \
2222 .stat_offset = offsetof(_type, _stat) \
2323 }
2424
....@@ -222,7 +222,6 @@
222222 const unsigned int size)
223223 {
224224 unsigned int i;
225
- char *p;
226225
227226 if (!pointer) {
228227 /* memory is not zero allocated so we have to clear it */
....@@ -232,7 +231,7 @@
232231 }
233232
234233 for (i = 0; i < size; i++) {
235
- p = (char *)pointer + stats[i].stat_offset;
234
+ char *p = (char *)pointer + stats[i].stat_offset;
236235
237236 switch (stats[i].sizeof_stat) {
238237 case sizeof(u64):
....@@ -450,8 +449,6 @@
450449
451450 strncpy(info->driver, fm10k_driver_name,
452451 sizeof(info->driver) - 1);
453
- strncpy(info->version, fm10k_driver_version,
454
- sizeof(info->version) - 1);
455452 strncpy(info->bus_info, pci_name(interface->pdev),
456453 sizeof(info->bus_info) - 1);
457454 }
....@@ -651,7 +648,6 @@
651648 struct ethtool_coalesce *ec)
652649 {
653650 struct fm10k_intfc *interface = netdev_priv(dev);
654
- struct fm10k_q_vector *qv;
655651 u16 tx_itr, rx_itr;
656652 int i;
657653
....@@ -677,7 +673,8 @@
677673
678674 /* update q_vectors */
679675 for (i = 0; i < interface->num_q_vectors; i++) {
680
- qv = interface->q_vector[i];
676
+ struct fm10k_q_vector *qv = interface->q_vector[i];
677
+
681678 qv->tx.itr = tx_itr;
682679 qv->rx.itr = rx_itr;
683680 }
....@@ -695,12 +692,12 @@
695692 case TCP_V4_FLOW:
696693 case TCP_V6_FLOW:
697694 cmd->data |= RXH_L4_B_0_1 | RXH_L4_B_2_3;
698
- /* fall through */
695
+ fallthrough;
699696 case UDP_V4_FLOW:
700697 if (test_bit(FM10K_FLAG_RSS_FIELD_IPV4_UDP,
701698 interface->flags))
702699 cmd->data |= RXH_L4_B_0_1 | RXH_L4_B_2_3;
703
- /* fall through */
700
+ fallthrough;
704701 case SCTP_V4_FLOW:
705702 case SCTP_V6_FLOW:
706703 case AH_ESP_V4_FLOW:
....@@ -1115,13 +1112,12 @@
11151112 struct ethtool_channels *ch)
11161113 {
11171114 struct fm10k_intfc *interface = netdev_priv(dev);
1118
- struct fm10k_hw *hw = &interface->hw;
11191115
11201116 /* report maximum channels */
11211117 ch->max_combined = fm10k_max_channels(dev);
11221118
11231119 /* report info for other vector */
1124
- ch->max_other = NON_Q_VECTORS(hw);
1120
+ ch->max_other = NON_Q_VECTORS;
11251121 ch->other_count = ch->max_other;
11261122
11271123 /* record RSS queues */
....@@ -1133,14 +1129,13 @@
11331129 {
11341130 struct fm10k_intfc *interface = netdev_priv(dev);
11351131 unsigned int count = ch->combined_count;
1136
- struct fm10k_hw *hw = &interface->hw;
11371132
11381133 /* verify they are not requesting separate vectors */
11391134 if (!count || ch->rx_count || ch->tx_count)
11401135 return -EINVAL;
11411136
11421137 /* verify other_count has not changed */
1143
- if (ch->other_count != NON_Q_VECTORS(hw))
1138
+ if (ch->other_count != NON_Q_VECTORS)
11441139 return -EINVAL;
11451140
11461141 /* verify the number of channels does not exceed hardware limits */
....@@ -1154,6 +1149,8 @@
11541149 }
11551150
11561151 static const struct ethtool_ops fm10k_ethtool_ops = {
1152
+ .supported_coalesce_params = ETHTOOL_COALESCE_USECS |
1153
+ ETHTOOL_COALESCE_USE_ADAPTIVE,
11571154 .get_strings = fm10k_get_strings,
11581155 .get_sset_count = fm10k_get_sset_count,
11591156 .get_ethtool_stats = fm10k_get_ethtool_stats,