aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/intel
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/ethernet/intel')
-rw-r--r--drivers/net/ethernet/intel/fm10k/fm10k_main.c14
-rw-r--r--drivers/net/ethernet/intel/ixgbe/ixgbe.h1
-rw-r--r--drivers/net/ethernet/intel/ixgbe/ixgbe_82598.c3
-rw-r--r--drivers/net/ethernet/intel/ixgbe/ixgbe_82599.c11
-rw-r--r--drivers/net/ethernet/intel/ixgbe/ixgbe_common.c9
-rw-r--r--drivers/net/ethernet/intel/ixgbe/ixgbe_dcb.c10
-rw-r--r--drivers/net/ethernet/intel/ixgbe/ixgbe_dcb_82598.c22
-rw-r--r--drivers/net/ethernet/intel/ixgbe/ixgbe_dcb_82599.c5
-rw-r--r--drivers/net/ethernet/intel/ixgbe/ixgbe_dcb_nl.c2
-rw-r--r--drivers/net/ethernet/intel/ixgbe/ixgbe_debugfs.c2
-rw-r--r--drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c6
-rw-r--r--drivers/net/ethernet/intel/ixgbe/ixgbe_fcoe.c3
-rw-r--r--drivers/net/ethernet/intel/ixgbe/ixgbe_lib.c61
-rw-r--r--drivers/net/ethernet/intel/ixgbe/ixgbe_main.c299
-rw-r--r--drivers/net/ethernet/intel/ixgbe/ixgbe_phy.c15
-rw-r--r--drivers/net/ethernet/intel/ixgbe/ixgbe_ptp.c8
-rw-r--r--drivers/net/ethernet/intel/ixgbe/ixgbe_sriov.c15
-rw-r--r--drivers/net/ethernet/intel/ixgbe/ixgbe_x550.c19
-rw-r--r--drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c6
-rw-r--r--drivers/net/ethernet/intel/ixgbevf/vf.c17
20 files changed, 272 insertions, 256 deletions
diff --git a/drivers/net/ethernet/intel/fm10k/fm10k_main.c b/drivers/net/ethernet/intel/fm10k/fm10k_main.c
index 538b42d5c187..8e12aae065d8 100644
--- a/drivers/net/ethernet/intel/fm10k/fm10k_main.c
+++ b/drivers/net/ethernet/intel/fm10k/fm10k_main.c
@@ -446,13 +446,13 @@ static void fm10k_type_trans(struct fm10k_ring *rx_ring,
446 446
447 skb->protocol = eth_type_trans(skb, dev); 447 skb->protocol = eth_type_trans(skb, dev);
448 448
449 /* Record Rx queue, or update macvlan statistics */
449 if (!l2_accel) 450 if (!l2_accel)
450 return; 451 skb_record_rx_queue(skb, rx_ring->queue_index);
451 452 else
452 /* update MACVLAN statistics */ 453 macvlan_count_rx(netdev_priv(dev), skb->len + ETH_HLEN, true,
453 macvlan_count_rx(netdev_priv(dev), skb->len + ETH_HLEN, 1, 454 (skb->pkt_type == PACKET_BROADCAST) ||
454 !!(rx_desc->w.hdr_info & 455 (skb->pkt_type == PACKET_MULTICAST));
455 cpu_to_le16(FM10K_RXD_HDR_INFO_XC_MASK)));
456} 456}
457 457
458/** 458/**
@@ -479,8 +479,6 @@ static unsigned int fm10k_process_skb_fields(struct fm10k_ring *rx_ring,
479 479
480 FM10K_CB(skb)->fi.w.vlan = rx_desc->w.vlan; 480 FM10K_CB(skb)->fi.w.vlan = rx_desc->w.vlan;
481 481
482 skb_record_rx_queue(skb, rx_ring->queue_index);
483
484 FM10K_CB(skb)->fi.d.glort = rx_desc->d.glort; 482 FM10K_CB(skb)->fi.d.glort = rx_desc->d.glort;
485 483
486 if (rx_desc->w.vlan) { 484 if (rx_desc->w.vlan) {
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe.h b/drivers/net/ethernet/intel/ixgbe/ixgbe.h
index 03a4df0bed96..49ab0c7a9cd5 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe.h
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe.h
@@ -674,6 +674,7 @@ struct ixgbe_adapter {
674 struct ieee_ets *ixgbe_ieee_ets; 674 struct ieee_ets *ixgbe_ieee_ets;
675 struct ixgbe_dcb_config dcb_cfg; 675 struct ixgbe_dcb_config dcb_cfg;
676 struct ixgbe_dcb_config temp_dcb_cfg; 676 struct ixgbe_dcb_config temp_dcb_cfg;
677 u8 hw_tcs;
677 u8 dcb_set_bitmap; 678 u8 dcb_set_bitmap;
678 u8 dcbx_cap; 679 u8 dcbx_cap;
679 enum ixgbe_fc_mode last_lfc_mode; 680 enum ixgbe_fc_mode last_lfc_mode;
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_82598.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_82598.c
index 8a32eb7d47b9..a0ebd9ecf243 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_82598.c
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_82598.c
@@ -431,6 +431,7 @@ static s32 ixgbe_fc_enable_82598(struct ixgbe_hw *hw)
431/** 431/**
432 * ixgbe_start_mac_link_82598 - Configures MAC link settings 432 * ixgbe_start_mac_link_82598 - Configures MAC link settings
433 * @hw: pointer to hardware structure 433 * @hw: pointer to hardware structure
434 * @autoneg_wait_to_complete: true when waiting for completion is needed
434 * 435 *
435 * Configures link settings based on values in the ixgbe_hw struct. 436 * Configures link settings based on values in the ixgbe_hw struct.
436 * Restarts the link. Performs autonegotiation if needed. 437 * Restarts the link. Performs autonegotiation if needed.
@@ -1054,7 +1055,7 @@ static s32 ixgbe_read_i2c_eeprom_82598(struct ixgbe_hw *hw, u8 byte_offset,
1054 * ixgbe_read_i2c_sff8472_82598 - Reads 8 bit word over I2C interface. 1055 * ixgbe_read_i2c_sff8472_82598 - Reads 8 bit word over I2C interface.
1055 * @hw: pointer to hardware structure 1056 * @hw: pointer to hardware structure
1056 * @byte_offset: byte offset at address 0xA2 1057 * @byte_offset: byte offset at address 0xA2
1057 * @eeprom_data: value read 1058 * @sff8472_data: value read
1058 * 1059 *
1059 * Performs 8 byte read operation to SFP module's SFF-8472 data over I2C 1060 * Performs 8 byte read operation to SFP module's SFF-8472 data over I2C
1060 **/ 1061 **/
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_82599.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_82599.c
index d602637ccc40..4dfc81dbee4b 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_82599.c
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_82599.c
@@ -221,7 +221,7 @@ static s32 prot_autoc_read_82599(struct ixgbe_hw *hw, bool *locked,
221/** 221/**
222 * prot_autoc_write_82599 - Hides MAC differences needed for AUTOC write 222 * prot_autoc_write_82599 - Hides MAC differences needed for AUTOC write
223 * @hw: pointer to hardware structure 223 * @hw: pointer to hardware structure
224 * @reg_val: value to write to AUTOC 224 * @autoc: value to write to AUTOC
225 * @locked: bool to indicate whether the SW/FW lock was already taken by 225 * @locked: bool to indicate whether the SW/FW lock was already taken by
226 * previous proc_autoc_read_82599. 226 * previous proc_autoc_read_82599.
227 * 227 *
@@ -1310,10 +1310,11 @@ do { \
1310 1310
1311/** 1311/**
1312 * ixgbe_atr_compute_sig_hash_82599 - Compute the signature hash 1312 * ixgbe_atr_compute_sig_hash_82599 - Compute the signature hash
1313 * @stream: input bitstream to compute the hash on 1313 * @input: input bitstream to compute the hash on
1314 * @common: compressed common input dword
1314 * 1315 *
1315 * This function is almost identical to the function above but contains 1316 * This function is almost identical to the function above but contains
1316 * several optomizations such as unwinding all of the loops, letting the 1317 * several optimizations such as unwinding all of the loops, letting the
1317 * compiler work out all of the conditional ifs since the keys are static 1318 * compiler work out all of the conditional ifs since the keys are static
1318 * defines, and computing two keys at once since the hashed dword stream 1319 * defines, and computing two keys at once since the hashed dword stream
1319 * will be the same for both keys. 1320 * will be the same for both keys.
@@ -1446,7 +1447,7 @@ do { \
1446 1447
1447/** 1448/**
1448 * ixgbe_atr_compute_perfect_hash_82599 - Compute the perfect filter hash 1449 * ixgbe_atr_compute_perfect_hash_82599 - Compute the perfect filter hash
1449 * @atr_input: input bitstream to compute the hash on 1450 * @input: input bitstream to compute the hash on
1450 * @input_mask: mask for the input bitstream 1451 * @input_mask: mask for the input bitstream
1451 * 1452 *
1452 * This function serves two main purposes. First it applies the input_mask 1453 * This function serves two main purposes. First it applies the input_mask
@@ -2078,6 +2079,7 @@ reset_pipeline_out:
2078 * ixgbe_read_i2c_byte_82599 - Reads 8 bit word over I2C 2079 * ixgbe_read_i2c_byte_82599 - Reads 8 bit word over I2C
2079 * @hw: pointer to hardware structure 2080 * @hw: pointer to hardware structure
2080 * @byte_offset: byte offset to read 2081 * @byte_offset: byte offset to read
2082 * @dev_addr: address to read from
2081 * @data: value read 2083 * @data: value read
2082 * 2084 *
2083 * Performs byte read operation to SFP module's EEPROM over I2C interface at 2085 * Performs byte read operation to SFP module's EEPROM over I2C interface at
@@ -2131,6 +2133,7 @@ release_i2c_access:
2131 * ixgbe_write_i2c_byte_82599 - Writes 8 bit word over I2C 2133 * ixgbe_write_i2c_byte_82599 - Writes 8 bit word over I2C
2132 * @hw: pointer to hardware structure 2134 * @hw: pointer to hardware structure
2133 * @byte_offset: byte offset to write 2135 * @byte_offset: byte offset to write
2136 * @dev_addr: address to write to
2134 * @data: value to write 2137 * @data: value to write
2135 * 2138 *
2136 * Performs byte write operation to SFP module's EEPROM over I2C interface at 2139 * Performs byte write operation to SFP module's EEPROM over I2C interface at
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_common.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_common.c
index 1948e4208fb4..7ac7ef9b37ff 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_common.c
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_common.c
@@ -1613,6 +1613,7 @@ static void ixgbe_shift_out_eeprom_bits(struct ixgbe_hw *hw, u16 data,
1613/** 1613/**
1614 * ixgbe_shift_in_eeprom_bits - Shift data bits in from the EEPROM 1614 * ixgbe_shift_in_eeprom_bits - Shift data bits in from the EEPROM
1615 * @hw: pointer to hardware structure 1615 * @hw: pointer to hardware structure
1616 * @count: number of bits to shift
1616 **/ 1617 **/
1617static u16 ixgbe_shift_in_eeprom_bits(struct ixgbe_hw *hw, u16 count) 1618static u16 ixgbe_shift_in_eeprom_bits(struct ixgbe_hw *hw, u16 count)
1618{ 1619{
@@ -1667,7 +1668,7 @@ static void ixgbe_raise_eeprom_clk(struct ixgbe_hw *hw, u32 *eec)
1667/** 1668/**
1668 * ixgbe_lower_eeprom_clk - Lowers the EEPROM's clock input. 1669 * ixgbe_lower_eeprom_clk - Lowers the EEPROM's clock input.
1669 * @hw: pointer to hardware structure 1670 * @hw: pointer to hardware structure
1670 * @eecd: EECD's current value 1671 * @eec: EEC's current value
1671 **/ 1672 **/
1672static void ixgbe_lower_eeprom_clk(struct ixgbe_hw *hw, u32 *eec) 1673static void ixgbe_lower_eeprom_clk(struct ixgbe_hw *hw, u32 *eec)
1673{ 1674{
@@ -2037,7 +2038,7 @@ static s32 ixgbe_mta_vector(struct ixgbe_hw *hw, u8 *mc_addr)
2037/** 2038/**
2038 * ixgbe_set_mta - Set bit-vector in multicast table 2039 * ixgbe_set_mta - Set bit-vector in multicast table
2039 * @hw: pointer to hardware structure 2040 * @hw: pointer to hardware structure
2040 * @hash_value: Multicast address hash value 2041 * @mc_addr: Multicast address
2041 * 2042 *
2042 * Sets the bit-vector in the multicast table. 2043 * Sets the bit-vector in the multicast table.
2043 **/ 2044 **/
@@ -3086,6 +3087,8 @@ s32 ixgbe_init_uta_tables_generic(struct ixgbe_hw *hw)
3086 * ixgbe_find_vlvf_slot - find the vlanid or the first empty slot 3087 * ixgbe_find_vlvf_slot - find the vlanid or the first empty slot
3087 * @hw: pointer to hardware structure 3088 * @hw: pointer to hardware structure
3088 * @vlan: VLAN id to write to VLAN filter 3089 * @vlan: VLAN id to write to VLAN filter
3090 * @vlvf_bypass: true to find vlanid only, false returns first empty slot if
3091 * vlanid not found
3089 * 3092 *
3090 * return the VLVF index where this VLAN id should be placed 3093 * return the VLVF index where this VLAN id should be placed
3091 * 3094 *
@@ -3476,7 +3479,7 @@ void ixgbe_set_mac_anti_spoofing(struct ixgbe_hw *hw, bool enable, int vf)
3476 * ixgbe_set_vlan_anti_spoofing - Enable/Disable VLAN anti-spoofing 3479 * ixgbe_set_vlan_anti_spoofing - Enable/Disable VLAN anti-spoofing
3477 * @hw: pointer to hardware structure 3480 * @hw: pointer to hardware structure
3478 * @enable: enable or disable switch for VLAN anti-spoofing 3481 * @enable: enable or disable switch for VLAN anti-spoofing
3479 * @pf: Virtual Function pool - VF Pool to set for VLAN anti-spoofing 3482 * @vf: Virtual Function pool - VF Pool to set for VLAN anti-spoofing
3480 * 3483 *
3481 **/ 3484 **/
3482void ixgbe_set_vlan_anti_spoofing(struct ixgbe_hw *hw, bool enable, int vf) 3485void ixgbe_set_vlan_anti_spoofing(struct ixgbe_hw *hw, bool enable, int vf)
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_dcb.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_dcb.c
index 072ef3b5fc61..aaea8282bfd2 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_dcb.c
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_dcb.c
@@ -39,6 +39,10 @@
39 * are the smallest unit programmable into the underlying 39 * are the smallest unit programmable into the underlying
40 * hardware. The IEEE 802.1Qaz specification do not use bandwidth 40 * hardware. The IEEE 802.1Qaz specification do not use bandwidth
41 * groups so this is much simplified from the CEE case. 41 * groups so this is much simplified from the CEE case.
42 * @bw: bandwidth index by traffic class
43 * @refill: refill credits index by traffic class
44 * @max: max credits by traffic class
45 * @max_frame: maximum frame size
42 */ 46 */
43static s32 ixgbe_ieee_credits(__u8 *bw, __u16 *refill, 47static s32 ixgbe_ieee_credits(__u8 *bw, __u16 *refill,
44 __u16 *max, int max_frame) 48 __u16 *max, int max_frame)
@@ -72,8 +76,10 @@ static s32 ixgbe_ieee_credits(__u8 *bw, __u16 *refill,
72 76
73/** 77/**
74 * ixgbe_dcb_calculate_tc_credits - Calculates traffic class credits 78 * ixgbe_dcb_calculate_tc_credits - Calculates traffic class credits
75 * @ixgbe_dcb_config: Struct containing DCB settings. 79 * @hw: pointer to hardware structure
76 * @direction: Configuring either Tx or Rx. 80 * @dcb_config: Struct containing DCB settings
81 * @max_frame: Maximum frame size
82 * @direction: Configuring either Tx or Rx
77 * 83 *
78 * This function calculates the credits allocated to each traffic class. 84 * This function calculates the credits allocated to each traffic class.
79 * It should be called only after the rules are checked by 85 * It should be called only after the rules are checked by
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_dcb_82598.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_dcb_82598.c
index b79e93a5b699..f94c7e82a30b 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_dcb_82598.c
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_dcb_82598.c
@@ -34,7 +34,9 @@
34/** 34/**
35 * ixgbe_dcb_config_rx_arbiter_82598 - Config Rx data arbiter 35 * ixgbe_dcb_config_rx_arbiter_82598 - Config Rx data arbiter
36 * @hw: pointer to hardware structure 36 * @hw: pointer to hardware structure
37 * @dcb_config: pointer to ixgbe_dcb_config structure 37 * @refill: refill credits index by traffic class
38 * @max: max credits index by traffic class
39 * @prio_type: priority type indexed by traffic class
38 * 40 *
39 * Configure Rx Data Arbiter and credits for each traffic class. 41 * Configure Rx Data Arbiter and credits for each traffic class.
40 */ 42 */
@@ -91,7 +93,10 @@ s32 ixgbe_dcb_config_rx_arbiter_82598(struct ixgbe_hw *hw,
91/** 93/**
92 * ixgbe_dcb_config_tx_desc_arbiter_82598 - Config Tx Desc. arbiter 94 * ixgbe_dcb_config_tx_desc_arbiter_82598 - Config Tx Desc. arbiter
93 * @hw: pointer to hardware structure 95 * @hw: pointer to hardware structure
94 * @dcb_config: pointer to ixgbe_dcb_config structure 96 * @refill: refill credits index by traffic class
97 * @max: max credits index by traffic class
98 * @bwg_id: bandwidth grouping indexed by traffic class
99 * @prio_type: priority type indexed by traffic class
95 * 100 *
96 * Configure Tx Descriptor Arbiter and credits for each traffic class. 101 * Configure Tx Descriptor Arbiter and credits for each traffic class.
97 */ 102 */
@@ -137,7 +142,10 @@ s32 ixgbe_dcb_config_tx_desc_arbiter_82598(struct ixgbe_hw *hw,
137/** 142/**
138 * ixgbe_dcb_config_tx_data_arbiter_82598 - Config Tx data arbiter 143 * ixgbe_dcb_config_tx_data_arbiter_82598 - Config Tx data arbiter
139 * @hw: pointer to hardware structure 144 * @hw: pointer to hardware structure
140 * @dcb_config: pointer to ixgbe_dcb_config structure 145 * @refill: refill credits index by traffic class
146 * @max: max credits index by traffic class
147 * @bwg_id: bandwidth grouping indexed by traffic class
148 * @prio_type: priority type indexed by traffic class
141 * 149 *
142 * Configure Tx Data Arbiter and credits for each traffic class. 150 * Configure Tx Data Arbiter and credits for each traffic class.
143 */ 151 */
@@ -184,7 +192,7 @@ s32 ixgbe_dcb_config_tx_data_arbiter_82598(struct ixgbe_hw *hw,
184/** 192/**
185 * ixgbe_dcb_config_pfc_82598 - Config priority flow control 193 * ixgbe_dcb_config_pfc_82598 - Config priority flow control
186 * @hw: pointer to hardware structure 194 * @hw: pointer to hardware structure
187 * @dcb_config: pointer to ixgbe_dcb_config structure 195 * @pfc_en: enabled pfc bitmask
188 * 196 *
189 * Configure Priority Flow Control for each traffic class. 197 * Configure Priority Flow Control for each traffic class.
190 */ 198 */
@@ -269,7 +277,11 @@ static s32 ixgbe_dcb_config_tc_stats_82598(struct ixgbe_hw *hw)
269/** 277/**
270 * ixgbe_dcb_hw_config_82598 - Config and enable DCB 278 * ixgbe_dcb_hw_config_82598 - Config and enable DCB
271 * @hw: pointer to hardware structure 279 * @hw: pointer to hardware structure
272 * @dcb_config: pointer to ixgbe_dcb_config structure 280 * @pfc_en: enabled pfc bitmask
281 * @refill: refill credits index by traffic class
282 * @max: max credits index by traffic class
283 * @bwg_id: bandwidth grouping indexed by traffic class
284 * @prio_type: priority type indexed by traffic class
273 * 285 *
274 * Configure dcb settings and enable dcb mode. 286 * Configure dcb settings and enable dcb mode.
275 */ 287 */
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_dcb_82599.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_dcb_82599.c
index 1011d644978f..1eed6811e914 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_dcb_82599.c
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_dcb_82599.c
@@ -38,6 +38,7 @@
38 * @max: max credits index by traffic class 38 * @max: max credits index by traffic class
39 * @bwg_id: bandwidth grouping indexed by traffic class 39 * @bwg_id: bandwidth grouping indexed by traffic class
40 * @prio_type: priority type indexed by traffic class 40 * @prio_type: priority type indexed by traffic class
41 * @prio_tc: priority to tc assignments indexed by priority
41 * 42 *
42 * Configure Rx Packet Arbiter and credits for each traffic class. 43 * Configure Rx Packet Arbiter and credits for each traffic class.
43 */ 44 */
@@ -148,6 +149,7 @@ s32 ixgbe_dcb_config_tx_desc_arbiter_82599(struct ixgbe_hw *hw,
148 * @max: max credits index by traffic class 149 * @max: max credits index by traffic class
149 * @bwg_id: bandwidth grouping indexed by traffic class 150 * @bwg_id: bandwidth grouping indexed by traffic class
150 * @prio_type: priority type indexed by traffic class 151 * @prio_type: priority type indexed by traffic class
152 * @prio_tc: priority to tc assignments indexed by priority
151 * 153 *
152 * Configure Tx Packet Arbiter and credits for each traffic class. 154 * Configure Tx Packet Arbiter and credits for each traffic class.
153 */ 155 */
@@ -344,11 +346,12 @@ static s32 ixgbe_dcb_config_tc_stats_82599(struct ixgbe_hw *hw)
344/** 346/**
345 * ixgbe_dcb_hw_config_82599 - Configure and enable DCB 347 * ixgbe_dcb_hw_config_82599 - Configure and enable DCB
346 * @hw: pointer to hardware structure 348 * @hw: pointer to hardware structure
349 * @pfc_en: enabled pfc bitmask
347 * @refill: refill credits index by traffic class 350 * @refill: refill credits index by traffic class
348 * @max: max credits index by traffic class 351 * @max: max credits index by traffic class
349 * @bwg_id: bandwidth grouping indexed by traffic class 352 * @bwg_id: bandwidth grouping indexed by traffic class
350 * @prio_type: priority type indexed by traffic class 353 * @prio_type: priority type indexed by traffic class
351 * @pfc_en: enabled pfc bitmask 354 * @prio_tc: priority to tc assignments indexed by priority
352 * 355 *
353 * Configure dcb settings and enable dcb mode. 356 * Configure dcb settings and enable dcb mode.
354 */ 357 */
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_dcb_nl.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_dcb_nl.c
index 78c52375acc6..b33f3f87e4b1 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_dcb_nl.c
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_dcb_nl.c
@@ -571,7 +571,7 @@ static int ixgbe_dcbnl_ieee_setets(struct net_device *dev,
571 if (max_tc > adapter->dcb_cfg.num_tcs.pg_tcs) 571 if (max_tc > adapter->dcb_cfg.num_tcs.pg_tcs)
572 return -EINVAL; 572 return -EINVAL;
573 573
574 if (max_tc != netdev_get_num_tc(dev)) { 574 if (max_tc != adapter->hw_tcs) {
575 err = ixgbe_setup_tc(dev, max_tc); 575 err = ixgbe_setup_tc(dev, max_tc);
576 if (err) 576 if (err)
577 return err; 577 return err;
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_debugfs.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_debugfs.c
index 5e2c1e35e517..ad54080488ee 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_debugfs.c
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_debugfs.c
@@ -249,7 +249,7 @@ void ixgbe_dbg_adapter_init(struct ixgbe_adapter *adapter)
249 249
250/** 250/**
251 * ixgbe_dbg_adapter_exit - clear out the adapter's debugfs entries 251 * ixgbe_dbg_adapter_exit - clear out the adapter's debugfs entries
252 * @pf: the pf that is stopping 252 * @adapter: the adapter that is exiting
253 **/ 253 **/
254void ixgbe_dbg_adapter_exit(struct ixgbe_adapter *adapter) 254void ixgbe_dbg_adapter_exit(struct ixgbe_adapter *adapter)
255{ 255{
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c
index 3bcf58b27d8b..f064099733b6 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c
@@ -3117,7 +3117,7 @@ static int ixgbe_get_ts_info(struct net_device *dev,
3117static unsigned int ixgbe_max_channels(struct ixgbe_adapter *adapter) 3117static unsigned int ixgbe_max_channels(struct ixgbe_adapter *adapter)
3118{ 3118{
3119 unsigned int max_combined; 3119 unsigned int max_combined;
3120 u8 tcs = netdev_get_num_tc(adapter->netdev); 3120 u8 tcs = adapter->hw_tcs;
3121 3121
3122 if (!(adapter->flags & IXGBE_FLAG_MSIX_ENABLED)) { 3122 if (!(adapter->flags & IXGBE_FLAG_MSIX_ENABLED)) {
3123 /* We only support one q_vector without MSI-X */ 3123 /* We only support one q_vector without MSI-X */
@@ -3174,7 +3174,7 @@ static void ixgbe_get_channels(struct net_device *dev,
3174 return; 3174 return;
3175 3175
3176 /* same thing goes for being DCB enabled */ 3176 /* same thing goes for being DCB enabled */
3177 if (netdev_get_num_tc(dev) > 1) 3177 if (adapter->hw_tcs > 1)
3178 return; 3178 return;
3179 3179
3180 /* if ATR is disabled we can exit */ 3180 /* if ATR is disabled we can exit */
@@ -3220,7 +3220,7 @@ static int ixgbe_set_channels(struct net_device *dev,
3220 3220
3221#endif 3221#endif
3222 /* use setup TC to update any traffic class queue mapping */ 3222 /* use setup TC to update any traffic class queue mapping */
3223 return ixgbe_setup_tc(dev, netdev_get_num_tc(dev)); 3223 return ixgbe_setup_tc(dev, adapter->hw_tcs);
3224} 3224}
3225 3225
3226static int ixgbe_get_module_info(struct net_device *dev, 3226static int ixgbe_get_module_info(struct net_device *dev,
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_fcoe.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_fcoe.c
index 6e6b3c175267..7a09a40e4472 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_fcoe.c
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_fcoe.c
@@ -150,6 +150,7 @@ skip_ddpinv:
150 * @xid: the exchange id requesting ddp 150 * @xid: the exchange id requesting ddp
151 * @sgl: the scatter-gather list for this request 151 * @sgl: the scatter-gather list for this request
152 * @sgc: the number of scatter-gather items 152 * @sgc: the number of scatter-gather items
153 * @target_mode: 1 to setup target mode, 0 to setup initiator mode
153 * 154 *
154 * Returns : 1 for success and 0 for no ddp 155 * Returns : 1 for success and 0 for no ddp
155 */ 156 */
@@ -1063,7 +1064,7 @@ int ixgbe_fcoe_get_hbainfo(struct net_device *netdev,
1063 1064
1064/** 1065/**
1065 * ixgbe_fcoe_get_tc - get the current TC that fcoe is mapped to 1066 * ixgbe_fcoe_get_tc - get the current TC that fcoe is mapped to
1066 * @adapter - pointer to the device adapter structure 1067 * @adapter: pointer to the device adapter structure
1067 * 1068 *
1068 * Return : TC that FCoE is mapped to 1069 * Return : TC that FCoE is mapped to
1069 */ 1070 */
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_lib.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_lib.c
index cceafbc3f1db..b3c282d09b18 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_lib.c
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_lib.c
@@ -46,8 +46,8 @@ static bool ixgbe_cache_ring_dcb_sriov(struct ixgbe_adapter *adapter)
46#endif /* IXGBE_FCOE */ 46#endif /* IXGBE_FCOE */
47 struct ixgbe_ring_feature *vmdq = &adapter->ring_feature[RING_F_VMDQ]; 47 struct ixgbe_ring_feature *vmdq = &adapter->ring_feature[RING_F_VMDQ];
48 int i; 48 int i;
49 u16 reg_idx; 49 u16 reg_idx, pool;
50 u8 tcs = netdev_get_num_tc(adapter->netdev); 50 u8 tcs = adapter->hw_tcs;
51 51
52 /* verify we have DCB queueing enabled before proceeding */ 52 /* verify we have DCB queueing enabled before proceeding */
53 if (tcs <= 1) 53 if (tcs <= 1)
@@ -58,12 +58,16 @@ static bool ixgbe_cache_ring_dcb_sriov(struct ixgbe_adapter *adapter)
58 return false; 58 return false;
59 59
60 /* start at VMDq register offset for SR-IOV enabled setups */ 60 /* start at VMDq register offset for SR-IOV enabled setups */
61 pool = 0;
61 reg_idx = vmdq->offset * __ALIGN_MASK(1, ~vmdq->mask); 62 reg_idx = vmdq->offset * __ALIGN_MASK(1, ~vmdq->mask);
62 for (i = 0; i < adapter->num_rx_queues; i++, reg_idx++) { 63 for (i = 0, pool = 0; i < adapter->num_rx_queues; i++, reg_idx++) {
63 /* If we are greater than indices move to next pool */ 64 /* If we are greater than indices move to next pool */
64 if ((reg_idx & ~vmdq->mask) >= tcs) 65 if ((reg_idx & ~vmdq->mask) >= tcs) {
66 pool++;
65 reg_idx = __ALIGN_MASK(reg_idx, ~vmdq->mask); 67 reg_idx = __ALIGN_MASK(reg_idx, ~vmdq->mask);
68 }
66 adapter->rx_ring[i]->reg_idx = reg_idx; 69 adapter->rx_ring[i]->reg_idx = reg_idx;
70 adapter->rx_ring[i]->netdev = pool ? NULL : adapter->netdev;
67 } 71 }
68 72
69 reg_idx = vmdq->offset * __ALIGN_MASK(1, ~vmdq->mask); 73 reg_idx = vmdq->offset * __ALIGN_MASK(1, ~vmdq->mask);
@@ -92,6 +96,7 @@ static bool ixgbe_cache_ring_dcb_sriov(struct ixgbe_adapter *adapter)
92 for (i = fcoe->offset; i < adapter->num_rx_queues; i++) { 96 for (i = fcoe->offset; i < adapter->num_rx_queues; i++) {
93 reg_idx = __ALIGN_MASK(reg_idx, ~vmdq->mask) + fcoe_tc; 97 reg_idx = __ALIGN_MASK(reg_idx, ~vmdq->mask) + fcoe_tc;
94 adapter->rx_ring[i]->reg_idx = reg_idx; 98 adapter->rx_ring[i]->reg_idx = reg_idx;
99 adapter->rx_ring[i]->netdev = adapter->netdev;
95 reg_idx++; 100 reg_idx++;
96 } 101 }
97 102
@@ -111,9 +116,8 @@ static bool ixgbe_cache_ring_dcb_sriov(struct ixgbe_adapter *adapter)
111static void ixgbe_get_first_reg_idx(struct ixgbe_adapter *adapter, u8 tc, 116static void ixgbe_get_first_reg_idx(struct ixgbe_adapter *adapter, u8 tc,
112 unsigned int *tx, unsigned int *rx) 117 unsigned int *tx, unsigned int *rx)
113{ 118{
114 struct net_device *dev = adapter->netdev;
115 struct ixgbe_hw *hw = &adapter->hw; 119 struct ixgbe_hw *hw = &adapter->hw;
116 u8 num_tcs = netdev_get_num_tc(dev); 120 u8 num_tcs = adapter->hw_tcs;
117 121
118 *tx = 0; 122 *tx = 0;
119 *rx = 0; 123 *rx = 0;
@@ -168,10 +172,9 @@ static void ixgbe_get_first_reg_idx(struct ixgbe_adapter *adapter, u8 tc,
168 **/ 172 **/
169static bool ixgbe_cache_ring_dcb(struct ixgbe_adapter *adapter) 173static bool ixgbe_cache_ring_dcb(struct ixgbe_adapter *adapter)
170{ 174{
171 struct net_device *dev = adapter->netdev; 175 u8 num_tcs = adapter->hw_tcs;
172 unsigned int tx_idx, rx_idx; 176 unsigned int tx_idx, rx_idx;
173 int tc, offset, rss_i, i; 177 int tc, offset, rss_i, i;
174 u8 num_tcs = netdev_get_num_tc(dev);
175 178
176 /* verify we have DCB queueing enabled before proceeding */ 179 /* verify we have DCB queueing enabled before proceeding */
177 if (num_tcs <= 1) 180 if (num_tcs <= 1)
@@ -184,6 +187,7 @@ static bool ixgbe_cache_ring_dcb(struct ixgbe_adapter *adapter)
184 for (i = 0; i < rss_i; i++, tx_idx++, rx_idx++) { 187 for (i = 0; i < rss_i; i++, tx_idx++, rx_idx++) {
185 adapter->tx_ring[offset + i]->reg_idx = tx_idx; 188 adapter->tx_ring[offset + i]->reg_idx = tx_idx;
186 adapter->rx_ring[offset + i]->reg_idx = rx_idx; 189 adapter->rx_ring[offset + i]->reg_idx = rx_idx;
190 adapter->rx_ring[offset + i]->netdev = adapter->netdev;
187 adapter->tx_ring[offset + i]->dcb_tc = tc; 191 adapter->tx_ring[offset + i]->dcb_tc = tc;
188 adapter->rx_ring[offset + i]->dcb_tc = tc; 192 adapter->rx_ring[offset + i]->dcb_tc = tc;
189 } 193 }
@@ -208,14 +212,15 @@ static bool ixgbe_cache_ring_sriov(struct ixgbe_adapter *adapter)
208#endif /* IXGBE_FCOE */ 212#endif /* IXGBE_FCOE */
209 struct ixgbe_ring_feature *vmdq = &adapter->ring_feature[RING_F_VMDQ]; 213 struct ixgbe_ring_feature *vmdq = &adapter->ring_feature[RING_F_VMDQ];
210 struct ixgbe_ring_feature *rss = &adapter->ring_feature[RING_F_RSS]; 214 struct ixgbe_ring_feature *rss = &adapter->ring_feature[RING_F_RSS];
215 u16 reg_idx, pool;
211 int i; 216 int i;
212 u16 reg_idx;
213 217
214 /* only proceed if VMDq is enabled */ 218 /* only proceed if VMDq is enabled */
215 if (!(adapter->flags & IXGBE_FLAG_VMDQ_ENABLED)) 219 if (!(adapter->flags & IXGBE_FLAG_VMDQ_ENABLED))
216 return false; 220 return false;
217 221
218 /* start at VMDq register offset for SR-IOV enabled setups */ 222 /* start at VMDq register offset for SR-IOV enabled setups */
223 pool = 0;
219 reg_idx = vmdq->offset * __ALIGN_MASK(1, ~vmdq->mask); 224 reg_idx = vmdq->offset * __ALIGN_MASK(1, ~vmdq->mask);
220 for (i = 0; i < adapter->num_rx_queues; i++, reg_idx++) { 225 for (i = 0; i < adapter->num_rx_queues; i++, reg_idx++) {
221#ifdef IXGBE_FCOE 226#ifdef IXGBE_FCOE
@@ -224,15 +229,20 @@ static bool ixgbe_cache_ring_sriov(struct ixgbe_adapter *adapter)
224 break; 229 break;
225#endif 230#endif
226 /* If we are greater than indices move to next pool */ 231 /* If we are greater than indices move to next pool */
227 if ((reg_idx & ~vmdq->mask) >= rss->indices) 232 if ((reg_idx & ~vmdq->mask) >= rss->indices) {
233 pool++;
228 reg_idx = __ALIGN_MASK(reg_idx, ~vmdq->mask); 234 reg_idx = __ALIGN_MASK(reg_idx, ~vmdq->mask);
235 }
229 adapter->rx_ring[i]->reg_idx = reg_idx; 236 adapter->rx_ring[i]->reg_idx = reg_idx;
237 adapter->rx_ring[i]->netdev = pool ? NULL : adapter->netdev;
230 } 238 }
231 239
232#ifdef IXGBE_FCOE 240#ifdef IXGBE_FCOE
233 /* FCoE uses a linear block of queues so just assigning 1:1 */ 241 /* FCoE uses a linear block of queues so just assigning 1:1 */
234 for (; i < adapter->num_rx_queues; i++, reg_idx++) 242 for (; i < adapter->num_rx_queues; i++, reg_idx++) {
235 adapter->rx_ring[i]->reg_idx = reg_idx; 243 adapter->rx_ring[i]->reg_idx = reg_idx;
244 adapter->rx_ring[i]->netdev = adapter->netdev;
245 }
236 246
237#endif 247#endif
238 reg_idx = vmdq->offset * __ALIGN_MASK(1, ~vmdq->mask); 248 reg_idx = vmdq->offset * __ALIGN_MASK(1, ~vmdq->mask);
@@ -269,8 +279,10 @@ static bool ixgbe_cache_ring_rss(struct ixgbe_adapter *adapter)
269{ 279{
270 int i, reg_idx; 280 int i, reg_idx;
271 281
272 for (i = 0; i < adapter->num_rx_queues; i++) 282 for (i = 0; i < adapter->num_rx_queues; i++) {
273 adapter->rx_ring[i]->reg_idx = i; 283 adapter->rx_ring[i]->reg_idx = i;
284 adapter->rx_ring[i]->netdev = adapter->netdev;
285 }
274 for (i = 0, reg_idx = 0; i < adapter->num_tx_queues; i++, reg_idx++) 286 for (i = 0, reg_idx = 0; i < adapter->num_tx_queues; i++, reg_idx++)
275 adapter->tx_ring[i]->reg_idx = reg_idx; 287 adapter->tx_ring[i]->reg_idx = reg_idx;
276 for (i = 0; i < adapter->num_xdp_queues; i++, reg_idx++) 288 for (i = 0; i < adapter->num_xdp_queues; i++, reg_idx++)
@@ -340,7 +352,7 @@ static bool ixgbe_set_dcb_sriov_queues(struct ixgbe_adapter *adapter)
340#ifdef IXGBE_FCOE 352#ifdef IXGBE_FCOE
341 u16 fcoe_i = 0; 353 u16 fcoe_i = 0;
342#endif 354#endif
343 u8 tcs = netdev_get_num_tc(adapter->netdev); 355 u8 tcs = adapter->hw_tcs;
344 356
345 /* verify we have DCB queueing enabled before proceeding */ 357 /* verify we have DCB queueing enabled before proceeding */
346 if (tcs <= 1) 358 if (tcs <= 1)
@@ -440,7 +452,7 @@ static bool ixgbe_set_dcb_queues(struct ixgbe_adapter *adapter)
440 int tcs; 452 int tcs;
441 453
442 /* Map queue offset and counts onto allocated tx queues */ 454 /* Map queue offset and counts onto allocated tx queues */
443 tcs = netdev_get_num_tc(dev); 455 tcs = adapter->hw_tcs;
444 456
445 /* verify we have DCB queueing enabled before proceeding */ 457 /* verify we have DCB queueing enabled before proceeding */
446 if (tcs <= 1) 458 if (tcs <= 1)
@@ -607,6 +619,10 @@ static bool ixgbe_set_sriov_queues(struct ixgbe_adapter *adapter)
607 } 619 }
608 620
609#endif 621#endif
622 /* populate TC0 for use by pool 0 */
623 netdev_set_tc_queue(adapter->netdev, 0,
624 adapter->num_rx_queues_per_pool, 0);
625
610 return true; 626 return true;
611} 627}
612 628
@@ -839,7 +855,7 @@ static int ixgbe_alloc_q_vector(struct ixgbe_adapter *adapter,
839 int node = NUMA_NO_NODE; 855 int node = NUMA_NO_NODE;
840 int cpu = -1; 856 int cpu = -1;
841 int ring_count, size; 857 int ring_count, size;
842 u8 tcs = netdev_get_num_tc(adapter->netdev); 858 u8 tcs = adapter->hw_tcs;
843 859
844 ring_count = txr_count + rxr_count + xdp_count; 860 ring_count = txr_count + rxr_count + xdp_count;
845 size = sizeof(struct ixgbe_q_vector) + 861 size = sizeof(struct ixgbe_q_vector) +
@@ -922,11 +938,7 @@ static int ixgbe_alloc_q_vector(struct ixgbe_adapter *adapter,
922 938
923 /* apply Tx specific ring traits */ 939 /* apply Tx specific ring traits */
924 ring->count = adapter->tx_ring_count; 940 ring->count = adapter->tx_ring_count;
925 if (adapter->num_rx_pools > 1) 941 ring->queue_index = txr_idx;
926 ring->queue_index =
927 txr_idx % adapter->num_rx_queues_per_pool;
928 else
929 ring->queue_index = txr_idx;
930 942
931 /* assign ring to adapter */ 943 /* assign ring to adapter */
932 adapter->tx_ring[txr_idx] = ring; 944 adapter->tx_ring[txr_idx] = ring;
@@ -996,11 +1008,7 @@ static int ixgbe_alloc_q_vector(struct ixgbe_adapter *adapter,
996#endif /* IXGBE_FCOE */ 1008#endif /* IXGBE_FCOE */
997 /* apply Rx specific ring traits */ 1009 /* apply Rx specific ring traits */
998 ring->count = adapter->rx_ring_count; 1010 ring->count = adapter->rx_ring_count;
999 if (adapter->num_rx_pools > 1) 1011 ring->queue_index = rxr_idx;
1000 ring->queue_index =
1001 rxr_idx % adapter->num_rx_queues_per_pool;
1002 else
1003 ring->queue_index = rxr_idx;
1004 1012
1005 /* assign ring to adapter */ 1013 /* assign ring to adapter */
1006 adapter->rx_ring[rxr_idx] = ring; 1014 adapter->rx_ring[rxr_idx] = ring;
@@ -1176,7 +1184,7 @@ static void ixgbe_set_interrupt_capability(struct ixgbe_adapter *adapter)
1176 */ 1184 */
1177 1185
1178 /* Disable DCB unless we only have a single traffic class */ 1186 /* Disable DCB unless we only have a single traffic class */
1179 if (netdev_get_num_tc(adapter->netdev) > 1) { 1187 if (adapter->hw_tcs > 1) {
1180 e_dev_warn("Number of DCB TCs exceeds number of available queues. Disabling DCB support.\n"); 1188 e_dev_warn("Number of DCB TCs exceeds number of available queues. Disabling DCB support.\n");
1181 netdev_reset_tc(adapter->netdev); 1189 netdev_reset_tc(adapter->netdev);
1182 1190
@@ -1188,6 +1196,7 @@ static void ixgbe_set_interrupt_capability(struct ixgbe_adapter *adapter)
1188 adapter->dcb_cfg.pfc_mode_enable = false; 1196 adapter->dcb_cfg.pfc_mode_enable = false;
1189 } 1197 }
1190 1198
1199 adapter->hw_tcs = 0;
1191 adapter->dcb_cfg.num_tcs.pg_tcs = 1; 1200 adapter->dcb_cfg.num_tcs.pg_tcs = 1;
1192 adapter->dcb_cfg.num_tcs.pfc_tcs = 1; 1201 adapter->dcb_cfg.num_tcs.pfc_tcs = 1;
1193 1202
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
index e47e0c470508..4f28621b76e1 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
@@ -1128,6 +1128,9 @@ static void ixgbe_tx_timeout_reset(struct ixgbe_adapter *adapter)
1128 1128
1129/** 1129/**
1130 * ixgbe_tx_maxrate - callback to set the maximum per-queue bitrate 1130 * ixgbe_tx_maxrate - callback to set the maximum per-queue bitrate
1131 * @netdev: network interface device structure
1132 * @queue_index: Tx queue to set
1133 * @maxrate: desired maximum transmit bitrate
1131 **/ 1134 **/
1132static int ixgbe_tx_maxrate(struct net_device *netdev, 1135static int ixgbe_tx_maxrate(struct net_device *netdev,
1133 int queue_index, u32 maxrate) 1136 int queue_index, u32 maxrate)
@@ -1749,9 +1752,15 @@ static void ixgbe_process_skb_fields(struct ixgbe_ring *rx_ring,
1749 __vlan_hwaccel_put_tag(skb, htons(ETH_P_8021Q), vid); 1752 __vlan_hwaccel_put_tag(skb, htons(ETH_P_8021Q), vid);
1750 } 1753 }
1751 1754
1752 skb_record_rx_queue(skb, rx_ring->queue_index);
1753
1754 skb->protocol = eth_type_trans(skb, dev); 1755 skb->protocol = eth_type_trans(skb, dev);
1756
1757 /* record Rx queue, or update MACVLAN statistics */
1758 if (netif_is_ixgbe(dev))
1759 skb_record_rx_queue(skb, rx_ring->queue_index);
1760 else
1761 macvlan_count_rx(netdev_priv(dev), skb->len + ETH_HLEN, true,
1762 (skb->pkt_type == PACKET_BROADCAST) ||
1763 (skb->pkt_type == PACKET_MULTICAST));
1755} 1764}
1756 1765
1757static void ixgbe_rx_skb(struct ixgbe_q_vector *q_vector, 1766static void ixgbe_rx_skb(struct ixgbe_q_vector *q_vector,
@@ -1916,10 +1925,13 @@ static bool ixgbe_cleanup_headers(struct ixgbe_ring *rx_ring,
1916 if (IS_ERR(skb)) 1925 if (IS_ERR(skb))
1917 return true; 1926 return true;
1918 1927
1919 /* verify that the packet does not have any known errors */ 1928 /* Verify netdev is present, and that packet does not have any
1920 if (unlikely(ixgbe_test_staterr(rx_desc, 1929 * errors that would be unacceptable to the netdev.
1921 IXGBE_RXDADV_ERR_FRAME_ERR_MASK) && 1930 */
1922 !(netdev->features & NETIF_F_RXALL))) { 1931 if (!netdev ||
1932 (unlikely(ixgbe_test_staterr(rx_desc,
1933 IXGBE_RXDADV_ERR_FRAME_ERR_MASK) &&
1934 !(netdev->features & NETIF_F_RXALL)))) {
1923 dev_kfree_skb_any(skb); 1935 dev_kfree_skb_any(skb);
1924 return true; 1936 return true;
1925 } 1937 }
@@ -2016,8 +2028,8 @@ static bool ixgbe_can_reuse_rx_page(struct ixgbe_rx_buffer *rx_buffer)
2016 * ixgbe_add_rx_frag - Add contents of Rx buffer to sk_buff 2028 * ixgbe_add_rx_frag - Add contents of Rx buffer to sk_buff
2017 * @rx_ring: rx descriptor ring to transact packets on 2029 * @rx_ring: rx descriptor ring to transact packets on
2018 * @rx_buffer: buffer containing page to add 2030 * @rx_buffer: buffer containing page to add
2019 * @rx_desc: descriptor containing length of buffer written by hardware
2020 * @skb: sk_buff to place the data into 2031 * @skb: sk_buff to place the data into
2032 * @size: size of data in rx_buffer
2021 * 2033 *
2022 * This function will add the data contained in rx_buffer->page to the skb. 2034 * This function will add the data contained in rx_buffer->page to the skb.
2023 * This is done either through a direct copy if the data in the buffer is 2035 * This is done either through a direct copy if the data in the buffer is
@@ -3008,6 +3020,8 @@ static inline void ixgbe_irq_disable_queues(struct ixgbe_adapter *adapter,
3008/** 3020/**
3009 * ixgbe_irq_enable - Enable default interrupt generation settings 3021 * ixgbe_irq_enable - Enable default interrupt generation settings
3010 * @adapter: board private structure 3022 * @adapter: board private structure
3023 * @queues: enable irqs for queues
3024 * @flush: flush register write
3011 **/ 3025 **/
3012static inline void ixgbe_irq_enable(struct ixgbe_adapter *adapter, bool queues, 3026static inline void ixgbe_irq_enable(struct ixgbe_adapter *adapter, bool queues,
3013 bool flush) 3027 bool flush)
@@ -3463,6 +3477,7 @@ static inline void ixgbe_irq_disable(struct ixgbe_adapter *adapter)
3463 3477
3464/** 3478/**
3465 * ixgbe_configure_msi_and_legacy - Initialize PIN (INTA...) and MSI interrupts 3479 * ixgbe_configure_msi_and_legacy - Initialize PIN (INTA...) and MSI interrupts
3480 * @adapter: board private structure
3466 * 3481 *
3467 **/ 3482 **/
3468static void ixgbe_configure_msi_and_legacy(struct ixgbe_adapter *adapter) 3483static void ixgbe_configure_msi_and_legacy(struct ixgbe_adapter *adapter)
@@ -3574,7 +3589,7 @@ static void ixgbe_setup_mtqc(struct ixgbe_adapter *adapter)
3574{ 3589{
3575 struct ixgbe_hw *hw = &adapter->hw; 3590 struct ixgbe_hw *hw = &adapter->hw;
3576 u32 rttdcs, mtqc; 3591 u32 rttdcs, mtqc;
3577 u8 tcs = netdev_get_num_tc(adapter->netdev); 3592 u8 tcs = adapter->hw_tcs;
3578 3593
3579 if (hw->mac.type == ixgbe_mac_82598EB) 3594 if (hw->mac.type == ixgbe_mac_82598EB)
3580 return; 3595 return;
@@ -3929,7 +3944,7 @@ static void ixgbe_setup_mrqc(struct ixgbe_adapter *adapter)
3929 if (adapter->ring_feature[RING_F_RSS].mask) 3944 if (adapter->ring_feature[RING_F_RSS].mask)
3930 mrqc = IXGBE_MRQC_RSSEN; 3945 mrqc = IXGBE_MRQC_RSSEN;
3931 } else { 3946 } else {
3932 u8 tcs = netdev_get_num_tc(adapter->netdev); 3947 u8 tcs = adapter->hw_tcs;
3933 3948
3934 if (adapter->flags & IXGBE_FLAG_SRIOV_ENABLED) { 3949 if (adapter->flags & IXGBE_FLAG_SRIOV_ENABLED) {
3935 if (tcs > 4) 3950 if (tcs > 4)
@@ -3991,8 +4006,8 @@ static void ixgbe_setup_mrqc(struct ixgbe_adapter *adapter)
3991 4006
3992/** 4007/**
3993 * ixgbe_configure_rscctl - enable RSC for the indicated ring 4008 * ixgbe_configure_rscctl - enable RSC for the indicated ring
3994 * @adapter: address of board private structure 4009 * @adapter: address of board private structure
3995 * @index: index of ring to set 4010 * @ring: structure containing ring specific data
3996 **/ 4011 **/
3997static void ixgbe_configure_rscctl(struct ixgbe_adapter *adapter, 4012static void ixgbe_configure_rscctl(struct ixgbe_adapter *adapter,
3998 struct ixgbe_ring *ring) 4013 struct ixgbe_ring *ring)
@@ -4848,9 +4863,11 @@ int ixgbe_del_mac_filter(struct ixgbe_adapter *adapter,
4848 4863
4849 return -ENOMEM; 4864 return -ENOMEM;
4850} 4865}
4866
4851/** 4867/**
4852 * ixgbe_write_uc_addr_list - write unicast addresses to RAR table 4868 * ixgbe_write_uc_addr_list - write unicast addresses to RAR table
4853 * @netdev: network interface device structure 4869 * @netdev: network interface device structure
4870 * @vfn: pool to associate with unicast addresses
4854 * 4871 *
4855 * Writes unicast address list to the RAR table. 4872 * Writes unicast address list to the RAR table.
4856 * Returns: -ENOMEM on failure/insufficient address space 4873 * Returns: -ENOMEM on failure/insufficient address space
@@ -5197,7 +5214,7 @@ static int ixgbe_lpbthresh(struct ixgbe_adapter *adapter, int pb)
5197static void ixgbe_pbthresh_setup(struct ixgbe_adapter *adapter) 5214static void ixgbe_pbthresh_setup(struct ixgbe_adapter *adapter)
5198{ 5215{
5199 struct ixgbe_hw *hw = &adapter->hw; 5216 struct ixgbe_hw *hw = &adapter->hw;
5200 int num_tc = netdev_get_num_tc(adapter->netdev); 5217 int num_tc = adapter->hw_tcs;
5201 int i; 5218 int i;
5202 5219
5203 if (!num_tc) 5220 if (!num_tc)
@@ -5220,7 +5237,7 @@ static void ixgbe_configure_pb(struct ixgbe_adapter *adapter)
5220{ 5237{
5221 struct ixgbe_hw *hw = &adapter->hw; 5238 struct ixgbe_hw *hw = &adapter->hw;
5222 int hdrm; 5239 int hdrm;
5223 u8 tc = netdev_get_num_tc(adapter->netdev); 5240 u8 tc = adapter->hw_tcs;
5224 5241
5225 if (adapter->flags & IXGBE_FLAG_FDIR_HASH_CAPABLE || 5242 if (adapter->flags & IXGBE_FLAG_FDIR_HASH_CAPABLE ||
5226 adapter->flags & IXGBE_FLAG_FDIR_PERFECT_CAPABLE) 5243 adapter->flags & IXGBE_FLAG_FDIR_PERFECT_CAPABLE)
@@ -5331,47 +5348,11 @@ static void ixgbe_clean_rx_ring(struct ixgbe_ring *rx_ring)
5331 rx_ring->next_to_use = 0; 5348 rx_ring->next_to_use = 0;
5332} 5349}
5333 5350
5334static void ixgbe_disable_fwd_ring(struct ixgbe_fwd_adapter *vadapter,
5335 struct ixgbe_ring *rx_ring)
5336{
5337 struct ixgbe_adapter *adapter = vadapter->real_adapter;
5338 int index = rx_ring->queue_index + vadapter->rx_base_queue;
5339
5340 /* shutdown specific queue receive and wait for dma to settle */
5341 ixgbe_disable_rx_queue(adapter, rx_ring);
5342 usleep_range(10000, 20000);
5343 ixgbe_irq_disable_queues(adapter, BIT_ULL(index));
5344 ixgbe_clean_rx_ring(rx_ring);
5345}
5346
5347static int ixgbe_fwd_ring_down(struct net_device *vdev,
5348 struct ixgbe_fwd_adapter *accel)
5349{
5350 struct ixgbe_adapter *adapter = accel->real_adapter;
5351 unsigned int rxbase = accel->rx_base_queue;
5352 unsigned int txbase = accel->tx_base_queue;
5353 int i;
5354
5355 netif_tx_stop_all_queues(vdev);
5356
5357 for (i = 0; i < adapter->num_rx_queues_per_pool; i++) {
5358 ixgbe_disable_fwd_ring(accel, adapter->rx_ring[rxbase + i]);
5359 adapter->rx_ring[rxbase + i]->netdev = adapter->netdev;
5360 }
5361
5362 for (i = 0; i < adapter->num_rx_queues_per_pool; i++)
5363 adapter->tx_ring[txbase + i]->netdev = adapter->netdev;
5364
5365
5366 return 0;
5367}
5368
5369static int ixgbe_fwd_ring_up(struct net_device *vdev, 5351static int ixgbe_fwd_ring_up(struct net_device *vdev,
5370 struct ixgbe_fwd_adapter *accel) 5352 struct ixgbe_fwd_adapter *accel)
5371{ 5353{
5372 struct ixgbe_adapter *adapter = accel->real_adapter; 5354 struct ixgbe_adapter *adapter = accel->real_adapter;
5373 unsigned int rxbase, txbase, queues; 5355 int i, baseq, err;
5374 int i, baseq, err = 0;
5375 5356
5376 if (!test_bit(accel->pool, adapter->fwd_bitmask)) 5357 if (!test_bit(accel->pool, adapter->fwd_bitmask))
5377 return 0; 5358 return 0;
@@ -5382,38 +5363,30 @@ static int ixgbe_fwd_ring_up(struct net_device *vdev,
5382 baseq, baseq + adapter->num_rx_queues_per_pool); 5363 baseq, baseq + adapter->num_rx_queues_per_pool);
5383 5364
5384 accel->netdev = vdev; 5365 accel->netdev = vdev;
5385 accel->rx_base_queue = rxbase = baseq; 5366 accel->rx_base_queue = baseq;
5386 accel->tx_base_queue = txbase = baseq; 5367 accel->tx_base_queue = baseq;
5387 5368
5388 for (i = 0; i < adapter->num_rx_queues_per_pool; i++) 5369 for (i = 0; i < adapter->num_rx_queues_per_pool; i++)
5389 ixgbe_disable_fwd_ring(accel, adapter->rx_ring[rxbase + i]); 5370 adapter->rx_ring[baseq + i]->netdev = vdev;
5390 5371
5391 for (i = 0; i < adapter->num_rx_queues_per_pool; i++) { 5372 /* Guarantee all rings are updated before we update the
5392 adapter->rx_ring[rxbase + i]->netdev = vdev; 5373 * MAC address filter.
5393 ixgbe_configure_rx_ring(adapter, adapter->rx_ring[rxbase + i]); 5374 */
5375 wmb();
5376
5377 /* ixgbe_add_mac_filter will return an index if it succeeds, so we
5378 * need to only treat it as an error value if it is negative.
5379 */
5380 err = ixgbe_add_mac_filter(adapter, vdev->dev_addr,
5381 VMDQ_P(accel->pool));
5382 if (err >= 0) {
5383 ixgbe_macvlan_set_rx_mode(vdev, accel->pool, adapter);
5384 return 0;
5394 } 5385 }
5395 5386
5396 for (i = 0; i < adapter->num_rx_queues_per_pool; i++) 5387 for (i = 0; i < adapter->num_rx_queues_per_pool; i++)
5397 adapter->tx_ring[txbase + i]->netdev = vdev; 5388 adapter->rx_ring[baseq + i]->netdev = NULL;
5398
5399 queues = min_t(unsigned int,
5400 adapter->num_rx_queues_per_pool, vdev->num_tx_queues);
5401 err = netif_set_real_num_tx_queues(vdev, queues);
5402 if (err)
5403 goto fwd_queue_err;
5404
5405 err = netif_set_real_num_rx_queues(vdev, queues);
5406 if (err)
5407 goto fwd_queue_err;
5408
5409 if (is_valid_ether_addr(vdev->dev_addr))
5410 ixgbe_add_mac_filter(adapter, vdev->dev_addr,
5411 VMDQ_P(accel->pool));
5412 5389
5413 ixgbe_macvlan_set_rx_mode(vdev, VMDQ_P(accel->pool), adapter);
5414 return err;
5415fwd_queue_err:
5416 ixgbe_fwd_ring_down(vdev, accel);
5417 return err; 5390 return err;
5418} 5391}
5419 5392
@@ -5889,21 +5862,6 @@ static void ixgbe_fdir_filter_exit(struct ixgbe_adapter *adapter)
5889 spin_unlock(&adapter->fdir_perfect_lock); 5862 spin_unlock(&adapter->fdir_perfect_lock);
5890} 5863}
5891 5864
5892static int ixgbe_disable_macvlan(struct net_device *upper, void *data)
5893{
5894 if (netif_is_macvlan(upper)) {
5895 struct macvlan_dev *vlan = netdev_priv(upper);
5896
5897 if (vlan->fwd_priv) {
5898 netif_tx_stop_all_queues(upper);
5899 netif_carrier_off(upper);
5900 netif_tx_disable(upper);
5901 }
5902 }
5903
5904 return 0;
5905}
5906
5907void ixgbe_down(struct ixgbe_adapter *adapter) 5865void ixgbe_down(struct ixgbe_adapter *adapter)
5908{ 5866{
5909 struct net_device *netdev = adapter->netdev; 5867 struct net_device *netdev = adapter->netdev;
@@ -5933,10 +5891,6 @@ void ixgbe_down(struct ixgbe_adapter *adapter)
5933 netif_carrier_off(netdev); 5891 netif_carrier_off(netdev);
5934 netif_tx_disable(netdev); 5892 netif_tx_disable(netdev);
5935 5893
5936 /* disable any upper devices */
5937 netdev_walk_all_upper_dev_rcu(adapter->netdev,
5938 ixgbe_disable_macvlan, NULL);
5939
5940 ixgbe_irq_disable(adapter); 5894 ixgbe_irq_disable(adapter);
5941 5895
5942 ixgbe_napi_disable_all(adapter); 5896 ixgbe_napi_disable_all(adapter);
@@ -6091,6 +6045,7 @@ static void ixgbe_init_dcb(struct ixgbe_adapter *adapter)
6091/** 6045/**
6092 * ixgbe_sw_init - Initialize general software structures (struct ixgbe_adapter) 6046 * ixgbe_sw_init - Initialize general software structures (struct ixgbe_adapter)
6093 * @adapter: board private structure to initialize 6047 * @adapter: board private structure to initialize
6048 * @ii: pointer to ixgbe_info for device
6094 * 6049 *
6095 * ixgbe_sw_init initializes the Adapter private data structure. 6050 * ixgbe_sw_init initializes the Adapter private data structure.
6096 * Fields are initialized based on PCI device information and 6051 * Fields are initialized based on PCI device information and
@@ -6125,6 +6080,7 @@ static int ixgbe_sw_init(struct ixgbe_adapter *adapter,
6125 fdir = min_t(int, IXGBE_MAX_FDIR_INDICES, num_online_cpus()); 6080 fdir = min_t(int, IXGBE_MAX_FDIR_INDICES, num_online_cpus());
6126 adapter->ring_feature[RING_F_FDIR].limit = fdir; 6081 adapter->ring_feature[RING_F_FDIR].limit = fdir;
6127 adapter->fdir_pballoc = IXGBE_FDIR_PBALLOC_64K; 6082 adapter->fdir_pballoc = IXGBE_FDIR_PBALLOC_64K;
6083 adapter->ring_feature[RING_F_VMDQ].limit = 1;
6128#ifdef CONFIG_IXGBE_DCA 6084#ifdef CONFIG_IXGBE_DCA
6129 adapter->flags |= IXGBE_FLAG_DCA_CAPABLE; 6085 adapter->flags |= IXGBE_FLAG_DCA_CAPABLE;
6130#endif 6086#endif
@@ -6374,6 +6330,7 @@ err_setup_tx:
6374 6330
6375/** 6331/**
6376 * ixgbe_setup_rx_resources - allocate Rx resources (Descriptors) 6332 * ixgbe_setup_rx_resources - allocate Rx resources (Descriptors)
6333 * @adapter: pointer to ixgbe_adapter
6377 * @rx_ring: rx descriptor ring (for a specific queue) to setup 6334 * @rx_ring: rx descriptor ring (for a specific queue) to setup
6378 * 6335 *
6379 * Returns 0 on success, negative on failure 6336 * Returns 0 on success, negative on failure
@@ -6624,20 +6581,12 @@ int ixgbe_open(struct net_device *netdev)
6624 goto err_req_irq; 6581 goto err_req_irq;
6625 6582
6626 /* Notify the stack of the actual queue counts. */ 6583 /* Notify the stack of the actual queue counts. */
6627 if (adapter->num_rx_pools > 1) 6584 queues = adapter->num_tx_queues;
6628 queues = adapter->num_rx_queues_per_pool;
6629 else
6630 queues = adapter->num_tx_queues;
6631
6632 err = netif_set_real_num_tx_queues(netdev, queues); 6585 err = netif_set_real_num_tx_queues(netdev, queues);
6633 if (err) 6586 if (err)
6634 goto err_set_queues; 6587 goto err_set_queues;
6635 6588
6636 if (adapter->num_rx_pools > 1 && 6589 queues = adapter->num_rx_queues;
6637 adapter->num_rx_queues > IXGBE_MAX_L2A_QUEUES)
6638 queues = IXGBE_MAX_L2A_QUEUES;
6639 else
6640 queues = adapter->num_rx_queues;
6641 err = netif_set_real_num_rx_queues(netdev, queues); 6590 err = netif_set_real_num_rx_queues(netdev, queues);
6642 if (err) 6591 if (err)
6643 goto err_set_queues; 6592 goto err_set_queues;
@@ -7194,7 +7143,6 @@ static void ixgbe_check_hang_subtask(struct ixgbe_adapter *adapter)
7194/** 7143/**
7195 * ixgbe_watchdog_update_link - update the link status 7144 * ixgbe_watchdog_update_link - update the link status
7196 * @adapter: pointer to the device adapter structure 7145 * @adapter: pointer to the device adapter structure
7197 * @link_speed: pointer to a u32 to store the link_speed
7198 **/ 7146 **/
7199static void ixgbe_watchdog_update_link(struct ixgbe_adapter *adapter) 7147static void ixgbe_watchdog_update_link(struct ixgbe_adapter *adapter)
7200{ 7148{
@@ -7251,18 +7199,6 @@ static void ixgbe_update_default_up(struct ixgbe_adapter *adapter)
7251#endif 7199#endif
7252} 7200}
7253 7201
7254static int ixgbe_enable_macvlan(struct net_device *upper, void *data)
7255{
7256 if (netif_is_macvlan(upper)) {
7257 struct macvlan_dev *vlan = netdev_priv(upper);
7258
7259 if (vlan->fwd_priv)
7260 netif_tx_wake_all_queues(upper);
7261 }
7262
7263 return 0;
7264}
7265
7266/** 7202/**
7267 * ixgbe_watchdog_link_is_up - update netif_carrier status and 7203 * ixgbe_watchdog_link_is_up - update netif_carrier status and
7268 * print link up message 7204 * print link up message
@@ -7343,12 +7279,6 @@ static void ixgbe_watchdog_link_is_up(struct ixgbe_adapter *adapter)
7343 /* enable transmits */ 7279 /* enable transmits */
7344 netif_tx_wake_all_queues(adapter->netdev); 7280 netif_tx_wake_all_queues(adapter->netdev);
7345 7281
7346 /* enable any upper devices */
7347 rtnl_lock();
7348 netdev_walk_all_upper_dev_rcu(adapter->netdev,
7349 ixgbe_enable_macvlan, NULL);
7350 rtnl_unlock();
7351
7352 /* update the default user priority for VFs */ 7282 /* update the default user priority for VFs */
7353 ixgbe_update_default_up(adapter); 7283 ixgbe_update_default_up(adapter);
7354 7284
@@ -7665,7 +7595,7 @@ static void ixgbe_sfp_link_config_subtask(struct ixgbe_adapter *adapter)
7665 7595
7666/** 7596/**
7667 * ixgbe_service_timer - Timer Call-back 7597 * ixgbe_service_timer - Timer Call-back
7668 * @data: pointer to adapter cast into an unsigned long 7598 * @t: pointer to timer_list structure
7669 **/ 7599 **/
7670static void ixgbe_service_timer(struct timer_list *t) 7600static void ixgbe_service_timer(struct timer_list *t)
7671{ 7601{
@@ -8309,14 +8239,19 @@ static u16 ixgbe_select_queue(struct net_device *dev, struct sk_buff *skb,
8309 void *accel_priv, select_queue_fallback_t fallback) 8239 void *accel_priv, select_queue_fallback_t fallback)
8310{ 8240{
8311 struct ixgbe_fwd_adapter *fwd_adapter = accel_priv; 8241 struct ixgbe_fwd_adapter *fwd_adapter = accel_priv;
8312#ifdef IXGBE_FCOE
8313 struct ixgbe_adapter *adapter; 8242 struct ixgbe_adapter *adapter;
8314 struct ixgbe_ring_feature *f;
8315 int txq; 8243 int txq;
8244#ifdef IXGBE_FCOE
8245 struct ixgbe_ring_feature *f;
8316#endif 8246#endif
8317 8247
8318 if (fwd_adapter) 8248 if (fwd_adapter) {
8319 return skb->queue_mapping + fwd_adapter->tx_base_queue; 8249 adapter = netdev_priv(dev);
8250 txq = reciprocal_scale(skb_get_hash(skb),
8251 adapter->num_rx_queues_per_pool);
8252
8253 return txq + fwd_adapter->tx_base_queue;
8254 }
8320 8255
8321#ifdef IXGBE_FCOE 8256#ifdef IXGBE_FCOE
8322 8257
@@ -8648,7 +8583,7 @@ static int ixgbe_ioctl(struct net_device *netdev, struct ifreq *req, int cmd)
8648/** 8583/**
8649 * ixgbe_add_sanmac_netdev - Add the SAN MAC address to the corresponding 8584 * ixgbe_add_sanmac_netdev - Add the SAN MAC address to the corresponding
8650 * netdev->dev_addrs 8585 * netdev->dev_addrs
8651 * @netdev: network interface device structure 8586 * @dev: network interface device structure
8652 * 8587 *
8653 * Returns non-zero on failure 8588 * Returns non-zero on failure
8654 **/ 8589 **/
@@ -8672,7 +8607,7 @@ static int ixgbe_add_sanmac_netdev(struct net_device *dev)
8672/** 8607/**
8673 * ixgbe_del_sanmac_netdev - Removes the SAN MAC address to the corresponding 8608 * ixgbe_del_sanmac_netdev - Removes the SAN MAC address to the corresponding
8674 * netdev->dev_addrs 8609 * netdev->dev_addrs
8675 * @netdev: network interface device structure 8610 * @dev: network interface device structure
8676 * 8611 *
8677 * Returns non-zero on failure 8612 * Returns non-zero on failure
8678 **/ 8613 **/
@@ -8839,7 +8774,7 @@ static void ixgbe_set_prio_tc_map(struct ixgbe_adapter *adapter)
8839/** 8774/**
8840 * ixgbe_setup_tc - configure net_device for multiple traffic classes 8775 * ixgbe_setup_tc - configure net_device for multiple traffic classes
8841 * 8776 *
8842 * @netdev: net device to configure 8777 * @dev: net device to configure
8843 * @tc: number of traffic classes to enable 8778 * @tc: number of traffic classes to enable
8844 */ 8779 */
8845int ixgbe_setup_tc(struct net_device *dev, u8 tc) 8780int ixgbe_setup_tc(struct net_device *dev, u8 tc)
@@ -8870,6 +8805,7 @@ int ixgbe_setup_tc(struct net_device *dev, u8 tc)
8870 netdev_set_num_tc(dev, tc); 8805 netdev_set_num_tc(dev, tc);
8871 ixgbe_set_prio_tc_map(adapter); 8806 ixgbe_set_prio_tc_map(adapter);
8872 8807
8808 adapter->hw_tcs = tc;
8873 adapter->flags |= IXGBE_FLAG_DCB_ENABLED; 8809 adapter->flags |= IXGBE_FLAG_DCB_ENABLED;
8874 8810
8875 if (adapter->hw.mac.type == ixgbe_mac_82598EB) { 8811 if (adapter->hw.mac.type == ixgbe_mac_82598EB) {
@@ -8879,10 +8815,19 @@ int ixgbe_setup_tc(struct net_device *dev, u8 tc)
8879 } else { 8815 } else {
8880 netdev_reset_tc(dev); 8816 netdev_reset_tc(dev);
8881 8817
8818 /* To support macvlan offload we have to use num_tc to
8819 * restrict the queues that can be used by the device.
8820 * By doing this we can avoid reporting a false number of
8821 * queues.
8822 */
8823 if (!tc && adapter->num_rx_pools > 1)
8824 netdev_set_num_tc(dev, 1);
8825
8882 if (adapter->hw.mac.type == ixgbe_mac_82598EB) 8826 if (adapter->hw.mac.type == ixgbe_mac_82598EB)
8883 adapter->hw.fc.requested_mode = adapter->last_lfc_mode; 8827 adapter->hw.fc.requested_mode = adapter->last_lfc_mode;
8884 8828
8885 adapter->flags &= ~IXGBE_FLAG_DCB_ENABLED; 8829 adapter->flags &= ~IXGBE_FLAG_DCB_ENABLED;
8830 adapter->hw_tcs = tc;
8886 8831
8887 adapter->temp_dcb_cfg.pfc_mode_enable = false; 8832 adapter->temp_dcb_cfg.pfc_mode_enable = false;
8888 adapter->dcb_cfg.pfc_mode_enable = false; 8833 adapter->dcb_cfg.pfc_mode_enable = false;
@@ -9415,7 +9360,7 @@ void ixgbe_sriov_reinit(struct ixgbe_adapter *adapter)
9415 struct net_device *netdev = adapter->netdev; 9360 struct net_device *netdev = adapter->netdev;
9416 9361
9417 rtnl_lock(); 9362 rtnl_lock();
9418 ixgbe_setup_tc(netdev, netdev_get_num_tc(netdev)); 9363 ixgbe_setup_tc(netdev, adapter->hw_tcs);
9419 rtnl_unlock(); 9364 rtnl_unlock();
9420} 9365}
9421 9366
@@ -9491,7 +9436,7 @@ static int ixgbe_set_features(struct net_device *netdev,
9491 /* We cannot enable ATR if SR-IOV is enabled */ 9436 /* We cannot enable ATR if SR-IOV is enabled */
9492 if (adapter->flags & IXGBE_FLAG_SRIOV_ENABLED || 9437 if (adapter->flags & IXGBE_FLAG_SRIOV_ENABLED ||
9493 /* We cannot enable ATR if we have 2 or more tcs */ 9438 /* We cannot enable ATR if we have 2 or more tcs */
9494 (netdev_get_num_tc(netdev) > 1) || 9439 (adapter->hw_tcs > 1) ||
9495 /* We cannot enable ATR if RSS is disabled */ 9440 /* We cannot enable ATR if RSS is disabled */
9496 (adapter->ring_feature[RING_F_RSS].limit <= 1) || 9441 (adapter->ring_feature[RING_F_RSS].limit <= 1) ||
9497 /* A sample rate of 0 indicates ATR disabled */ 9442 /* A sample rate of 0 indicates ATR disabled */
@@ -9666,8 +9611,8 @@ static int ixgbe_ndo_fdb_add(struct ndmsg *ndm, struct nlattr *tb[],
9666 9611
9667/** 9612/**
9668 * ixgbe_configure_bridge_mode - set various bridge modes 9613 * ixgbe_configure_bridge_mode - set various bridge modes
9669 * @adapter - the private structure 9614 * @adapter: the private structure
9670 * @mode - requested bridge mode 9615 * @mode: requested bridge mode
9671 * 9616 *
9672 * Configure some settings require for various bridge modes. 9617 * Configure some settings require for various bridge modes.
9673 **/ 9618 **/
@@ -9792,7 +9737,7 @@ static void *ixgbe_fwd_add(struct net_device *pdev, struct net_device *vdev)
9792 struct ixgbe_fwd_adapter *fwd_adapter = NULL; 9737 struct ixgbe_fwd_adapter *fwd_adapter = NULL;
9793 struct ixgbe_adapter *adapter = netdev_priv(pdev); 9738 struct ixgbe_adapter *adapter = netdev_priv(pdev);
9794 int used_pools = adapter->num_vfs + adapter->num_rx_pools; 9739 int used_pools = adapter->num_vfs + adapter->num_rx_pools;
9795 int tcs = netdev_get_num_tc(pdev) ? : 1; 9740 int tcs = adapter->hw_tcs ? : 1;
9796 unsigned int limit; 9741 unsigned int limit;
9797 int pool, err; 9742 int pool, err;
9798 9743
@@ -9803,22 +9748,6 @@ static void *ixgbe_fwd_add(struct net_device *pdev, struct net_device *vdev)
9803 if (used_pools >= IXGBE_MAX_VF_FUNCTIONS) 9748 if (used_pools >= IXGBE_MAX_VF_FUNCTIONS)
9804 return ERR_PTR(-EINVAL); 9749 return ERR_PTR(-EINVAL);
9805 9750
9806#ifdef CONFIG_RPS
9807 if (vdev->num_rx_queues != vdev->num_tx_queues) {
9808 netdev_info(pdev, "%s: Only supports a single queue count for TX and RX\n",
9809 vdev->name);
9810 return ERR_PTR(-EINVAL);
9811 }
9812#endif
9813 /* Check for hardware restriction on number of rx/tx queues */
9814 if (vdev->num_tx_queues > IXGBE_MAX_L2A_QUEUES ||
9815 vdev->num_tx_queues == IXGBE_BAD_L2A_QUEUE) {
9816 netdev_info(pdev,
9817 "%s: Supports RX/TX Queue counts 1,2, and 4\n",
9818 pdev->name);
9819 return ERR_PTR(-EINVAL);
9820 }
9821
9822 if (((adapter->flags & IXGBE_FLAG_DCB_ENABLED) && 9751 if (((adapter->flags & IXGBE_FLAG_DCB_ENABLED) &&
9823 adapter->num_rx_pools >= (MAX_TX_QUEUES / tcs)) || 9752 adapter->num_rx_pools >= (MAX_TX_QUEUES / tcs)) ||
9824 (adapter->num_rx_pools > IXGBE_MAX_MACVLANS)) 9753 (adapter->num_rx_pools > IXGBE_MAX_MACVLANS))
@@ -9835,24 +9764,19 @@ static void *ixgbe_fwd_add(struct net_device *pdev, struct net_device *vdev)
9835 /* Enable VMDq flag so device will be set in VM mode */ 9764 /* Enable VMDq flag so device will be set in VM mode */
9836 adapter->flags |= IXGBE_FLAG_VMDQ_ENABLED | IXGBE_FLAG_SRIOV_ENABLED; 9765 adapter->flags |= IXGBE_FLAG_VMDQ_ENABLED | IXGBE_FLAG_SRIOV_ENABLED;
9837 adapter->ring_feature[RING_F_VMDQ].limit = limit + 1; 9766 adapter->ring_feature[RING_F_VMDQ].limit = limit + 1;
9838 adapter->ring_feature[RING_F_RSS].limit = vdev->num_tx_queues;
9839 9767
9840 /* Force reinit of ring allocation with VMDQ enabled */
9841 err = ixgbe_setup_tc(pdev, netdev_get_num_tc(pdev));
9842 if (err)
9843 goto fwd_add_err;
9844 fwd_adapter->pool = pool; 9768 fwd_adapter->pool = pool;
9845 fwd_adapter->real_adapter = adapter; 9769 fwd_adapter->real_adapter = adapter;
9846 9770
9847 if (netif_running(pdev)) { 9771 /* Force reinit of ring allocation with VMDQ enabled */
9772 err = ixgbe_setup_tc(pdev, adapter->hw_tcs);
9773
9774 if (!err && netif_running(pdev))
9848 err = ixgbe_fwd_ring_up(vdev, fwd_adapter); 9775 err = ixgbe_fwd_ring_up(vdev, fwd_adapter);
9849 if (err)
9850 goto fwd_add_err;
9851 netif_tx_start_all_queues(vdev);
9852 }
9853 9776
9854 return fwd_adapter; 9777 if (!err)
9855fwd_add_err: 9778 return fwd_adapter;
9779
9856 /* unwind counter and free adapter struct */ 9780 /* unwind counter and free adapter struct */
9857 netdev_info(pdev, 9781 netdev_info(pdev,
9858 "%s: dfwd hardware acceleration failed\n", vdev->name); 9782 "%s: dfwd hardware acceleration failed\n", vdev->name);
@@ -9863,15 +9787,38 @@ fwd_add_err:
9863 9787
9864static void ixgbe_fwd_del(struct net_device *pdev, void *priv) 9788static void ixgbe_fwd_del(struct net_device *pdev, void *priv)
9865{ 9789{
9866 struct ixgbe_fwd_adapter *fwd_adapter = priv; 9790 struct ixgbe_fwd_adapter *accel = priv;
9867 struct ixgbe_adapter *adapter = fwd_adapter->real_adapter; 9791 struct ixgbe_adapter *adapter = accel->real_adapter;
9868 unsigned int limit; 9792 unsigned int rxbase = accel->rx_base_queue;
9793 unsigned int limit, i;
9869 9794
9870 clear_bit(fwd_adapter->pool, adapter->fwd_bitmask); 9795 /* delete unicast filter associated with offloaded interface */
9796 ixgbe_del_mac_filter(adapter, accel->netdev->dev_addr,
9797 VMDQ_P(accel->pool));
9871 9798
9799 /* disable ability to receive packets for this pool */
9800 IXGBE_WRITE_REG(&adapter->hw, IXGBE_VMOLR(accel->pool), 0);
9801
9802 /* Allow remaining Rx packets to get flushed out of the
9803 * Rx FIFO before we drop the netdev for the ring.
9804 */
9805 usleep_range(10000, 20000);
9806
9807 for (i = 0; i < adapter->num_rx_queues_per_pool; i++) {
9808 struct ixgbe_ring *ring = adapter->rx_ring[rxbase + i];
9809 struct ixgbe_q_vector *qv = ring->q_vector;
9810
9811 /* Make sure we aren't processing any packets and clear
9812 * netdev to shut down the ring.
9813 */
9814 if (netif_running(adapter->netdev))
9815 napi_synchronize(&qv->napi);
9816 ring->netdev = NULL;
9817 }
9818
9819 clear_bit(accel->pool, adapter->fwd_bitmask);
9872 limit = find_last_bit(adapter->fwd_bitmask, adapter->num_rx_pools); 9820 limit = find_last_bit(adapter->fwd_bitmask, adapter->num_rx_pools);
9873 adapter->ring_feature[RING_F_VMDQ].limit = limit + 1; 9821 adapter->ring_feature[RING_F_VMDQ].limit = limit + 1;
9874 ixgbe_fwd_ring_down(fwd_adapter->netdev, fwd_adapter);
9875 9822
9876 /* go back to full RSS if we're done with our VMQs */ 9823 /* go back to full RSS if we're done with our VMQs */
9877 if (adapter->ring_feature[RING_F_VMDQ].limit == 1) { 9824 if (adapter->ring_feature[RING_F_VMDQ].limit == 1) {
@@ -9883,13 +9830,13 @@ static void ixgbe_fwd_del(struct net_device *pdev, void *priv)
9883 adapter->ring_feature[RING_F_RSS].limit = rss; 9830 adapter->ring_feature[RING_F_RSS].limit = rss;
9884 } 9831 }
9885 9832
9886 ixgbe_setup_tc(pdev, netdev_get_num_tc(pdev)); 9833 ixgbe_setup_tc(pdev, adapter->hw_tcs);
9887 netdev_dbg(pdev, "pool %i:%i queues %i:%i\n", 9834 netdev_dbg(pdev, "pool %i:%i queues %i:%i\n",
9888 fwd_adapter->pool, adapter->num_rx_pools, 9835 accel->pool, adapter->num_rx_pools,
9889 fwd_adapter->rx_base_queue, 9836 accel->rx_base_queue,
9890 fwd_adapter->rx_base_queue + 9837 accel->rx_base_queue +
9891 adapter->num_rx_queues_per_pool); 9838 adapter->num_rx_queues_per_pool);
9892 kfree(fwd_adapter); 9839 kfree(accel);
9893} 9840}
9894 9841
9895#define IXGBE_MAX_MAC_HDR_LEN 127 9842#define IXGBE_MAX_MAC_HDR_LEN 127
@@ -9956,7 +9903,7 @@ static int ixgbe_xdp_setup(struct net_device *dev, struct bpf_prog *prog)
9956 9903
9957 /* If transitioning XDP modes reconfigure rings */ 9904 /* If transitioning XDP modes reconfigure rings */
9958 if (!!prog != !!old_prog) { 9905 if (!!prog != !!old_prog) {
9959 int err = ixgbe_setup_tc(dev, netdev_get_num_tc(dev)); 9906 int err = ixgbe_setup_tc(dev, adapter->hw_tcs);
9960 9907
9961 if (err) { 9908 if (err) {
9962 rcu_assign_pointer(adapter->xdp_prog, old_prog); 9909 rcu_assign_pointer(adapter->xdp_prog, old_prog);
@@ -10133,7 +10080,7 @@ static inline int ixgbe_enumerate_functions(struct ixgbe_adapter *adapter)
10133 * ixgbe_wol_supported - Check whether device supports WoL 10080 * ixgbe_wol_supported - Check whether device supports WoL
10134 * @adapter: the adapter private structure 10081 * @adapter: the adapter private structure
10135 * @device_id: the device ID 10082 * @device_id: the device ID
10136 * @subdev_id: the subsystem device ID 10083 * @subdevice_id: the subsystem device ID
10137 * 10084 *
10138 * This function is used by probe and ethtool to determine 10085 * This function is used by probe and ethtool to determine
10139 * which devices have WoL support 10086 * which devices have WoL support
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_phy.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_phy.c
index 654a402f0e9e..91bde90f9265 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_phy.c
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_phy.c
@@ -378,7 +378,7 @@ static s32 ixgbe_get_phy_id(struct ixgbe_hw *hw)
378 378
379/** 379/**
380 * ixgbe_get_phy_type_from_id - Get the phy type 380 * ixgbe_get_phy_type_from_id - Get the phy type
381 * @hw: pointer to hardware structure 381 * @phy_id: hardware phy id
382 * 382 *
383 **/ 383 **/
384static enum ixgbe_phy_type ixgbe_get_phy_type_from_id(u32 phy_id) 384static enum ixgbe_phy_type ixgbe_get_phy_type_from_id(u32 phy_id)
@@ -489,6 +489,7 @@ s32 ixgbe_reset_phy_generic(struct ixgbe_hw *hw)
489 * the SWFW lock 489 * the SWFW lock
490 * @hw: pointer to hardware structure 490 * @hw: pointer to hardware structure
491 * @reg_addr: 32 bit address of PHY register to read 491 * @reg_addr: 32 bit address of PHY register to read
492 * @device_type: 5 bit device type
492 * @phy_data: Pointer to read data from PHY register 493 * @phy_data: Pointer to read data from PHY register
493 **/ 494 **/
494s32 ixgbe_read_phy_reg_mdi(struct ixgbe_hw *hw, u32 reg_addr, u32 device_type, 495s32 ixgbe_read_phy_reg_mdi(struct ixgbe_hw *hw, u32 reg_addr, u32 device_type,
@@ -564,6 +565,7 @@ s32 ixgbe_read_phy_reg_mdi(struct ixgbe_hw *hw, u32 reg_addr, u32 device_type,
564 * using the SWFW lock - this function is needed in most cases 565 * using the SWFW lock - this function is needed in most cases
565 * @hw: pointer to hardware structure 566 * @hw: pointer to hardware structure
566 * @reg_addr: 32 bit address of PHY register to read 567 * @reg_addr: 32 bit address of PHY register to read
568 * @device_type: 5 bit device type
567 * @phy_data: Pointer to read data from PHY register 569 * @phy_data: Pointer to read data from PHY register
568 **/ 570 **/
569s32 ixgbe_read_phy_reg_generic(struct ixgbe_hw *hw, u32 reg_addr, 571s32 ixgbe_read_phy_reg_generic(struct ixgbe_hw *hw, u32 reg_addr,
@@ -763,6 +765,7 @@ s32 ixgbe_setup_phy_link_generic(struct ixgbe_hw *hw)
763 * ixgbe_setup_phy_link_speed_generic - Sets the auto advertised capabilities 765 * ixgbe_setup_phy_link_speed_generic - Sets the auto advertised capabilities
764 * @hw: pointer to hardware structure 766 * @hw: pointer to hardware structure
765 * @speed: new link speed 767 * @speed: new link speed
768 * @autoneg_wait_to_complete: unused
766 **/ 769 **/
767s32 ixgbe_setup_phy_link_speed_generic(struct ixgbe_hw *hw, 770s32 ixgbe_setup_phy_link_speed_generic(struct ixgbe_hw *hw,
768 ixgbe_link_speed speed, 771 ixgbe_link_speed speed,
@@ -861,6 +864,8 @@ s32 ixgbe_get_copper_link_capabilities_generic(struct ixgbe_hw *hw,
861/** 864/**
862 * ixgbe_check_phy_link_tnx - Determine link and speed status 865 * ixgbe_check_phy_link_tnx - Determine link and speed status
863 * @hw: pointer to hardware structure 866 * @hw: pointer to hardware structure
867 * @speed: link speed
868 * @link_up: status of link
864 * 869 *
865 * Reads the VS1 register to determine if link is up and the current speed for 870 * Reads the VS1 register to determine if link is up and the current speed for
866 * the PHY. 871 * the PHY.
@@ -1667,7 +1672,7 @@ s32 ixgbe_read_i2c_eeprom_generic(struct ixgbe_hw *hw, u8 byte_offset,
1667 * ixgbe_read_i2c_sff8472_generic - Reads 8 bit word over I2C interface 1672 * ixgbe_read_i2c_sff8472_generic - Reads 8 bit word over I2C interface
1668 * @hw: pointer to hardware structure 1673 * @hw: pointer to hardware structure
1669 * @byte_offset: byte offset at address 0xA2 1674 * @byte_offset: byte offset at address 0xA2
1670 * @eeprom_data: value read 1675 * @sff8472_data: value read
1671 * 1676 *
1672 * Performs byte read operation to SFP module's SFF-8472 data over I2C 1677 * Performs byte read operation to SFP module's SFF-8472 data over I2C
1673 **/ 1678 **/
@@ -1714,6 +1719,7 @@ static bool ixgbe_is_sfp_probe(struct ixgbe_hw *hw, u8 offset, u8 addr)
1714 * ixgbe_read_i2c_byte_generic_int - Reads 8 bit word over I2C 1719 * ixgbe_read_i2c_byte_generic_int - Reads 8 bit word over I2C
1715 * @hw: pointer to hardware structure 1720 * @hw: pointer to hardware structure
1716 * @byte_offset: byte offset to read 1721 * @byte_offset: byte offset to read
1722 * @dev_addr: device address
1717 * @data: value read 1723 * @data: value read
1718 * @lock: true if to take and release semaphore 1724 * @lock: true if to take and release semaphore
1719 * 1725 *
@@ -1804,6 +1810,7 @@ fail:
1804 * ixgbe_read_i2c_byte_generic - Reads 8 bit word over I2C 1810 * ixgbe_read_i2c_byte_generic - Reads 8 bit word over I2C
1805 * @hw: pointer to hardware structure 1811 * @hw: pointer to hardware structure
1806 * @byte_offset: byte offset to read 1812 * @byte_offset: byte offset to read
1813 * @dev_addr: device address
1807 * @data: value read 1814 * @data: value read
1808 * 1815 *
1809 * Performs byte read operation to SFP module's EEPROM over I2C interface at 1816 * Performs byte read operation to SFP module's EEPROM over I2C interface at
@@ -1820,6 +1827,7 @@ s32 ixgbe_read_i2c_byte_generic(struct ixgbe_hw *hw, u8 byte_offset,
1820 * ixgbe_read_i2c_byte_generic_unlocked - Reads 8 bit word over I2C 1827 * ixgbe_read_i2c_byte_generic_unlocked - Reads 8 bit word over I2C
1821 * @hw: pointer to hardware structure 1828 * @hw: pointer to hardware structure
1822 * @byte_offset: byte offset to read 1829 * @byte_offset: byte offset to read
1830 * @dev_addr: device address
1823 * @data: value read 1831 * @data: value read
1824 * 1832 *
1825 * Performs byte read operation to SFP module's EEPROM over I2C interface at 1833 * Performs byte read operation to SFP module's EEPROM over I2C interface at
@@ -1836,6 +1844,7 @@ s32 ixgbe_read_i2c_byte_generic_unlocked(struct ixgbe_hw *hw, u8 byte_offset,
1836 * ixgbe_write_i2c_byte_generic_int - Writes 8 bit word over I2C 1844 * ixgbe_write_i2c_byte_generic_int - Writes 8 bit word over I2C
1837 * @hw: pointer to hardware structure 1845 * @hw: pointer to hardware structure
1838 * @byte_offset: byte offset to write 1846 * @byte_offset: byte offset to write
1847 * @dev_addr: device address
1839 * @data: value to write 1848 * @data: value to write
1840 * @lock: true if to take and release semaphore 1849 * @lock: true if to take and release semaphore
1841 * 1850 *
@@ -1904,6 +1913,7 @@ fail:
1904 * ixgbe_write_i2c_byte_generic - Writes 8 bit word over I2C 1913 * ixgbe_write_i2c_byte_generic - Writes 8 bit word over I2C
1905 * @hw: pointer to hardware structure 1914 * @hw: pointer to hardware structure
1906 * @byte_offset: byte offset to write 1915 * @byte_offset: byte offset to write
1916 * @dev_addr: device address
1907 * @data: value to write 1917 * @data: value to write
1908 * 1918 *
1909 * Performs byte write operation to SFP module's EEPROM over I2C interface at 1919 * Performs byte write operation to SFP module's EEPROM over I2C interface at
@@ -1920,6 +1930,7 @@ s32 ixgbe_write_i2c_byte_generic(struct ixgbe_hw *hw, u8 byte_offset,
1920 * ixgbe_write_i2c_byte_generic_unlocked - Writes 8 bit word over I2C 1930 * ixgbe_write_i2c_byte_generic_unlocked - Writes 8 bit word over I2C
1921 * @hw: pointer to hardware structure 1931 * @hw: pointer to hardware structure
1922 * @byte_offset: byte offset to write 1932 * @byte_offset: byte offset to write
1933 * @dev_addr: device address
1923 * @data: value to write 1934 * @data: value to write
1924 * 1935 *
1925 * Performs byte write operation to SFP module's EEPROM over I2C interface at 1936 * Performs byte write operation to SFP module's EEPROM over I2C interface at
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_ptp.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_ptp.c
index ae312c45696a..f6cc9166082a 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_ptp.c
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_ptp.c
@@ -166,7 +166,7 @@
166 166
167/** 167/**
168 * ixgbe_ptp_setup_sdp_x540 168 * ixgbe_ptp_setup_sdp_x540
169 * @hw: the hardware private structure 169 * @adapter: private adapter structure
170 * 170 *
171 * this function enables or disables the clock out feature on SDP0 for 171 * this function enables or disables the clock out feature on SDP0 for
172 * the X540 device. It will create a 1second periodic output that can 172 * the X540 device. It will create a 1second periodic output that can
@@ -299,7 +299,7 @@ static u64 ixgbe_ptp_read_82599(const struct cyclecounter *cc)
299 * ixgbe_ptp_convert_to_hwtstamp - convert register value to hw timestamp 299 * ixgbe_ptp_convert_to_hwtstamp - convert register value to hw timestamp
300 * @adapter: private adapter structure 300 * @adapter: private adapter structure
301 * @hwtstamp: stack timestamp structure 301 * @hwtstamp: stack timestamp structure
302 * @systim: unsigned 64bit system time value 302 * @timestamp: unsigned 64bit system time value
303 * 303 *
304 * We need to convert the adapter's RX/TXSTMP registers into a hwtstamp value 304 * We need to convert the adapter's RX/TXSTMP registers into a hwtstamp value
305 * which can be used by the stack's ptp functions. 305 * which can be used by the stack's ptp functions.
@@ -1015,7 +1015,7 @@ static int ixgbe_ptp_set_timestamp_mode(struct ixgbe_adapter *adapter,
1015/** 1015/**
1016 * ixgbe_ptp_set_ts_config - user entry point for timestamp mode 1016 * ixgbe_ptp_set_ts_config - user entry point for timestamp mode
1017 * @adapter: pointer to adapter struct 1017 * @adapter: pointer to adapter struct
1018 * @ifreq: ioctl data 1018 * @ifr: ioctl data
1019 * 1019 *
1020 * Set hardware to requested mode. If unsupported, return an error with no 1020 * Set hardware to requested mode. If unsupported, return an error with no
1021 * changes. Otherwise, store the mode for future reference. 1021 * changes. Otherwise, store the mode for future reference.
@@ -1338,7 +1338,7 @@ void ixgbe_ptp_init(struct ixgbe_adapter *adapter)
1338 1338
1339/** 1339/**
1340 * ixgbe_ptp_suspend - stop PTP work items 1340 * ixgbe_ptp_suspend - stop PTP work items
1341 * @ adapter: pointer to adapter struct 1341 * @adapter: pointer to adapter struct
1342 * 1342 *
1343 * this function suspends PTP activity, and prevents more PTP work from being 1343 * this function suspends PTP activity, and prevents more PTP work from being
1344 * generated, but does not destroy the PTP clock device. 1344 * generated, but does not destroy the PTP clock device.
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_sriov.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_sriov.c
index 0085f4632966..27a70a52f3c9 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_sriov.c
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_sriov.c
@@ -78,12 +78,9 @@ static int __ixgbe_enable_sriov(struct ixgbe_adapter *adapter,
78 struct ixgbe_hw *hw = &adapter->hw; 78 struct ixgbe_hw *hw = &adapter->hw;
79 int i; 79 int i;
80 80
81 adapter->flags |= IXGBE_FLAG_SRIOV_ENABLED;
82
83 /* Enable VMDq flag so device will be set in VM mode */ 81 /* Enable VMDq flag so device will be set in VM mode */
84 adapter->flags |= IXGBE_FLAG_VMDQ_ENABLED; 82 adapter->flags |= IXGBE_FLAG_SRIOV_ENABLED |
85 if (!adapter->ring_feature[RING_F_VMDQ].limit) 83 IXGBE_FLAG_VMDQ_ENABLED;
86 adapter->ring_feature[RING_F_VMDQ].limit = 1;
87 84
88 /* Allocate memory for per VF control structures */ 85 /* Allocate memory for per VF control structures */
89 adapter->vfinfo = kcalloc(num_vfs, sizeof(struct vf_data_storage), 86 adapter->vfinfo = kcalloc(num_vfs, sizeof(struct vf_data_storage),
@@ -314,7 +311,7 @@ static int ixgbe_pci_sriov_enable(struct pci_dev *dev, int num_vfs)
314 * than we have available pools. The PCI bus driver already checks for 311 * than we have available pools. The PCI bus driver already checks for
315 * other values out of range. 312 * other values out of range.
316 */ 313 */
317 num_tc = netdev_get_num_tc(adapter->netdev); 314 num_tc = adapter->hw_tcs;
318 num_rx_pools = adapter->num_rx_pools; 315 num_rx_pools = adapter->num_rx_pools;
319 limit = (num_tc > 4) ? IXGBE_MAX_VFS_8TC : 316 limit = (num_tc > 4) ? IXGBE_MAX_VFS_8TC :
320 (num_tc > 1) ? IXGBE_MAX_VFS_4TC : IXGBE_MAX_VFS_1TC; 317 (num_tc > 1) ? IXGBE_MAX_VFS_4TC : IXGBE_MAX_VFS_1TC;
@@ -716,7 +713,7 @@ static inline void ixgbe_vf_reset_event(struct ixgbe_adapter *adapter, u32 vf)
716{ 713{
717 struct ixgbe_hw *hw = &adapter->hw; 714 struct ixgbe_hw *hw = &adapter->hw;
718 struct vf_data_storage *vfinfo = &adapter->vfinfo[vf]; 715 struct vf_data_storage *vfinfo = &adapter->vfinfo[vf];
719 u8 num_tcs = netdev_get_num_tc(adapter->netdev); 716 u8 num_tcs = adapter->hw_tcs;
720 717
721 /* remove VLAN filters beloning to this VF */ 718 /* remove VLAN filters beloning to this VF */
722 ixgbe_clear_vf_vlans(adapter, vf); 719 ixgbe_clear_vf_vlans(adapter, vf);
@@ -924,7 +921,7 @@ static int ixgbe_set_vf_vlan_msg(struct ixgbe_adapter *adapter,
924{ 921{
925 u32 add = (msgbuf[0] & IXGBE_VT_MSGINFO_MASK) >> IXGBE_VT_MSGINFO_SHIFT; 922 u32 add = (msgbuf[0] & IXGBE_VT_MSGINFO_MASK) >> IXGBE_VT_MSGINFO_SHIFT;
926 u32 vid = (msgbuf[1] & IXGBE_VLVF_VLANID_MASK); 923 u32 vid = (msgbuf[1] & IXGBE_VLVF_VLANID_MASK);
927 u8 tcs = netdev_get_num_tc(adapter->netdev); 924 u8 tcs = adapter->hw_tcs;
928 925
929 if (adapter->vfinfo[vf].pf_vlan || tcs) { 926 if (adapter->vfinfo[vf].pf_vlan || tcs) {
930 e_warn(drv, 927 e_warn(drv,
@@ -1012,7 +1009,7 @@ static int ixgbe_get_vf_queues(struct ixgbe_adapter *adapter,
1012 struct net_device *dev = adapter->netdev; 1009 struct net_device *dev = adapter->netdev;
1013 struct ixgbe_ring_feature *vmdq = &adapter->ring_feature[RING_F_VMDQ]; 1010 struct ixgbe_ring_feature *vmdq = &adapter->ring_feature[RING_F_VMDQ];
1014 unsigned int default_tc = 0; 1011 unsigned int default_tc = 0;
1015 u8 num_tcs = netdev_get_num_tc(dev); 1012 u8 num_tcs = adapter->hw_tcs;
1016 1013
1017 /* verify the PF is supporting the correct APIs */ 1014 /* verify the PF is supporting the correct APIs */
1018 switch (adapter->vfinfo[vf].vf_api) { 1015 switch (adapter->vfinfo[vf].vf_api) {
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_x550.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_x550.c
index cb7da5f9c4da..3bce26e77090 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_x550.c
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_x550.c
@@ -1642,10 +1642,12 @@ static s32 ixgbe_supported_sfp_modules_X550em(struct ixgbe_hw *hw, bool *linear)
1642} 1642}
1643 1643
1644/** 1644/**
1645 * ixgbe_setup_mac_link_sfp_x550em - Configure the KR PHY for SFP. 1645 * ixgbe_setup_mac_link_sfp_x550em - Configure the KR PHY for SFP.
1646 * @hw: pointer to hardware structure 1646 * @hw: pointer to hardware structure
1647 * @speed: the link speed to force
1648 * @autoneg_wait_to_complete: unused
1647 * 1649 *
1648 * Configures the extern PHY and the integrated KR PHY for SFP support. 1650 * Configures the extern PHY and the integrated KR PHY for SFP support.
1649 */ 1651 */
1650static s32 1652static s32
1651ixgbe_setup_mac_link_sfp_x550em(struct ixgbe_hw *hw, 1653ixgbe_setup_mac_link_sfp_x550em(struct ixgbe_hw *hw,
@@ -1737,6 +1739,8 @@ static s32 ixgbe_setup_sfi_x550a(struct ixgbe_hw *hw, ixgbe_link_speed *speed)
1737/** 1739/**
1738 * ixgbe_setup_mac_link_sfp_n - Setup internal PHY for native SFP 1740 * ixgbe_setup_mac_link_sfp_n - Setup internal PHY for native SFP
1739 * @hw: pointer to hardware structure 1741 * @hw: pointer to hardware structure
1742 * @speed: link speed
1743 * @autoneg_wait_to_complete: unused
1740 * 1744 *
1741 * Configure the the integrated PHY for native SFP support. 1745 * Configure the the integrated PHY for native SFP support.
1742 */ 1746 */
@@ -1784,6 +1788,8 @@ ixgbe_setup_mac_link_sfp_n(struct ixgbe_hw *hw, ixgbe_link_speed speed,
1784/** 1788/**
1785 * ixgbe_setup_mac_link_sfp_x550a - Setup internal PHY for SFP 1789 * ixgbe_setup_mac_link_sfp_x550a - Setup internal PHY for SFP
1786 * @hw: pointer to hardware structure 1790 * @hw: pointer to hardware structure
1791 * @speed: link speed
1792 * @autoneg_wait_to_complete: unused
1787 * 1793 *
1788 * Configure the the integrated PHY for SFP support. 1794 * Configure the the integrated PHY for SFP support.
1789 */ 1795 */
@@ -1859,7 +1865,7 @@ ixgbe_setup_mac_link_sfp_x550a(struct ixgbe_hw *hw, ixgbe_link_speed speed,
1859 * ixgbe_setup_mac_link_t_X550em - Sets the auto advertised link speed 1865 * ixgbe_setup_mac_link_t_X550em - Sets the auto advertised link speed
1860 * @hw: pointer to hardware structure 1866 * @hw: pointer to hardware structure
1861 * @speed: new link speed 1867 * @speed: new link speed
1862 * @autoneg_wait_to_complete: true when waiting for completion is needed 1868 * @autoneg_wait: true when waiting for completion is needed
1863 * 1869 *
1864 * Setup internal/external PHY link speed based on link speed, then set 1870 * Setup internal/external PHY link speed based on link speed, then set
1865 * external PHY auto advertised link speed. 1871 * external PHY auto advertised link speed.
@@ -1943,6 +1949,8 @@ static s32 ixgbe_check_link_t_X550em(struct ixgbe_hw *hw,
1943/** 1949/**
1944 * ixgbe_setup_sgmii - Set up link for sgmii 1950 * ixgbe_setup_sgmii - Set up link for sgmii
1945 * @hw: pointer to hardware structure 1951 * @hw: pointer to hardware structure
1952 * @speed: unused
1953 * @autoneg_wait_to_complete: unused
1946 */ 1954 */
1947static s32 1955static s32
1948ixgbe_setup_sgmii(struct ixgbe_hw *hw, __always_unused ixgbe_link_speed speed, 1956ixgbe_setup_sgmii(struct ixgbe_hw *hw, __always_unused ixgbe_link_speed speed,
@@ -2014,6 +2022,8 @@ ixgbe_setup_sgmii(struct ixgbe_hw *hw, __always_unused ixgbe_link_speed speed,
2014/** 2022/**
2015 * ixgbe_setup_sgmii_fw - Set up link for sgmii with firmware-controlled PHYs 2023 * ixgbe_setup_sgmii_fw - Set up link for sgmii with firmware-controlled PHYs
2016 * @hw: pointer to hardware structure 2024 * @hw: pointer to hardware structure
2025 * @speed: the link speed to force
2026 * @autoneg_wait: true when waiting for completion is needed
2017 */ 2027 */
2018static s32 ixgbe_setup_sgmii_fw(struct ixgbe_hw *hw, ixgbe_link_speed speed, 2028static s32 ixgbe_setup_sgmii_fw(struct ixgbe_hw *hw, ixgbe_link_speed speed,
2019 bool autoneg_wait) 2029 bool autoneg_wait)
@@ -3735,6 +3745,7 @@ static void ixgbe_release_swfw_sync_x550em_a(struct ixgbe_hw *hw, u32 mask)
3735 * ixgbe_read_phy_reg_x550a - Reads specified PHY register 3745 * ixgbe_read_phy_reg_x550a - Reads specified PHY register
3736 * @hw: pointer to hardware structure 3746 * @hw: pointer to hardware structure
3737 * @reg_addr: 32 bit address of PHY register to read 3747 * @reg_addr: 32 bit address of PHY register to read
3748 * @device_type: 5 bit device type
3738 * @phy_data: Pointer to read data from PHY register 3749 * @phy_data: Pointer to read data from PHY register
3739 * 3750 *
3740 * Reads a value from a specified PHY register using the SWFW lock and PHY 3751 * Reads a value from a specified PHY register using the SWFW lock and PHY
diff --git a/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c b/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c
index 573f743b556a..ed5c3aea7939 100644
--- a/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c
+++ b/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c
@@ -554,7 +554,6 @@ static void ixgbevf_process_skb_fields(struct ixgbevf_ring *rx_ring,
554 * ixgbevf_is_non_eop - process handling of non-EOP buffers 554 * ixgbevf_is_non_eop - process handling of non-EOP buffers
555 * @rx_ring: Rx ring being processed 555 * @rx_ring: Rx ring being processed
556 * @rx_desc: Rx descriptor for current buffer 556 * @rx_desc: Rx descriptor for current buffer
557 * @skb: current socket buffer containing buffer in progress
558 * 557 *
559 * This function updates next to clean. If the buffer is an EOP buffer 558 * This function updates next to clean. If the buffer is an EOP buffer
560 * this function exits returning false, otherwise it will place the 559 * this function exits returning false, otherwise it will place the
@@ -2741,7 +2740,7 @@ void ixgbevf_update_stats(struct ixgbevf_adapter *adapter)
2741 2740
2742/** 2741/**
2743 * ixgbevf_service_timer - Timer Call-back 2742 * ixgbevf_service_timer - Timer Call-back
2744 * @data: pointer to adapter cast into an unsigned long 2743 * @t: pointer to timer_list struct
2745 **/ 2744 **/
2746static void ixgbevf_service_timer(struct timer_list *t) 2745static void ixgbevf_service_timer(struct timer_list *t)
2747{ 2746{
@@ -2884,7 +2883,7 @@ static void ixgbevf_watchdog_link_is_down(struct ixgbevf_adapter *adapter)
2884 2883
2885/** 2884/**
2886 * ixgbevf_watchdog_subtask - worker thread to bring link up 2885 * ixgbevf_watchdog_subtask - worker thread to bring link up
2887 * @work: pointer to work_struct containing our data 2886 * @adapter: board private structure
2888 **/ 2887 **/
2889static void ixgbevf_watchdog_subtask(struct ixgbevf_adapter *adapter) 2888static void ixgbevf_watchdog_subtask(struct ixgbevf_adapter *adapter)
2890{ 2889{
@@ -4364,6 +4363,7 @@ static void __exit ixgbevf_exit_module(void)
4364/** 4363/**
4365 * ixgbevf_get_hw_dev_name - return device name string 4364 * ixgbevf_get_hw_dev_name - return device name string
4366 * used by hardware layer to print debugging information 4365 * used by hardware layer to print debugging information
4366 * @hw: pointer to private hardware struct
4367 **/ 4367 **/
4368char *ixgbevf_get_hw_dev_name(struct ixgbe_hw *hw) 4368char *ixgbevf_get_hw_dev_name(struct ixgbe_hw *hw)
4369{ 4369{
diff --git a/drivers/net/ethernet/intel/ixgbevf/vf.c b/drivers/net/ethernet/intel/ixgbevf/vf.c
index 0c25006ce9af..64c93e8becc6 100644
--- a/drivers/net/ethernet/intel/ixgbevf/vf.c
+++ b/drivers/net/ethernet/intel/ixgbevf/vf.c
@@ -146,6 +146,7 @@ static s32 ixgbevf_reset_hw_vf(struct ixgbe_hw *hw)
146/** 146/**
147 * Hyper-V variant; the VF/PF communication is through the PCI 147 * Hyper-V variant; the VF/PF communication is through the PCI
148 * config space. 148 * config space.
149 * @hw: pointer to private hardware struct
149 */ 150 */
150static s32 ixgbevf_hv_reset_hw_vf(struct ixgbe_hw *hw) 151static s32 ixgbevf_hv_reset_hw_vf(struct ixgbe_hw *hw)
151{ 152{
@@ -303,7 +304,7 @@ static s32 ixgbevf_hv_set_uc_addr_vf(struct ixgbe_hw *hw, u32 index, u8 *addr)
303 304
304/** 305/**
305 * ixgbevf_get_reta_locked - get the RSS redirection table (RETA) contents. 306 * ixgbevf_get_reta_locked - get the RSS redirection table (RETA) contents.
306 * @adapter: pointer to the port handle 307 * @hw: pointer to hardware structure
307 * @reta: buffer to fill with RETA contents. 308 * @reta: buffer to fill with RETA contents.
308 * @num_rx_queues: Number of Rx queues configured for this port 309 * @num_rx_queues: Number of Rx queues configured for this port
309 * 310 *
@@ -536,6 +537,8 @@ static s32 ixgbevf_update_mc_addr_list_vf(struct ixgbe_hw *hw,
536 537
537/** 538/**
538 * Hyper-V variant - just a stub. 539 * Hyper-V variant - just a stub.
540 * @hw: unused
541 * @netdev: unused
539 */ 542 */
540static s32 ixgbevf_hv_update_mc_addr_list_vf(struct ixgbe_hw *hw, 543static s32 ixgbevf_hv_update_mc_addr_list_vf(struct ixgbe_hw *hw,
541 struct net_device *netdev) 544 struct net_device *netdev)
@@ -584,6 +587,8 @@ static s32 ixgbevf_update_xcast_mode(struct ixgbe_hw *hw, int xcast_mode)
584 587
585/** 588/**
586 * Hyper-V variant - just a stub. 589 * Hyper-V variant - just a stub.
590 * @hw: unused
591 * @xcast_mode: unused
587 */ 592 */
588static s32 ixgbevf_hv_update_xcast_mode(struct ixgbe_hw *hw, int xcast_mode) 593static s32 ixgbevf_hv_update_xcast_mode(struct ixgbe_hw *hw, int xcast_mode)
589{ 594{
@@ -626,6 +631,10 @@ mbx_err:
626 631
627/** 632/**
628 * Hyper-V variant - just a stub. 633 * Hyper-V variant - just a stub.
634 * @hw: unused
635 * @vlan: unused
636 * @vind: unused
637 * @vlan_on: unused
629 */ 638 */
630static s32 ixgbevf_hv_set_vfta_vf(struct ixgbe_hw *hw, u32 vlan, u32 vind, 639static s32 ixgbevf_hv_set_vfta_vf(struct ixgbe_hw *hw, u32 vlan, u32 vind,
631 bool vlan_on) 640 bool vlan_on)
@@ -655,7 +664,7 @@ static s32 ixgbevf_setup_mac_link_vf(struct ixgbe_hw *hw,
655 * @hw: pointer to hardware structure 664 * @hw: pointer to hardware structure
656 * @speed: pointer to link speed 665 * @speed: pointer to link speed
657 * @link_up: true is link is up, false otherwise 666 * @link_up: true is link is up, false otherwise
658 * @autoneg_wait_to_complete: true when waiting for completion is needed 667 * @autoneg_wait_to_complete: unused
659 * 668 *
660 * Reads the links register to determine if link is up and the current speed 669 * Reads the links register to determine if link is up and the current speed
661 **/ 670 **/
@@ -740,6 +749,10 @@ out:
740 749
741/** 750/**
742 * Hyper-V variant; there is no mailbox communication. 751 * Hyper-V variant; there is no mailbox communication.
752 * @hw: pointer to private hardware struct
753 * @speed: pointer to link speed
754 * @link_up: true is link is up, false otherwise
755 * @autoneg_wait_to_complete: unused
743 */ 756 */
744static s32 ixgbevf_hv_check_mac_link_vf(struct ixgbe_hw *hw, 757static s32 ixgbevf_hv_check_mac_link_vf(struct ixgbe_hw *hw,
745 ixgbe_link_speed *speed, 758 ixgbe_link_speed *speed,