mirror of
https://github.com/torvalds/linux.git
synced 2024-12-28 05:41:55 +00:00
ixgbe: ethtool correctly identify autoneg setting
This patch enables ethtool to correctly identify flow control (pause frame) auto negotiation, as well as disallow enabling it when it is not supported. The ixgbe_device_supports_autoneg_fc function is exported and used for this purpose. There is also one minor cleanup of the device_supports_autoneg_fc by removing an unnecessary return statement. Signed-off-by: Jacob Keller <jacob.e.keller@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
This commit is contained in:
parent
f3444d8b35
commit
db2adc2df2
@ -65,13 +65,12 @@ static s32 ixgbe_disable_pcie_master(struct ixgbe_hw *hw);
|
||||
* function check the device id to see if the associated phy supports
|
||||
* autoneg flow control.
|
||||
**/
|
||||
static s32 ixgbe_device_supports_autoneg_fc(struct ixgbe_hw *hw)
|
||||
s32 ixgbe_device_supports_autoneg_fc(struct ixgbe_hw *hw)
|
||||
{
|
||||
|
||||
switch (hw->device_id) {
|
||||
case IXGBE_DEV_ID_X540T:
|
||||
case IXGBE_DEV_ID_X540T1:
|
||||
return 0;
|
||||
case IXGBE_DEV_ID_82599_T3_LOM:
|
||||
return 0;
|
||||
default:
|
||||
|
@ -78,6 +78,7 @@ s32 ixgbe_disable_rx_buff_generic(struct ixgbe_hw *hw);
|
||||
s32 ixgbe_enable_rx_buff_generic(struct ixgbe_hw *hw);
|
||||
s32 ixgbe_enable_rx_dma_generic(struct ixgbe_hw *hw, u32 regval);
|
||||
s32 ixgbe_fc_enable_generic(struct ixgbe_hw *hw);
|
||||
s32 ixgbe_device_supports_autoneg_fc(struct ixgbe_hw *hw);
|
||||
void ixgbe_fc_autoneg(struct ixgbe_hw *hw);
|
||||
|
||||
s32 ixgbe_validate_mac_addr(u8 *mac_addr);
|
||||
|
@ -383,6 +383,11 @@ static int ixgbe_set_pauseparam(struct net_device *netdev,
|
||||
(adapter->flags & IXGBE_FLAG_DCB_ENABLED))
|
||||
return -EINVAL;
|
||||
|
||||
/* some devices do not support autoneg of link flow control */
|
||||
if ((pause->autoneg == AUTONEG_ENABLE) &&
|
||||
(ixgbe_device_supports_autoneg_fc(hw) != 0))
|
||||
return -EINVAL;
|
||||
|
||||
fc.disable_fc_autoneg = (pause->autoneg != AUTONEG_ENABLE);
|
||||
|
||||
if ((pause->rx_pause && pause->tx_pause) || pause->autoneg)
|
||||
|
@ -4567,7 +4567,8 @@ static int __devinit ixgbe_sw_init(struct ixgbe_adapter *adapter)
|
||||
ixgbe_pbthresh_setup(adapter);
|
||||
hw->fc.pause_time = IXGBE_DEFAULT_FCPAUSE;
|
||||
hw->fc.send_xon = true;
|
||||
hw->fc.disable_fc_autoneg = false;
|
||||
hw->fc.disable_fc_autoneg =
|
||||
(ixgbe_device_supports_autoneg_fc(hw) == 0) ? false : true;
|
||||
|
||||
#ifdef CONFIG_PCI_IOV
|
||||
/* assign number of SR-IOV VFs */
|
||||
|
Loading…
Reference in New Issue
Block a user