| .. | .. |
|---|
| 1 | 1 | // SPDX-License-Identifier: GPL-2.0 |
|---|
| 2 | | -/* Copyright(c) 2013 - 2018 Intel Corporation. */ |
|---|
| 2 | +/* Copyright(c) 2013 - 2019 Intel Corporation. */ |
|---|
| 3 | 3 | |
|---|
| 4 | 4 | #include <linux/vmalloc.h> |
|---|
| 5 | 5 | |
|---|
| .. | .. |
|---|
| 18 | 18 | |
|---|
| 19 | 19 | #define FM10K_STAT_FIELDS(_type, _name, _stat) { \ |
|---|
| 20 | 20 | .stat_string = _name, \ |
|---|
| 21 | | - .sizeof_stat = FIELD_SIZEOF(_type, _stat), \ |
|---|
| 21 | + .sizeof_stat = sizeof_field(_type, _stat), \ |
|---|
| 22 | 22 | .stat_offset = offsetof(_type, _stat) \ |
|---|
| 23 | 23 | } |
|---|
| 24 | 24 | |
|---|
| .. | .. |
|---|
| 222 | 222 | const unsigned int size) |
|---|
| 223 | 223 | { |
|---|
| 224 | 224 | unsigned int i; |
|---|
| 225 | | - char *p; |
|---|
| 226 | 225 | |
|---|
| 227 | 226 | if (!pointer) { |
|---|
| 228 | 227 | /* memory is not zero allocated so we have to clear it */ |
|---|
| .. | .. |
|---|
| 232 | 231 | } |
|---|
| 233 | 232 | |
|---|
| 234 | 233 | for (i = 0; i < size; i++) { |
|---|
| 235 | | - p = (char *)pointer + stats[i].stat_offset; |
|---|
| 234 | + char *p = (char *)pointer + stats[i].stat_offset; |
|---|
| 236 | 235 | |
|---|
| 237 | 236 | switch (stats[i].sizeof_stat) { |
|---|
| 238 | 237 | case sizeof(u64): |
|---|
| .. | .. |
|---|
| 450 | 449 | |
|---|
| 451 | 450 | strncpy(info->driver, fm10k_driver_name, |
|---|
| 452 | 451 | sizeof(info->driver) - 1); |
|---|
| 453 | | - strncpy(info->version, fm10k_driver_version, |
|---|
| 454 | | - sizeof(info->version) - 1); |
|---|
| 455 | 452 | strncpy(info->bus_info, pci_name(interface->pdev), |
|---|
| 456 | 453 | sizeof(info->bus_info) - 1); |
|---|
| 457 | 454 | } |
|---|
| .. | .. |
|---|
| 651 | 648 | struct ethtool_coalesce *ec) |
|---|
| 652 | 649 | { |
|---|
| 653 | 650 | struct fm10k_intfc *interface = netdev_priv(dev); |
|---|
| 654 | | - struct fm10k_q_vector *qv; |
|---|
| 655 | 651 | u16 tx_itr, rx_itr; |
|---|
| 656 | 652 | int i; |
|---|
| 657 | 653 | |
|---|
| .. | .. |
|---|
| 677 | 673 | |
|---|
| 678 | 674 | /* update q_vectors */ |
|---|
| 679 | 675 | 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 | + |
|---|
| 681 | 678 | qv->tx.itr = tx_itr; |
|---|
| 682 | 679 | qv->rx.itr = rx_itr; |
|---|
| 683 | 680 | } |
|---|
| .. | .. |
|---|
| 695 | 692 | case TCP_V4_FLOW: |
|---|
| 696 | 693 | case TCP_V6_FLOW: |
|---|
| 697 | 694 | cmd->data |= RXH_L4_B_0_1 | RXH_L4_B_2_3; |
|---|
| 698 | | - /* fall through */ |
|---|
| 695 | + fallthrough; |
|---|
| 699 | 696 | case UDP_V4_FLOW: |
|---|
| 700 | 697 | if (test_bit(FM10K_FLAG_RSS_FIELD_IPV4_UDP, |
|---|
| 701 | 698 | interface->flags)) |
|---|
| 702 | 699 | cmd->data |= RXH_L4_B_0_1 | RXH_L4_B_2_3; |
|---|
| 703 | | - /* fall through */ |
|---|
| 700 | + fallthrough; |
|---|
| 704 | 701 | case SCTP_V4_FLOW: |
|---|
| 705 | 702 | case SCTP_V6_FLOW: |
|---|
| 706 | 703 | case AH_ESP_V4_FLOW: |
|---|
| .. | .. |
|---|
| 1115 | 1112 | struct ethtool_channels *ch) |
|---|
| 1116 | 1113 | { |
|---|
| 1117 | 1114 | struct fm10k_intfc *interface = netdev_priv(dev); |
|---|
| 1118 | | - struct fm10k_hw *hw = &interface->hw; |
|---|
| 1119 | 1115 | |
|---|
| 1120 | 1116 | /* report maximum channels */ |
|---|
| 1121 | 1117 | ch->max_combined = fm10k_max_channels(dev); |
|---|
| 1122 | 1118 | |
|---|
| 1123 | 1119 | /* report info for other vector */ |
|---|
| 1124 | | - ch->max_other = NON_Q_VECTORS(hw); |
|---|
| 1120 | + ch->max_other = NON_Q_VECTORS; |
|---|
| 1125 | 1121 | ch->other_count = ch->max_other; |
|---|
| 1126 | 1122 | |
|---|
| 1127 | 1123 | /* record RSS queues */ |
|---|
| .. | .. |
|---|
| 1133 | 1129 | { |
|---|
| 1134 | 1130 | struct fm10k_intfc *interface = netdev_priv(dev); |
|---|
| 1135 | 1131 | unsigned int count = ch->combined_count; |
|---|
| 1136 | | - struct fm10k_hw *hw = &interface->hw; |
|---|
| 1137 | 1132 | |
|---|
| 1138 | 1133 | /* verify they are not requesting separate vectors */ |
|---|
| 1139 | 1134 | if (!count || ch->rx_count || ch->tx_count) |
|---|
| 1140 | 1135 | return -EINVAL; |
|---|
| 1141 | 1136 | |
|---|
| 1142 | 1137 | /* verify other_count has not changed */ |
|---|
| 1143 | | - if (ch->other_count != NON_Q_VECTORS(hw)) |
|---|
| 1138 | + if (ch->other_count != NON_Q_VECTORS) |
|---|
| 1144 | 1139 | return -EINVAL; |
|---|
| 1145 | 1140 | |
|---|
| 1146 | 1141 | /* verify the number of channels does not exceed hardware limits */ |
|---|
| .. | .. |
|---|
| 1154 | 1149 | } |
|---|
| 1155 | 1150 | |
|---|
| 1156 | 1151 | static const struct ethtool_ops fm10k_ethtool_ops = { |
|---|
| 1152 | + .supported_coalesce_params = ETHTOOL_COALESCE_USECS | |
|---|
| 1153 | + ETHTOOL_COALESCE_USE_ADAPTIVE, |
|---|
| 1157 | 1154 | .get_strings = fm10k_get_strings, |
|---|
| 1158 | 1155 | .get_sset_count = fm10k_get_sset_count, |
|---|
| 1159 | 1156 | .get_ethtool_stats = fm10k_get_ethtool_stats, |
|---|