Skip to content

Commit 9bc4a1c

Browse files
committed
Merge branch '10GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/jkirsher/next-queue
Jeff Kirsher says: ==================== 10GbE Intel Wired LAN Driver Updates 2016-07-22 This series contains updates to ixgbe and ixgbevf only. Emil fixes the NACK check in ixgbevf_set_uc_addr_vf() for instances where the index is not equal to zero. Fixes an issue where mac->ops.setup_fc can be NULL for backplanes which can cause the driver to crash on load. Don fixes the second parameter of the LED functions, which is the index to the LED we are interested in affecting. Fixed variable to store register reads to unsigned integer. Adds support for the new x553 hardware into ixgbevf. Fixed a missing rtnl lock around ixgbevf_reinit_locked(). Fixed an issue where in ixgbevf_reset_subtask() was not verifying that the port has been removed. Cleans up the initial crosstalk fix, since the SFP that indicates the presence of a SFP+ module changes between hardware types. Babu Moger fixes typo in freeing IRQ, since the array subscript increments after the execution of the statement. Wei Yongjun adds the missing destroy_workqueue() before returning from ixgbe_init_module() in the error handling case. Tony adds range checking for setting the MTU from the VF, where the PF can return a NACK but this was not passed on to the VF, so propagate the results from the PF to the VF so errors can be reported. Consolidates mailbox read and write functions, since the recent changes to ixgbevf_write_msg_read_ack(), other functions are performing the same operations done here. Colin Ian King removes a redundant check on ret_val, since ret_val has not changed since the previous check. ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
2 parents d3e6952 + aac9e05 commit 9bc4a1c

File tree

12 files changed

+160
-107
lines changed

12 files changed

+160
-107
lines changed

drivers/net/ethernet/intel/ixgbe/ixgbe.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -804,8 +804,6 @@ struct ixgbe_adapter {
804804

805805
#define IXGBE_RSS_KEY_SIZE 40 /* size of RSS Hash Key in bytes */
806806
u32 rss_key[IXGBE_RSS_KEY_SIZE / sizeof(u32)];
807-
808-
bool need_crosstalk_fix;
809807
};
810808

811809
static inline u8 ixgbe_max_rss_indices(struct ixgbe_adapter *adapter)

drivers/net/ethernet/intel/ixgbe/ixgbe_82599.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1813,9 +1813,6 @@ static s32 ixgbe_start_hw_82599(struct ixgbe_hw *hw)
18131813
/* We need to run link autotry after the driver loads */
18141814
hw->mac.autotry_restart = true;
18151815

1816-
if (ret_val)
1817-
return ret_val;
1818-
18191816
return ixgbe_verify_fw_version_82599(hw);
18201817
}
18211818

drivers/net/ethernet/intel/ixgbe/ixgbe_common.c

Lines changed: 84 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -277,6 +277,7 @@ s32 ixgbe_start_hw_generic(struct ixgbe_hw *hw)
277277
{
278278
s32 ret_val;
279279
u32 ctrl_ext;
280+
u16 device_caps;
280281

281282
/* Set the media type */
282283
hw->phy.media_type = hw->mac.ops.get_media_type(hw);
@@ -301,6 +302,22 @@ s32 ixgbe_start_hw_generic(struct ixgbe_hw *hw)
301302
if (ret_val)
302303
return ret_val;
303304

305+
/* Cashe bit indicating need for crosstalk fix */
306+
switch (hw->mac.type) {
307+
case ixgbe_mac_82599EB:
308+
case ixgbe_mac_X550EM_x:
309+
case ixgbe_mac_x550em_a:
310+
hw->mac.ops.get_device_caps(hw, &device_caps);
311+
if (device_caps & IXGBE_DEVICE_CAPS_NO_CROSSTALK_WR)
312+
hw->need_crosstalk_fix = false;
313+
else
314+
hw->need_crosstalk_fix = true;
315+
break;
316+
default:
317+
hw->need_crosstalk_fix = false;
318+
break;
319+
}
320+
304321
/* Clear adapter stopped flag */
305322
hw->adapter_stopped = false;
306323

@@ -763,6 +780,9 @@ s32 ixgbe_led_on_generic(struct ixgbe_hw *hw, u32 index)
763780
{
764781
u32 led_reg = IXGBE_READ_REG(hw, IXGBE_LEDCTL);
765782

783+
if (index > 3)
784+
return IXGBE_ERR_PARAM;
785+
766786
/* To turn on the LED, set mode to ON. */
767787
led_reg &= ~IXGBE_LED_MODE_MASK(index);
768788
led_reg |= IXGBE_LED_ON << IXGBE_LED_MODE_SHIFT(index);
@@ -781,6 +801,9 @@ s32 ixgbe_led_off_generic(struct ixgbe_hw *hw, u32 index)
781801
{
782802
u32 led_reg = IXGBE_READ_REG(hw, IXGBE_LEDCTL);
783803

804+
if (index > 3)
805+
return IXGBE_ERR_PARAM;
806+
784807
/* To turn off the LED, set mode to OFF. */
785808
led_reg &= ~IXGBE_LED_MODE_MASK(index);
786809
led_reg |= IXGBE_LED_OFF << IXGBE_LED_MODE_SHIFT(index);
@@ -2657,7 +2680,7 @@ s32 ixgbe_disable_rx_buff_generic(struct ixgbe_hw *hw)
26572680
**/
26582681
s32 ixgbe_enable_rx_buff_generic(struct ixgbe_hw *hw)
26592682
{
2660-
int secrxreg;
2683+
u32 secrxreg;
26612684

26622685
secrxreg = IXGBE_READ_REG(hw, IXGBE_SECRXCTRL);
26632686
secrxreg &= ~IXGBE_SECRXCTRL_RX_DIS;
@@ -2698,6 +2721,9 @@ s32 ixgbe_blink_led_start_generic(struct ixgbe_hw *hw, u32 index)
26982721
bool locked = false;
26992722
s32 ret_val;
27002723

2724+
if (index > 3)
2725+
return IXGBE_ERR_PARAM;
2726+
27012727
/*
27022728
* Link must be up to auto-blink the LEDs;
27032729
* Force it if link is down.
@@ -2741,6 +2767,9 @@ s32 ixgbe_blink_led_stop_generic(struct ixgbe_hw *hw, u32 index)
27412767
bool locked = false;
27422768
s32 ret_val;
27432769

2770+
if (index > 3)
2771+
return IXGBE_ERR_PARAM;
2772+
27442773
ret_val = hw->mac.ops.prot_autoc_read(hw, &locked, &autoc_reg);
27452774
if (ret_val)
27462775
return ret_val;
@@ -3187,6 +3216,31 @@ s32 ixgbe_clear_vfta_generic(struct ixgbe_hw *hw)
31873216
return 0;
31883217
}
31893218

3219+
/**
3220+
* ixgbe_need_crosstalk_fix - Determine if we need to do cross talk fix
3221+
* @hw: pointer to hardware structure
3222+
*
3223+
* Contains the logic to identify if we need to verify link for the
3224+
* crosstalk fix
3225+
**/
3226+
static bool ixgbe_need_crosstalk_fix(struct ixgbe_hw *hw)
3227+
{
3228+
/* Does FW say we need the fix */
3229+
if (!hw->need_crosstalk_fix)
3230+
return false;
3231+
3232+
/* Only consider SFP+ PHYs i.e. media type fiber */
3233+
switch (hw->mac.ops.get_media_type(hw)) {
3234+
case ixgbe_media_type_fiber:
3235+
case ixgbe_media_type_fiber_qsfp:
3236+
break;
3237+
default:
3238+
return false;
3239+
}
3240+
3241+
return true;
3242+
}
3243+
31903244
/**
31913245
* ixgbe_check_mac_link_generic - Determine link and speed status
31923246
* @hw: pointer to hardware structure
@@ -3202,6 +3256,35 @@ s32 ixgbe_check_mac_link_generic(struct ixgbe_hw *hw, ixgbe_link_speed *speed,
32023256
u32 links_reg, links_orig;
32033257
u32 i;
32043258

3259+
/* If Crosstalk fix enabled do the sanity check of making sure
3260+
* the SFP+ cage is full.
3261+
*/
3262+
if (ixgbe_need_crosstalk_fix(hw)) {
3263+
u32 sfp_cage_full;
3264+
3265+
switch (hw->mac.type) {
3266+
case ixgbe_mac_82599EB:
3267+
sfp_cage_full = IXGBE_READ_REG(hw, IXGBE_ESDP) &
3268+
IXGBE_ESDP_SDP2;
3269+
break;
3270+
case ixgbe_mac_X550EM_x:
3271+
case ixgbe_mac_x550em_a:
3272+
sfp_cage_full = IXGBE_READ_REG(hw, IXGBE_ESDP) &
3273+
IXGBE_ESDP_SDP0;
3274+
break;
3275+
default:
3276+
/* sanity check - No SFP+ devices here */
3277+
sfp_cage_full = false;
3278+
break;
3279+
}
3280+
3281+
if (!sfp_cage_full) {
3282+
*link_up = false;
3283+
*speed = IXGBE_LINK_SPEED_UNKNOWN;
3284+
return 0;
3285+
}
3286+
}
3287+
32053288
/* clear the old state */
32063289
links_orig = IXGBE_READ_REG(hw, IXGBE_LINKS);
32073290

drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2204,11 +2204,11 @@ static int ixgbe_set_phys_id(struct net_device *netdev,
22042204
return 2;
22052205

22062206
case ETHTOOL_ID_ON:
2207-
hw->mac.ops.led_on(hw, IXGBE_LED_ON);
2207+
hw->mac.ops.led_on(hw, hw->bus.func);
22082208
break;
22092209

22102210
case ETHTOOL_ID_OFF:
2211-
hw->mac.ops.led_off(hw, IXGBE_LED_ON);
2211+
hw->mac.ops.led_off(hw, hw->bus.func);
22122212
break;
22132213

22142214
case ETHTOOL_ID_INACTIVE:

drivers/net/ethernet/intel/ixgbe/ixgbe_main.c

Lines changed: 2 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -3084,7 +3084,7 @@ static void ixgbe_free_irq(struct ixgbe_adapter *adapter)
30843084
free_irq(entry->vector, q_vector);
30853085
}
30863086

3087-
free_irq(adapter->msix_entries[vector++].vector, adapter);
3087+
free_irq(adapter->msix_entries[vector].vector, adapter);
30883088
}
30893089

30903090
/**
@@ -5625,7 +5625,6 @@ static int ixgbe_sw_init(struct ixgbe_adapter *adapter)
56255625
struct pci_dev *pdev = adapter->pdev;
56265626
unsigned int rss, fdir;
56275627
u32 fwsm;
5628-
u16 device_caps;
56295628
int i;
56305629

56315630
/* PCI config space info */
@@ -5771,22 +5770,6 @@ static int ixgbe_sw_init(struct ixgbe_adapter *adapter)
57715770
adapter->tx_ring_count = IXGBE_DEFAULT_TXD;
57725771
adapter->rx_ring_count = IXGBE_DEFAULT_RXD;
57735772

5774-
/* Cache bit indicating need for crosstalk fix */
5775-
switch (hw->mac.type) {
5776-
case ixgbe_mac_82599EB:
5777-
case ixgbe_mac_X550EM_x:
5778-
case ixgbe_mac_x550em_a:
5779-
hw->mac.ops.get_device_caps(hw, &device_caps);
5780-
if (device_caps & IXGBE_DEVICE_CAPS_NO_CROSSTALK_WR)
5781-
adapter->need_crosstalk_fix = false;
5782-
else
5783-
adapter->need_crosstalk_fix = true;
5784-
break;
5785-
default:
5786-
adapter->need_crosstalk_fix = false;
5787-
break;
5788-
}
5789-
57905773
/* set default work limits */
57915774
adapter->tx_work_limit = IXGBE_DEFAULT_TX_WORK;
57925775

@@ -6707,18 +6690,6 @@ static void ixgbe_watchdog_update_link(struct ixgbe_adapter *adapter)
67076690
link_up = true;
67086691
}
67096692

6710-
/* If Crosstalk fix enabled do the sanity check of making sure
6711-
* the SFP+ cage is empty.
6712-
*/
6713-
if (adapter->need_crosstalk_fix) {
6714-
u32 sfp_cage_full;
6715-
6716-
sfp_cage_full = IXGBE_READ_REG(hw, IXGBE_ESDP) &
6717-
IXGBE_ESDP_SDP2;
6718-
if (ixgbe_is_sfp(hw) && link_up && !sfp_cage_full)
6719-
link_up = false;
6720-
}
6721-
67226693
if (adapter->ixgbe_ieee_pfc)
67236694
pfc_en |= !!(adapter->ixgbe_ieee_pfc->pfc_en);
67246695

@@ -7065,16 +7036,6 @@ static void ixgbe_sfp_detection_subtask(struct ixgbe_adapter *adapter)
70657036
struct ixgbe_hw *hw = &adapter->hw;
70667037
s32 err;
70677038

7068-
/* If crosstalk fix enabled verify the SFP+ cage is full */
7069-
if (adapter->need_crosstalk_fix) {
7070-
u32 sfp_cage_full;
7071-
7072-
sfp_cage_full = IXGBE_READ_REG(hw, IXGBE_ESDP) &
7073-
IXGBE_ESDP_SDP2;
7074-
if (!sfp_cage_full)
7075-
return;
7076-
}
7077-
70787039
/* not searching for SFP so there is nothing to do here */
70797040
if (!(adapter->flags2 & IXGBE_FLAG2_SEARCH_FOR_SFP) &&
70807041
!(adapter->flags2 & IXGBE_FLAG2_SFP_NEEDS_RESET))
@@ -10112,6 +10073,7 @@ static int __init ixgbe_init_module(void)
1011210073

1011310074
ret = pci_register_driver(&ixgbe_driver);
1011410075
if (ret) {
10076+
destroy_workqueue(ixgbe_wq);
1011510077
ixgbe_dbg_exit();
1011610078
return ret;
1011710079
}

drivers/net/ethernet/intel/ixgbe/ixgbe_type.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3525,6 +3525,7 @@ struct ixgbe_hw {
35253525
bool force_full_reset;
35263526
bool allow_unsupported_sfp;
35273527
bool wol_enabled;
3528+
bool need_crosstalk_fix;
35283529
};
35293530

35303531
struct ixgbe_info {

drivers/net/ethernet/intel/ixgbe/ixgbe_x550.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1618,6 +1618,8 @@ static void ixgbe_init_mac_link_ops_X550em(struct ixgbe_hw *hw)
16181618
{
16191619
struct ixgbe_mac_info *mac = &hw->mac;
16201620

1621+
mac->ops.setup_fc = ixgbe_setup_fc_x550em;
1622+
16211623
switch (mac->ops.get_media_type(hw)) {
16221624
case ixgbe_media_type_fiber:
16231625
/* CS4227 does not support autoneg, so disable the laser control
@@ -1627,7 +1629,6 @@ static void ixgbe_init_mac_link_ops_X550em(struct ixgbe_hw *hw)
16271629
mac->ops.enable_tx_laser = NULL;
16281630
mac->ops.flap_tx_laser = NULL;
16291631
mac->ops.setup_link = ixgbe_setup_mac_link_multispeed_fiber;
1630-
mac->ops.setup_fc = ixgbe_setup_fc_x550em;
16311632
switch (hw->device_id) {
16321633
case IXGBE_DEV_ID_X550EM_A_SFP_N:
16331634
mac->ops.setup_mac_link = ixgbe_setup_mac_link_sfp_n;
@@ -1655,7 +1656,6 @@ static void ixgbe_init_mac_link_ops_X550em(struct ixgbe_hw *hw)
16551656
mac->ops.setup_link = ixgbe_setup_sgmii;
16561657
break;
16571658
default:
1658-
mac->ops.setup_fc = ixgbe_setup_fc_x550em;
16591659
break;
16601660
}
16611661
}

drivers/net/ethernet/intel/ixgbevf/defines.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
#define IXGBE_DEV_ID_X540_VF 0x1515
3333
#define IXGBE_DEV_ID_X550_VF 0x1565
3434
#define IXGBE_DEV_ID_X550EM_X_VF 0x15A8
35+
#define IXGBE_DEV_ID_X550EM_A_VF 0x15C5
3536

3637
#define IXGBE_DEV_ID_82599_VF_HV 0x152E
3738
#define IXGBE_DEV_ID_X540_VF_HV 0x1530

drivers/net/ethernet/intel/ixgbevf/ixgbevf.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -457,6 +457,7 @@ enum ixgbevf_boards {
457457
board_X550_vf_hv,
458458
board_X550EM_x_vf,
459459
board_X550EM_x_vf_hv,
460+
board_x550em_a_vf,
460461
};
461462

462463
enum ixgbevf_xcast_modes {
@@ -470,6 +471,7 @@ extern const struct ixgbevf_info ixgbevf_X540_vf_info;
470471
extern const struct ixgbevf_info ixgbevf_X550_vf_info;
471472
extern const struct ixgbevf_info ixgbevf_X550EM_x_vf_info;
472473
extern const struct ixgbe_mbx_operations ixgbevf_mbx_ops;
474+
extern const struct ixgbevf_info ixgbevf_x550em_a_vf_info;
473475

474476
extern const struct ixgbevf_info ixgbevf_82599_vf_hv_info;
475477
extern const struct ixgbevf_info ixgbevf_X540_vf_hv_info;

0 commit comments

Comments
 (0)