ixgbe_aci_get_link_info() currently allows to [en/dis]able LSE by @ena_lse param. This isn't proper approach as this function objective is completely different than toggling LSE feature. Creating such parameter was probably dictated by the fact the flag corresponding for LSE enablement was placed within the ACI command used by the function. LSE should not be switched off while the ixgbe driver is running. Current driver behavior doesn't provide such possibility for the user. Enable LSE by default whenever 0x0607 ACI command is sent. Such change corresponds to the fact that FW disables LSE whenever new event is triggered. ixgbe_aci_get_link_info() is a part of routine handling LSE events, so it ensures that LSE remain enabled. Remove wrappers utilizing @ena_lse param to [en/dis]able LSE as they are no longer valid. Reviewed-by: Aleksandr Loktionov Signed-off-by: Jedrzej Jagielski --- drivers/net/ethernet/intel/ixgbe/ixgbe_e610.c | 25 ++++--------------- drivers/net/ethernet/intel/ixgbe/ixgbe_e610.h | 3 +-- .../net/ethernet/intel/ixgbe/ixgbe_ethtool.c | 2 +- drivers/net/ethernet/intel/ixgbe/ixgbe_main.c | 23 +---------------- 4 files changed, 8 insertions(+), 45 deletions(-) diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_e610.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_e610.c index 54cc0f116e88..ec7d8073efe6 100644 --- a/drivers/net/ethernet/intel/ixgbe/ixgbe_e610.c +++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_e610.c @@ -1391,7 +1391,7 @@ int ixgbe_update_link_info(struct ixgbe_hw *hw) li = &hw->link.link_info; - err = ixgbe_aci_get_link_info(hw, true, NULL); + err = ixgbe_aci_get_link_info(hw, NULL); if (err) return err; @@ -1445,7 +1445,6 @@ int ixgbe_get_link_status(struct ixgbe_hw *hw, bool *link_up) /** * ixgbe_aci_get_link_info - get the link status * @hw: pointer to the HW struct - * @ena_lse: enable/disable LinkStatusEvent reporting * @link: pointer to link status structure - optional * * Get the current Link Status using ACI command (0x607). @@ -1454,8 +1453,7 @@ int ixgbe_get_link_status(struct ixgbe_hw *hw, bool *link_up) * * Return: the link status of the adapter. */ -int ixgbe_aci_get_link_info(struct ixgbe_hw *hw, bool ena_lse, - struct ixgbe_link_status *link) +int ixgbe_aci_get_link_info(struct ixgbe_hw *hw, struct ixgbe_link_status *link) { struct ixgbe_aci_cmd_get_link_status_data link_data = {}; struct ixgbe_aci_cmd_get_link_status *resp; @@ -1474,7 +1472,7 @@ int ixgbe_aci_get_link_info(struct ixgbe_hw *hw, bool ena_lse, hw_fc_info = &hw->fc; ixgbe_fill_dflt_direct_cmd_desc(&desc, ixgbe_aci_opc_get_link_status); - cmd_flags = (ena_lse) ? IXGBE_ACI_LSE_ENA : IXGBE_ACI_LSE_DIS; + cmd_flags = IXGBE_ACI_LSE_ENA; resp = libie_aq_raw(&desc); resp->cmd_flags = cpu_to_le16(cmd_flags); resp->lport_num = hw->bus.func; @@ -1561,19 +1559,6 @@ static int ixgbe_aci_init_event_mask(struct ixgbe_hw *hw) return ixgbe_aci_set_event_mask(hw, (u8)hw->bus.func, mask); } -/** - * ixgbe_configure_lse - enable/disable link status events - * @hw: pointer to the HW struct - * @activate: true for enable lse, false otherwise - * - * Return: the exit code of the operation. - */ -int ixgbe_configure_lse(struct ixgbe_hw *hw, bool activate) -{ - /* Enabling link status events generation by fw. */ - return ixgbe_aci_get_link_info(hw, activate, NULL); -} - /** * ixgbe_start_hw_e610 - Prepare hardware for Tx/Rx * @hw: pointer to hardware structure @@ -1913,7 +1898,7 @@ void ixgbe_fc_autoneg_e610(struct ixgbe_hw *hw) /* Get current link err. * Current FC mode will be stored in the hw context. */ - err = ixgbe_aci_get_link_info(hw, true, NULL); + err = ixgbe_aci_get_link_info(hw, NULL); if (err) goto no_autoneg; @@ -2219,7 +2204,7 @@ int ixgbe_setup_phy_link_e610(struct ixgbe_hw *hw) u64 phy_type_low = 0, phy_type_high = 0; int err; - err = ixgbe_aci_get_link_info(hw, true, NULL); + err = ixgbe_aci_get_link_info(hw, NULL); if (err) return err; diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_e610.h b/drivers/net/ethernet/intel/ixgbe/ixgbe_e610.h index ecda35a77adb..4fb4ab99d458 100644 --- a/drivers/net/ethernet/intel/ixgbe/ixgbe_e610.h +++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_e610.h @@ -32,9 +32,8 @@ int ixgbe_aci_set_phy_cfg(struct ixgbe_hw *hw, int ixgbe_aci_set_link_restart_an(struct ixgbe_hw *hw, bool ena_link); int ixgbe_update_link_info(struct ixgbe_hw *hw); int ixgbe_get_link_status(struct ixgbe_hw *hw, bool *link_up); -int ixgbe_aci_get_link_info(struct ixgbe_hw *hw, bool ena_lse, +int ixgbe_aci_get_link_info(struct ixgbe_hw *hw, struct ixgbe_link_status *link); -int ixgbe_configure_lse(struct ixgbe_hw *hw, bool activate); int ixgbe_aci_set_port_id_led(struct ixgbe_hw *hw, bool orig_mode); enum ixgbe_media_type ixgbe_get_media_type_e610(struct ixgbe_hw *hw); int ixgbe_setup_link_e610(struct ixgbe_hw *hw, ixgbe_link_speed speed, diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c index b8e85bc91a27..5d71c1011cf4 100644 --- a/drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c +++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c @@ -3647,7 +3647,7 @@ static int ixgbe_get_eee_e610(struct net_device *netdev, linkmode_zero(kedata->supported); linkmode_zero(kedata->advertised); - err = ixgbe_aci_get_link_info(hw, true, &link); + err = ixgbe_aci_get_link_info(hw, &link); if (err) return err; diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c index f33a534490b5..d1cfe913081f 100644 --- a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c +++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c @@ -5966,19 +5966,6 @@ static void ixgbe_configure(struct ixgbe_adapter *adapter) ixgbe_configure_dfwd(adapter); } -/** - * ixgbe_enable_link_status_events - enable link status events - * @adapter: pointer to the adapter structure - * - * Enables link status events by invoking ixgbe_configure_lse() - * - * Return: the exit code of the operation. - */ -static int ixgbe_enable_link_status_events(struct ixgbe_adapter *adapter) -{ - return ixgbe_configure_lse(&adapter->hw, true); -} - /** * ixgbe_sfp_link_config - set up SFP+ link * @adapter: pointer to private adapter struct @@ -6008,8 +5995,6 @@ static void ixgbe_sfp_link_config(struct ixgbe_adapter *adapter) **/ static int ixgbe_non_sfp_link_config(struct ixgbe_hw *hw) { - struct ixgbe_adapter *adapter = container_of(hw, struct ixgbe_adapter, - hw); bool autoneg, link_up = false; int ret = -EIO; u32 speed; @@ -6035,14 +6020,8 @@ static int ixgbe_non_sfp_link_config(struct ixgbe_hw *hw) if (ret) return ret; - if (hw->mac.ops.setup_link) { - if (adapter->hw.mac.type == ixgbe_mac_e610) { - ret = ixgbe_enable_link_status_events(adapter); - if (ret) - return ret; - } + if (hw->mac.ops.setup_link) ret = hw->mac.ops.setup_link(hw, speed, link_up); - } return ret; } -- 2.31.1