ixgbe: Enable ACPI WoL capabilities for 82599
Subsystems (2)
PATCH 1/6 ixgbe: Enable ACPI WoL capabilities for 82599
From: Peter P Waskiewicz Jr <[email protected]>
The 82599 KX4 device defaults to legacy power management, or APME. This puts the device into ACPI mode, which allows more robust WoL setups to work properly.
---
drivers/net/ixgbe/ixgbe_main.c | 3 +++ 1 files changed, 3 insertions(+), 0 deletions(-)
drivers/net/ixgbe/ixgbe_main.c +3 -0
@@ -5282,6 +5282,9 @@ static int __devinit ixgbe_probe(struct pci_dev *pdev,case IXGBE_DEV_ID_82599_KX4 : adapter->wol = (IXGBE_WUFC_MAG |IXGBE_WUFC_EX |IXGBE_WUFC_MC |IXGBE_WUFC_BC ); +/* Enable ACPI wakeup in GRC */ +IXGBE_WRITE_REG (hw,IXGBE_GRC , + (IXGBE_READ_REG (hw,IXGBE_GRC ) & ~IXGBE_GRC_APME ));break ;default : adapter->wol =0 ;
PATCH 2/6 ixgbe: Change the 82599 PHY DSP restart logic
From: Peter P Waskiewicz Jr <[email protected]>
When reprogramming the 82599 analog PHY to either SFI optical or Direct Attach Twinax, we need to restart the DSP in the PHY. The current method can cause contention with our FW which is managing PHY state, and will cause unexpected link flaps. This patch fixes the DSP restart by issuing an AN_RESTART in the MAC, which will properly propagate the DSP restart to the PHY. This ensures we don't collide with the FW.
---
drivers/net/ixgbe/ixgbe_82599.c | 7 +++---- 1 files changed, 3 insertions(+), 4 deletions(-)
drivers/net/ixgbe/ixgbe_82599.c +3 -4
@@ -122,10 +122,9 @@ s32 ixgbe_setup_sfp_modules_82599(struct ixgbe_hw *hw)IXGBE_WRITE_FLUSH (hw); hw->eeprom.ops.read (hw, ++data_offset, &data_value); } -/* Now restart DSP */ -IXGBE_WRITE_REG (hw,IXGBE_CORECTL ,0x00000102 ); -IXGBE_WRITE_REG (hw,IXGBE_CORECTL ,0x00000b1d ); -IXGBE_WRITE_FLUSH (hw); +/* Now restart DSP by setting Restart_AN */ +IXGBE_WRITE_REG (hw,IXGBE_AUTOC , + (IXGBE_READ_REG (hw,IXGBE_AUTOC ) |IXGBE_AUTOC_AN_RESTART ));/* Release the semaphore */ ixgbe_release_swfw_sync (hw,IXGBE_GSSR_MAC_CSR_SM );
PATCH 3/6 ixgbe: Add ethtool offline test support
In reply to Jeff KirsherFrom: Peter P Waskiewicz Jr <[email protected]>
This patch adds support for the ethtool internal test engine.
---
drivers/net/ixgbe/ixgbe.h | 8 drivers/net/ixgbe/ixgbe_ethtool.c | 824 +++++++++++++++++++++++++++++++++++++ drivers/net/ixgbe/ixgbe_main.c | 13 - 3 files changed, 842 insertions(+), 3 deletions(-)
drivers/net/ixgbe/ixgbe.h +8 -0
@@ -223,6 +223,10 @@ struct ixgbe_q_vector {#define IXGBE_TX_CTXTDESC_ADV (R , i) \ (&(((struct ixgbe_adv_tx_context_desc *)((R).desc))[i])) +#define IXGBE_GET_DESC (R , i, type) (&(((struct type *)((R).desc))[i])) +#define IXGBE_TX_DESC (R , i) IXGBE_GET_DESC(R, i, ixgbe_legacy_tx_desc) +#define IXGBE_RX_DESC (R , i) IXGBE_GET_DESC(R, i, ixgbe_legacy_rx_desc) +#define IXGBE_MAX_JUMBO_FRAME_SIZE 16128#ifdef IXGBE_FCOE /* Use 3K as the baby jumbo frame size for FCoE */
@@ -327,6 +331,10 @@ struct ixgbe_adapter {struct pci_dev *pdev;struct net_device_stats net_stats; +u32 test_icr; +struct ixgbe_ring test_tx_ring; +struct ixgbe_ring test_rx_ring; +/* structs defined in ixgbe_hw.h */ struct ixgbe_hw hw;u16 msg_enable;
drivers/net/ixgbe/ixgbe_ethtool.c +824 -0
860 lines not on this page · raw message
drivers/net/ixgbe/ixgbe_main.c +10 -3
@@ -2598,12 +2598,19 @@ void ixgbe_reset(struct ixgbe_adapter *adapter)int err; err = hw->mac.ops.init_hw (hw); -if (err && (err !=IXGBE_ERR_SFP_NOT_PRESENT )) -dev_err (&adapter->pdev->dev,"Hardware Error\n" ); +switch (err) { +case 0 : +case IXGBE_ERR_SFP_NOT_PRESENT : +break ; +case IXGBE_ERR_MASTER_REQUESTS_PENDING : +dev_err (&adapter->pdev->dev,"master disable timed out\n" ); +break ; +default : +dev_err (&adapter->pdev->dev,"Hardware Error: %d\n" , err); + }/* reprogram the RAR[0] in case user changed it. */ hw->mac.ops.set_rar (hw,0 , hw->mac.addr,0 ,IXGBE_RAH_AV ); - }/**
PATCH 4/6 ixgbe: Harden the 82599 multispeed fiber autotry mechanism
In reply to Jeff KirsherFrom: Peter P Waskiewicz Jr <[email protected]>
82599 supports multispeed fiber optical modules (10Gbps/1Gbps). Some scenarios can cause the autotry mechanism to not negotiate link properly. What needs to happen is the driver must flap the Tx laser to induce an Rx Loss of Signal on the link partner. This will restart the autotry mechanism to get link into a known state. The software definable pin (SDP) 3 on the 0x10fb NIC is wired to cause a Tx LOS event, which triggers the Rx LOS we require.
---
drivers/net/ixgbe/ixgbe_82599.c | 120 +++++++++++++++++++++++++++++++------- drivers/net/ixgbe/ixgbe_common.c | 1 drivers/net/ixgbe/ixgbe_phy.c | 1 drivers/net/ixgbe/ixgbe_type.h | 7 ++ 4 files changed, 106 insertions(+), 23 deletions(-)
drivers/net/ixgbe/ixgbe_82599.c +99 -21
@@ -461,12 +461,23 @@ s32 ixgbe_setup_mac_link_speed_multispeed_fiber(struct ixgbe_hw *hw,u32 esdp_reg =IXGBE_READ_REG (hw,IXGBE_ESDP );bool link_up = false;bool negotiation; +int i;/* Mask off requested but non-supported speeds */ hw->mac.ops.get_link_capabilities (hw, &phy_link_speed, &negotiation); speed &= phy_link_speed;/* +* When the driver changes the link speeds that it can support, +* it sets autotry_restart to true to indicate that we need to +* initiate a new autotry session with the link partner. To do +* so, we set the speed then disable and re-enable the tx laser, to +* alert the link partner that it also needs to restart autotry on its +* end. This is consistent with true clause 37 autoneg, which also +* involves a loss of signal. +*/ + +/* * Try each speed one by one, highest priority first. We do this in * software because 10gb fiber doesn't support speed autonegotiation. */
@@ -474,21 +485,52 @@ s32 ixgbe_setup_mac_link_speed_multispeed_fiber(struct ixgbe_hw *hw, speedcnt++; highest_link_speed =IXGBE_LINK_SPEED_10GB_FULL ; -/* Set hardware SDP's */ +/* If we already have link at this speed, just jump out */ + hw->mac.ops.check_link (hw, &phy_link_speed, &link_up, false); + +if ((phy_link_speed ==IXGBE_LINK_SPEED_10GB_FULL ) && link_up) + goto out; + +/* Set the module link speed */ esdp_reg |= (IXGBE_ESDP_SDP5_DIR |IXGBE_ESDP_SDP5 );IXGBE_WRITE_REG (hw,IXGBE_ESDP , esdp_reg); -ixgbe_setup_mac_link_speed_82599 (hw, -IXGBE_LINK_SPEED_10GB_FULL , - autoneg, - autoneg_wait_to_complete); - -msleep (50 ); +/* Allow module to change analog characteristics (1G->10G) */ +msleep (40 ); -/* If we have link, just jump out */ - hw->mac.ops.check_link (hw, &phy_link_speed, &link_up, false); -if (link_up) + status =ixgbe_setup_mac_link_speed_82599 (hw, +IXGBE_LINK_SPEED_10GB_FULL , + autoneg, + autoneg_wait_to_complete); +if (status !=0 ) goto out; + +/* Flap the tx laser if it has not already been done */ +if (hw->mac.autotry_restart) { +/* Disable tx laser; allow 100us to go dark per spec */ + esdp_reg |=IXGBE_ESDP_SDP3 ; +IXGBE_WRITE_REG (hw,IXGBE_ESDP , esdp_reg); +udelay (100 ); + +/* Enable tx laser; allow 2ms to light up per spec */ + esdp_reg &= ~IXGBE_ESDP_SDP3 ; +IXGBE_WRITE_REG (hw,IXGBE_ESDP , esdp_reg); +msleep (2 ); + + hw->mac.autotry_restart = false; + } + +/* The controller may take up to 500ms at 10g to acquire link */ +for (i =0 ; i <5 ; i++) { +/* Wait for the link partner to also set speed */ +msleep (100 ); + +/* If we have link, just jump out */ + hw->mac.ops.check_link (hw, &phy_link_speed, + &link_up, false); +if (link_up) + goto out; + } }if (speed &IXGBE_LINK_SPEED_1GB_FULL ) {
@@ -496,16 +538,44 @@ s32 ixgbe_setup_mac_link_speed_multispeed_fiber(struct ixgbe_hw *hw,if (highest_link_speed ==IXGBE_LINK_SPEED_UNKNOWN ) highest_link_speed =IXGBE_LINK_SPEED_1GB_FULL ; -/* Set hardware SDP's */ +/* If we already have link at this speed, just jump out */ + hw->mac.ops.check_link (hw, &phy_link_speed, &link_up, false); + +if ((phy_link_speed ==IXGBE_LINK_SPEED_1GB_FULL ) && link_up) + goto out; + +/* Set the module link speed */ esdp_reg &= ~IXGBE_ESDP_SDP5 ; esdp_reg |=IXGBE_ESDP_SDP5_DIR ;IXGBE_WRITE_REG (hw,IXGBE_ESDP , esdp_reg); -ixgbe_setup_mac_link_speed_82599 ( - hw,IXGBE_LINK_SPEED_1GB_FULL , autoneg, - autoneg_wait_to_complete); +/* Allow module to change analog characteristics (10G->1G) */ +msleep (40 ); -msleep (50 ); + status =ixgbe_setup_mac_link_speed_82599 (hw, +IXGBE_LINK_SPEED_1GB_FULL , + autoneg, + autoneg_wait_to_complete); +if (status !=0 ) + goto out; + +/* Flap the tx laser if it has not already been done */ +if (hw->mac.autotry_restart) { +/* Disable tx laser; allow 100us to go dark per spec */ + esdp_reg |=IXGBE_ESDP_SDP3 ; +IXGBE_WRITE_REG (hw,IXGBE_ESDP , esdp_reg); +udelay (100 ); + +/* Enable tx laser; allow 2ms to light up per spec */ + esdp_reg &= ~IXGBE_ESDP_SDP3 ; +IXGBE_WRITE_REG (hw,IXGBE_ESDP , esdp_reg); +msleep (2 ); + + hw->mac.autotry_restart = false; + } + +/* Wait for the link partner to also set speed */ +msleep (100 );/* If we have link, just jump out */ hw->mac.ops.check_link (hw, &phy_link_speed, &link_up, false);
@@ -591,6 +661,7 @@ s32 ixgbe_setup_mac_link_speed_82599(struct ixgbe_hw *hw,s32 status =0 ;u32 autoc =IXGBE_READ_REG (hw,IXGBE_AUTOC );u32 autoc2 =IXGBE_READ_REG (hw,IXGBE_AUTOC2 ); +u32 start_autoc = autoc;u32 orig_autoc =0 ;u32 link_mode = autoc &IXGBE_AUTOC_LMS_MASK ;u32 pma_pmd_1g = autoc &IXGBE_AUTOC_1G_PMA_PMD_MASK ;
@@ -603,6 +674,11 @@ s32 ixgbe_setup_mac_link_speed_82599(struct ixgbe_hw *hw, hw->mac.ops.get_link_capabilities (hw, &link_capabilities, &autoneg); speed &= link_capabilities; +if (speed ==IXGBE_LINK_SPEED_UNKNOWN ) { + status =IXGBE_ERR_LINK_SETUP ; + goto out; + } +/* Use stored value (EEPROM defaults) of AUTOC to find KR/KX4 support*/ if (hw->mac.orig_link_settings_stored) orig_autoc = hw->mac.orig_autoc;
@@ -610,11 +686,9 @@ s32 ixgbe_setup_mac_link_speed_82599(struct ixgbe_hw *hw, orig_autoc = autoc; -if (speed ==IXGBE_LINK_SPEED_UNKNOWN ) { - status =IXGBE_ERR_LINK_SETUP ; - }else if (link_mode ==IXGBE_AUTOC_LMS_KX4_KX_KR || - link_mode ==IXGBE_AUTOC_LMS_KX4_KX_KR_1G_AN || - link_mode ==IXGBE_AUTOC_LMS_KX4_KX_KR_SGMII ) { +if (link_mode ==IXGBE_AUTOC_LMS_KX4_KX_KR || + link_mode ==IXGBE_AUTOC_LMS_KX4_KX_KR_1G_AN || + link_mode ==IXGBE_AUTOC_LMS_KX4_KX_KR_SGMII ) {/* Set KX4/KX/KR support according to speed requested */ autoc &= ~(IXGBE_AUTOC_KX4_KX_SUPP_MASK |IXGBE_AUTOC_KR_SUPP );if (speed &IXGBE_LINK_SPEED_10GB_FULL )
@@ -646,7 +720,7 @@ s32 ixgbe_setup_mac_link_speed_82599(struct ixgbe_hw *hw, } } -if (status ==0 ) { +if (autoc != start_autoc) {/* Restart link */ autoc |=IXGBE_AUTOC_AN_RESTART ;IXGBE_WRITE_REG (hw,IXGBE_AUTOC , autoc);
@@ -680,6 +754,7 @@ s32 ixgbe_setup_mac_link_speed_82599(struct ixgbe_hw *hw,msleep (50 ); } +out:return status; }
@@ -1144,6 +1219,9 @@ s32 ixgbe_start_hw_82599(struct ixgbe_hw *hw) }IXGBE_WRITE_FLUSH (hw); +/* We need to run link autotry after the driver loads */ + hw->mac.autotry_restart = true; +return 0 ; }
drivers/net/ixgbe/ixgbe_common.c +1 -0
@@ -2068,6 +2068,7 @@ s32 ixgbe_blink_led_start_generic(struct ixgbe_hw *hw, u32 index) hw->mac.ops.check_link (hw, &speed, &link_up, false);if (!link_up) { + autoc_reg |=IXGBE_AUTOC_AN_RESTART ; autoc_reg |=IXGBE_AUTOC_FLU ;IXGBE_WRITE_REG (hw,IXGBE_AUTOC , autoc_reg);msleep (10 );
drivers/net/ixgbe/ixgbe_phy.c +1 -0
@@ -606,6 +606,7 @@ s32 ixgbe_identify_sfp_module_generic(struct ixgbe_hw *hw) hw->phy.sfp_setup_needed = true;/* Determine if the SFP+ PHY is dual speed or not. */ + hw->phy.multispeed_fiber = false; if (((comp_codes_1g & IXGBE_SFF_1GBASESX_CAPABLE) && (comp_codes_10g & IXGBE_SFF_10GBASESR_CAPABLE)) || ((comp_codes_1g & IXGBE_SFF_1GBASELX_CAPABLE) &&
drivers/net/ixgbe/ixgbe_type.h +5 -2
@@ -1265,8 +1265,10 @@#define IXGBE_STATUS_LAN_ID_1 0x00000004/* LAN ID 1 */ /* ESDP Bit Masks */ -#define IXGBE_ESDP_SDP0 0x00000001 -#define IXGBE_ESDP_SDP1 0x00000002 +#define IXGBE_ESDP_SDP0 0x00000001/* SDP0 Data Value */ +#define IXGBE_ESDP_SDP1 0x00000002/* SDP1 Data Value */ +#define IXGBE_ESDP_SDP2 0x00000004/* SDP2 Data Value */ +#define IXGBE_ESDP_SDP3 0x00000008/* SDP3 Data Value */ #define IXGBE_ESDP_SDP4 0x00000010/* SDP4 Data Value */ #define IXGBE_ESDP_SDP5 0x00000020/* SDP5 Data Value */ #define IXGBE_ESDP_SDP6 0x00000040/* SDP6 Data Value */
@@ -2281,6 +2283,7 @@ struct ixgbe_mac_info {bool orig_link_settings_stored;bool autoneg;bool autoneg_succeeded; +bool autotry_restart; };struct ixgbe_phy_info {
PATCH 5/6 ixgbe: Fix 82599 adapter link flickering issues
In reply to Jeff KirsherFrom: Mallikarjuna R Chilakala <[email protected]>
Fix autoneg restart issues in flow control path which might create endless link flickering due to known timing issues with 82599 adapters.
---
drivers/net/ixgbe/ixgbe_82598.c | 115 ++++------------ drivers/net/ixgbe/ixgbe_82599.c | 13 +- drivers/net/ixgbe/ixgbe_common.c | 245 ++++++++++++++++++----------------- drivers/net/ixgbe/ixgbe_common.h | 4 - drivers/net/ixgbe/ixgbe_dcb_82599.c | 2 drivers/net/ixgbe/ixgbe_ethtool.c | 28 +++- drivers/net/ixgbe/ixgbe_main.c | 6 - drivers/net/ixgbe/ixgbe_type.h | 7 - 8 files changed, 193 insertions(+), 227 deletions(-)
drivers/net/ixgbe/ixgbe_82598.c +31 -84
@@ -293,6 +293,17 @@ static s32 ixgbe_fc_enable_82598(struct ixgbe_hw *hw, s32 packetbuf_num)u32 rmcs_reg;u32 reg; +#ifdef CONFIG_DCB +if (hw->fc.requested_mode == ixgbe_fc_pfc) + goto out; + +#endif /* CONFIG_DCB */ +/* Negotiate the fc mode to use */ + ret_val =ixgbe_fc_autoneg (hw); +if (ret_val) + goto out; + +/* Disable any previous flow control settings */ fctrl_reg =IXGBE_READ_REG (hw,IXGBE_FCTRL ); fctrl_reg &= ~(IXGBE_FCTRL_RFCE |IXGBE_FCTRL_RPFCE );
@@ -304,14 +315,20 @@ static s32 ixgbe_fc_enable_82598(struct ixgbe_hw *hw, s32 packetbuf_num)* 0: Flow control is completely disabled * 1: Rx flow control is enabled (we can receive pause frames, * but not send pause frames). -* 2: Tx flow control is enabled (we can send pause frames but +* 2: Tx flow control is enabled (we can send pause frames but * we do not support receiving pause frames). * 3: Both Rx and Tx flow control (symmetric) are enabled. * other: Invalid. +#ifdef CONFIG_DCB +* 4: Priority Flow Control is enabled. +#endif */ switch (hw->fc.current_mode) {case ixgbe_fc_none: -/* Flow control completely disabled by software override. */ +/* +* Flow control is disabled by software override or autoneg. +* The code below will actually disable it in the HW. +*/ break ;case ixgbe_fc_rx_pause:/*
@@ -336,6 +353,11 @@ static s32 ixgbe_fc_enable_82598(struct ixgbe_hw *hw, s32 packetbuf_num) fctrl_reg |=IXGBE_FCTRL_RFCE ; rmcs_reg |=IXGBE_RMCS_TFCE_802_3X ;break ; +#ifdef CONFIG_DCB +case ixgbe_fc_pfc: + goto out; +break ; +#endif /* CONFIG_DCB */ default :hw_dbg (hw,"Flow control param set incorrectly\n" ); ret_val = -IXGBE_ERR_CONFIG ;
@@ -343,7 +365,7 @@ static s32 ixgbe_fc_enable_82598(struct ixgbe_hw *hw, s32 packetbuf_num)break ; } -/* Enable 802.3x based flow control settings. */ +/* Set 802.3x based flow control settings. */ fctrl_reg |=IXGBE_FCTRL_DPF ;IXGBE_WRITE_REG (hw,IXGBE_FCTRL , fctrl_reg);IXGBE_WRITE_REG (hw,IXGBE_RMCS , rmcs_reg);
@@ -377,79 +399,6 @@ out: }/** -* ixgbe_setup_fc_82598 - Configure flow control settings -* @hw: pointer to hardware structure -* @packetbuf_num: packet buffer number (0-7) -* -* Configures the flow control settings based on SW configuration. This -* function is used for 802.3x flow control configuration only. -**/ -static s32 ixgbe_setup_fc_82598 (struct ixgbe_hw *hw,s32 packetbuf_num) -{ -s32 ret_val =0 ; -ixgbe_link_speed speed; -bool link_up; - -/* Validate the packetbuf configuration */ -if (packetbuf_num <0 || packetbuf_num >7 ) { -hw_dbg (hw,"Invalid packet buffer number [%d], expected range is" -" 0-7\n" , packetbuf_num); - ret_val =IXGBE_ERR_INVALID_LINK_SETTINGS ; - goto out; - } - -/* -* Validate the water mark configuration. Zero water marks are invalid -* because it causes the controller to just blast out fc packets. -*/ -if (!hw->fc.low_water || !hw->fc.high_water || !hw->fc.pause_time) { -if (hw->fc.requested_mode != ixgbe_fc_none) { -hw_dbg (hw,"Invalid water mark configuration\n" ); - ret_val =IXGBE_ERR_INVALID_LINK_SETTINGS ; - goto out; - } - } - -/* -* Validate the requested mode. Strict IEEE mode does not allow -* ixgbe_fc_rx_pause because it will cause testing anomalies. -*/ -if (hw->fc.strict_ieee && hw->fc.requested_mode == ixgbe_fc_rx_pause) { -hw_dbg (hw,"ixgbe_fc_rx_pause not valid in strict IEEE mode\n" ); - ret_val =IXGBE_ERR_INVALID_LINK_SETTINGS ; - goto out; - } - -/* -* 10gig parts do not have a word in the EEPROM to determine the -* default flow control setting, so we explicitly set it to full. -*/ -if (hw->fc.requested_mode == ixgbe_fc_default) - hw->fc.requested_mode = ixgbe_fc_full; - -/* -* Save off the requested flow control mode for use later. Depending -* on the link partner's capabilities, we may or may not use this mode. -*/ - - hw->fc.current_mode = hw->fc.requested_mode; - -/* Decide whether to use autoneg or not. */ - hw->mac.ops.check_link (hw, &speed, &link_up, false); -if (!hw->fc.disable_fc_autoneg && hw->phy.multispeed_fiber && - (speed ==IXGBE_LINK_SPEED_1GB_FULL )) - ret_val =ixgbe_fc_autoneg (hw); - -if (ret_val) - goto out; - - ret_val =ixgbe_fc_enable_82598 (hw, packetbuf_num); - -out: -return ret_val; -} - -/** * ixgbe_setup_mac_link_82598 - Configures MAC link settings * @hw: pointer to hardware structure *
@@ -488,13 +437,6 @@ static s32 ixgbe_setup_mac_link_82598(struct ixgbe_hw *hw) } } -/* -* We want to save off the original Flow Control configuration just in -* case we get disconnected and then reconnected into a different hub -* or switch with different Flow Control capabilities. -*/ -ixgbe_setup_fc_82598 (hw,0 ); -/* Add delay to filter out noises during initial link setup */ msleep (50 );
@@ -581,6 +523,11 @@ static s32 ixgbe_check_mac_link_82598(struct ixgbe_hw *hw,else *speed =IXGBE_LINK_SPEED_1GB_FULL ; +/* if link is down, zero out the current_mode */ +if (*link_up == false) { + hw->fc.current_mode = ixgbe_fc_none; + hw->fc.fc_was_autonegged = false; + } out:return 0 ; }
@@ -1168,7 +1115,7 @@ static struct ixgbe_mac_operations mac_ops_82598 = { .disable_mc = &ixgbe_disable_mc_generic, .clear_vfta = &ixgbe_clear_vfta_82598, .set_vfta = &ixgbe_set_vfta_82598, - .setup_fc = &ixgbe_setup_fc_82598, + .fc_enable = &ixgbe_fc_enable_82598, };static struct ixgbe_eeprom_operations eeprom_ops_82598 = {
drivers/net/ixgbe/ixgbe_82599.c +6 -7
@@ -413,9 +413,6 @@ s32 ixgbe_setup_mac_link_82599(struct ixgbe_hw *hw) } } -/* Set up flow control */ - status =ixgbe_setup_fc_generic (hw,0 ); -/* Add delay to filter out noises during initial link setup */ msleep (50 );
@@ -641,6 +638,11 @@ s32 ixgbe_check_mac_link_82599(struct ixgbe_hw *hw, ixgbe_link_speed *speed,else *speed =IXGBE_LINK_SPEED_100_FULL ; +/* if link is down, zero out the current_mode */ +if (*link_up == false) { + hw->fc.current_mode = ixgbe_fc_none; + hw->fc.fc_was_autonegged = false; + }return 0 ; }
@@ -747,9 +749,6 @@ s32 ixgbe_setup_mac_link_speed_82599(struct ixgbe_hw *hw, } } -/* Set up flow control */ - status =ixgbe_setup_fc_generic (hw,0 ); -/* Add delay to filter out noises during initial link setup */ msleep (50 ); }
@@ -1509,7 +1508,7 @@ static struct ixgbe_mac_operations mac_ops_82599 = { .disable_mc = &ixgbe_disable_mc_generic, .clear_vfta = &ixgbe_clear_vfta_82599, .set_vfta = &ixgbe_set_vfta_82599, - .setup_fc = &ixgbe_setup_fc_generic, + .fc_enable = &ixgbe_fc_enable_generic, .init_uta_tables = &ixgbe_init_uta_tables_82599, .setup_sfp = &ixgbe_setup_sfp_modules_82599, };
drivers/net/ixgbe/ixgbe_common.c +127 -118
346 lines not on this page · raw message
drivers/net/ixgbe/ixgbe_common.h +2 -2
@@ -64,8 +64,8 @@ s32 ixgbe_update_uc_addr_list_generic(struct ixgbe_hw *hw,s32 ixgbe_enable_mc_generic (struct ixgbe_hw *hw);s32 ixgbe_disable_mc_generic (struct ixgbe_hw *hw);s32 ixgbe_enable_rx_dma_generic (struct ixgbe_hw *hw,u32 regval); -s32 ixgbe_setup_fc_generic (struct ixgbe_hw *hw,s32 packetbuf_num); -s32 ixgbe_fc_enable (struct ixgbe_hw *hw,s32 packtetbuf_num); +s32 ixgbe_setup_fc (struct ixgbe_hw *hw,s32 packetbuf_num); +s32 ixgbe_fc_enable_generic (struct ixgbe_hw *hw,s32 packtetbuf_num);s32 ixgbe_fc_autoneg (struct ixgbe_hw *hw);s32 ixgbe_validate_mac_addr (u8 *mac_addr);
drivers/net/ixgbe/ixgbe_dcb_82599.c +1 -1
@@ -295,7 +295,7 @@ s32 ixgbe_dcb_config_pfc_82599(struct ixgbe_hw *hw,/* If PFC is disabled globally then fall back to LFC. */ if (!dcb_config->pfc_mode_enable) {for (i =0 ; i <MAX_TRAFFIC_CLASS ; i++) - hw->mac.ops.setup_fc (hw, i); + hw->mac.ops.fc_enable (hw, i); goto out; }
drivers/net/ixgbe/ixgbe_ethtool.c +20 -8
@@ -283,6 +283,7 @@ static int ixgbe_set_pauseparam(struct net_device *netdev, {struct ixgbe_adapter *adapter =netdev_priv (netdev);struct ixgbe_hw *hw = &adapter->hw; +struct ixgbe_fc_info fc;#ifdef CONFIG_DCB if (adapter->dcb_cfg.pfc_mode_enable ||
@@ -291,26 +292,37 @@ static int ixgbe_set_pauseparam(struct net_device *netdev,return -EINVAL ;#endif + + fc = hw->fc; +if (pause->autoneg !=AUTONEG_ENABLE ) - hw->fc.disable_fc_autoneg = true; + fc.disable_fc_autoneg = true;else - hw->fc.disable_fc_autoneg = false; + fc.disable_fc_autoneg = false;if (pause->rx_pause && pause->tx_pause) - hw->fc.requested_mode = ixgbe_fc_full; + fc.requested_mode = ixgbe_fc_full;else if (pause->rx_pause && !pause->tx_pause) - hw->fc.requested_mode = ixgbe_fc_rx_pause; + fc.requested_mode = ixgbe_fc_rx_pause;else if (!pause->rx_pause && pause->tx_pause) - hw->fc.requested_mode = ixgbe_fc_tx_pause; + fc.requested_mode = ixgbe_fc_tx_pause;else if (!pause->rx_pause && !pause->tx_pause) - hw->fc.requested_mode = ixgbe_fc_none; + fc.requested_mode = ixgbe_fc_none;else return -EINVAL ;#ifdef CONFIG_DCB - adapter->last_lfc_mode = hw->fc.requested_mode; + adapter->last_lfc_mode = fc.requested_mode;#endif - hw->mac.ops.setup_fc (hw,0 ); + +/* if the thing changed then we'll update and use new autoneg */ +if (memcmp (&fc, &hw->fc,sizeof (struct ixgbe_fc_info ))) { + hw->fc = fc; +if (netif_running (netdev)) +ixgbe_reinit_locked (adapter); +else +ixgbe_reset (adapter); + }return 0 ; }
drivers/net/ixgbe/ixgbe_main.c +3 -3
@@ -4344,12 +4344,12 @@ static void ixgbe_watchdog_task(struct work_struct *work)#ifdef CONFIG_DCB if (adapter->flags &IXGBE_FLAG_DCB_ENABLED ) {for (i =0 ; i <MAX_TRAFFIC_CLASS ; i++) - hw->mac.ops.setup_fc (hw, i); + hw->mac.ops.fc_enable (hw, i); }else { - hw->mac.ops.setup_fc (hw,0 ); + hw->mac.ops.fc_enable (hw,0 ); }#else - hw->mac.ops.setup_fc (hw,0 ); + hw->mac.ops.fc_enable (hw,0 );#endif }
drivers/net/ixgbe/ixgbe_type.h +3 -4
@@ -1368,8 +1368,6 @@#define IXGBE_LINK_UP_TIME 90/* 9.0 Seconds */ #define IXGBE_AUTO_NEG_TIME 45/* 4.5 Seconds */ -#define FIBER_LINK_UP_LIMIT 50 -/* PCS1GLSTA Bit Masks */ #define IXGBE_PCS1GLSTA_LINK_OK 1#define IXGBE_PCS1GLSTA_SYNK_OK 0x10
@@ -2094,7 +2092,8 @@ struct ixgbe_fc_info {u16 pause_time;/* Flow Control Pause timer */ bool send_xon;/* Flow control send XON */ bool strict_ieee;/* Strict IEEE mode */ -bool disable_fc_autoneg;/* Turn off autoneg FC mode */ +bool disable_fc_autoneg;/* Do not autonegotiate FC */ +bool fc_was_autonegged;/* Is current_mode the result of autonegging? */ enum ixgbe_fc_mode current_mode;/* FC mode in effect */ enum ixgbe_fc_mode requested_mode;/* FC mode requested by caller */ };
@@ -2236,7 +2235,7 @@ struct ixgbe_mac_operations {s32 (*init_uta_tables)(struct ixgbe_hw *);/* Flow Control */ -s32 (*setup_fc)(struct ixgbe_hw *,s32 ); +s32 (*fc_enable)(struct ixgbe_hw *,s32 ); };struct ixgbe_phy_operations {
PATCH 6/6 ixgbe: ethtool support to change advertised link modes of 82599 adapters
In reply to Jeff KirsherFrom: Mallikarjuna R Chilakala <[email protected]>
Add ethtool support to change advertised link modes/autoneg settings of 82599 multispeed fiber adapters.
---
drivers/net/ixgbe/ixgbe_82599.c | 9 ++++++++ drivers/net/ixgbe/ixgbe_ethtool.c | 42 +++++++++++++++++++++---------------- 2 files changed, 33 insertions(+), 18 deletions(-)
drivers/net/ixgbe/ixgbe_82599.c +9 -0
@@ -464,6 +464,15 @@ s32 ixgbe_setup_mac_link_speed_multispeed_fiber(struct ixgbe_hw *hw, hw->mac.ops.get_link_capabilities (hw, &phy_link_speed, &negotiation); speed &= phy_link_speed; +/* Set autoneg_advertised value based on input link speed */ + hw->phy.autoneg_advertised =0 ; + +if (speed &IXGBE_LINK_SPEED_10GB_FULL ) + hw->phy.autoneg_advertised |=IXGBE_LINK_SPEED_10GB_FULL ; + +if (speed &IXGBE_LINK_SPEED_1GB_FULL ) + hw->phy.autoneg_advertised |=IXGBE_LINK_SPEED_1GB_FULL ; +/* * When the driver changes the link speeds that it can support, * it sets autotry_restart to true to indicate that we need to
drivers/net/ixgbe/ixgbe_ethtool.c +24 -18
78 lines not on this page · raw message
David Miller
maintainerAll 6 patches applied, thanks!