Commit a1ce6473 authored by Bruce Allan's avatar Bruce Allan Committed by David S. Miller

e1000e: 82579 jumbo frame workaround causing CRC errors

The subject workaround was causing CRC errors due to writing the wrong
register with updates of the RCTL register.  It was also found that the
workaround function which modifies the RCTL register was being called in
the middle of a read-modify-write operation of the RCTL register, so the
function call has been moved appropriately.  Lastly, jumbo frames must not
be allowed when CRC stripping is disabled by a module parameter because the
workaround requires the CRC be stripped.
Signed-off-by: default avatarBruce Allan <bruce.w.allan@intel.com>
Tested-by: default avatarJeff Pieper <jeffrey.e.pieper@intel.com>
Signed-off-by: default avatarJeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 831bd2e6
...@@ -1475,10 +1475,6 @@ s32 e1000_lv_jumbo_workaround_ich8lan(struct e1000_hw *hw, bool enable) ...@@ -1475,10 +1475,6 @@ s32 e1000_lv_jumbo_workaround_ich8lan(struct e1000_hw *hw, bool enable)
goto out; goto out;
/* Enable jumbo frame workaround in the PHY */ /* Enable jumbo frame workaround in the PHY */
e1e_rphy(hw, PHY_REG(769, 20), &data);
ret_val = e1e_wphy(hw, PHY_REG(769, 20), data & ~(1 << 14));
if (ret_val)
goto out;
e1e_rphy(hw, PHY_REG(769, 23), &data); e1e_rphy(hw, PHY_REG(769, 23), &data);
data &= ~(0x7F << 5); data &= ~(0x7F << 5);
data |= (0x37 << 5); data |= (0x37 << 5);
...@@ -1487,7 +1483,6 @@ s32 e1000_lv_jumbo_workaround_ich8lan(struct e1000_hw *hw, bool enable) ...@@ -1487,7 +1483,6 @@ s32 e1000_lv_jumbo_workaround_ich8lan(struct e1000_hw *hw, bool enable)
goto out; goto out;
e1e_rphy(hw, PHY_REG(769, 16), &data); e1e_rphy(hw, PHY_REG(769, 16), &data);
data &= ~(1 << 13); data &= ~(1 << 13);
data |= (1 << 12);
ret_val = e1e_wphy(hw, PHY_REG(769, 16), data); ret_val = e1e_wphy(hw, PHY_REG(769, 16), data);
if (ret_val) if (ret_val)
goto out; goto out;
...@@ -1512,7 +1507,7 @@ s32 e1000_lv_jumbo_workaround_ich8lan(struct e1000_hw *hw, bool enable) ...@@ -1512,7 +1507,7 @@ s32 e1000_lv_jumbo_workaround_ich8lan(struct e1000_hw *hw, bool enable)
mac_reg = er32(RCTL); mac_reg = er32(RCTL);
mac_reg &= ~E1000_RCTL_SECRC; mac_reg &= ~E1000_RCTL_SECRC;
ew32(FFLT_DBG, mac_reg); ew32(RCTL, mac_reg);
ret_val = e1000e_read_kmrn_reg(hw, ret_val = e1000e_read_kmrn_reg(hw,
E1000_KMRNCTRLSTA_CTRL_OFFSET, E1000_KMRNCTRLSTA_CTRL_OFFSET,
...@@ -1538,17 +1533,12 @@ s32 e1000_lv_jumbo_workaround_ich8lan(struct e1000_hw *hw, bool enable) ...@@ -1538,17 +1533,12 @@ s32 e1000_lv_jumbo_workaround_ich8lan(struct e1000_hw *hw, bool enable)
goto out; goto out;
/* Write PHY register values back to h/w defaults */ /* Write PHY register values back to h/w defaults */
e1e_rphy(hw, PHY_REG(769, 20), &data);
ret_val = e1e_wphy(hw, PHY_REG(769, 20), data & ~(1 << 14));
if (ret_val)
goto out;
e1e_rphy(hw, PHY_REG(769, 23), &data); e1e_rphy(hw, PHY_REG(769, 23), &data);
data &= ~(0x7F << 5); data &= ~(0x7F << 5);
ret_val = e1e_wphy(hw, PHY_REG(769, 23), data); ret_val = e1e_wphy(hw, PHY_REG(769, 23), data);
if (ret_val) if (ret_val)
goto out; goto out;
e1e_rphy(hw, PHY_REG(769, 16), &data); e1e_rphy(hw, PHY_REG(769, 16), &data);
data &= ~(1 << 12);
data |= (1 << 13); data |= (1 << 13);
ret_val = e1e_wphy(hw, PHY_REG(769, 16), data); ret_val = e1e_wphy(hw, PHY_REG(769, 16), data);
if (ret_val) if (ret_val)
......
...@@ -2704,6 +2704,16 @@ static void e1000_setup_rctl(struct e1000_adapter *adapter) ...@@ -2704,6 +2704,16 @@ static void e1000_setup_rctl(struct e1000_adapter *adapter)
u32 psrctl = 0; u32 psrctl = 0;
u32 pages = 0; u32 pages = 0;
/* Workaround Si errata on 82579 - configure jumbo frame flow */
if (hw->mac.type == e1000_pch2lan) {
s32 ret_val;
if (adapter->netdev->mtu > ETH_DATA_LEN)
ret_val = e1000_lv_jumbo_workaround_ich8lan(hw, true);
else
ret_val = e1000_lv_jumbo_workaround_ich8lan(hw, false);
}
/* Program MC offset vector base */ /* Program MC offset vector base */
rctl = er32(RCTL); rctl = er32(RCTL);
rctl &= ~(3 << E1000_RCTL_MO_SHIFT); rctl &= ~(3 << E1000_RCTL_MO_SHIFT);
...@@ -2744,16 +2754,6 @@ static void e1000_setup_rctl(struct e1000_adapter *adapter) ...@@ -2744,16 +2754,6 @@ static void e1000_setup_rctl(struct e1000_adapter *adapter)
e1e_wphy(hw, 22, phy_data); e1e_wphy(hw, 22, phy_data);
} }
/* Workaround Si errata on 82579 - configure jumbo frame flow */
if (hw->mac.type == e1000_pch2lan) {
s32 ret_val;
if (rctl & E1000_RCTL_LPE)
ret_val = e1000_lv_jumbo_workaround_ich8lan(hw, true);
else
ret_val = e1000_lv_jumbo_workaround_ich8lan(hw, false);
}
/* Setup buffer sizes */ /* Setup buffer sizes */
rctl &= ~E1000_RCTL_SZ_4096; rctl &= ~E1000_RCTL_SZ_4096;
rctl |= E1000_RCTL_BSEX; rctl |= E1000_RCTL_BSEX;
...@@ -4833,6 +4833,15 @@ static int e1000_change_mtu(struct net_device *netdev, int new_mtu) ...@@ -4833,6 +4833,15 @@ static int e1000_change_mtu(struct net_device *netdev, int new_mtu)
return -EINVAL; return -EINVAL;
} }
/* Jumbo frame workaround on 82579 requires CRC be stripped */
if ((adapter->hw.mac.type == e1000_pch2lan) &&
!(adapter->flags2 & FLAG2_CRC_STRIPPING) &&
(new_mtu > ETH_DATA_LEN)) {
e_err("Jumbo Frames not supported on 82579 when CRC "
"stripping is disabled.\n");
return -EINVAL;
}
/* 82573 Errata 17 */ /* 82573 Errata 17 */
if (((adapter->hw.mac.type == e1000_82573) || if (((adapter->hw.mac.type == e1000_82573) ||
(adapter->hw.mac.type == e1000_82574)) && (adapter->hw.mac.type == e1000_82574)) &&
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment