Commit ec54d7d6 authored by Alexander Duyck's avatar Alexander Duyck Committed by David S. Miller

igb: prevent skb_over panic w/ mtu smaller than 1K

A panic has been observed with frame sizes smaller than 1K.  This has been
root caused to the hardware spanning larger frames across multiple buffers
and then reporting the original frame size in the first descriptor.  To
prevent this we can enable set the LPE bit which in turn will restrict
packet sizes to those set in the RLPML register.
Signed-off-by: default avatarAlexander Duyck <alexander.h.duyck@intel.com>
Signed-off-by: default avatarJeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent bbd98fe4
...@@ -1834,11 +1834,11 @@ static void igb_setup_rctl(struct igb_adapter *adapter) ...@@ -1834,11 +1834,11 @@ static void igb_setup_rctl(struct igb_adapter *adapter)
rctl |= E1000_RCTL_SECRC; rctl |= E1000_RCTL_SECRC;
/* /*
* disable store bad packets, long packet enable, and clear size bits. * disable store bad packets and clear size bits.
*/ */
rctl &= ~(E1000_RCTL_SBP | E1000_RCTL_LPE | E1000_RCTL_SZ_256); rctl &= ~(E1000_RCTL_SBP | E1000_RCTL_SZ_256);
if (adapter->netdev->mtu > ETH_DATA_LEN) /* enable LPE when to prevent packets larger than max_frame_size */
rctl |= E1000_RCTL_LPE; rctl |= E1000_RCTL_LPE;
/* Setup buffer sizes */ /* Setup buffer sizes */
...@@ -1864,7 +1864,7 @@ static void igb_setup_rctl(struct igb_adapter *adapter) ...@@ -1864,7 +1864,7 @@ static void igb_setup_rctl(struct igb_adapter *adapter)
*/ */
/* allocations using alloc_page take too long for regular MTU /* allocations using alloc_page take too long for regular MTU
* so only enable packet split for jumbo frames */ * so only enable packet split for jumbo frames */
if (rctl & E1000_RCTL_LPE) { if (adapter->netdev->mtu > ETH_DATA_LEN) {
adapter->rx_ps_hdr_size = IGB_RXBUFFER_128; adapter->rx_ps_hdr_size = IGB_RXBUFFER_128;
srrctl |= adapter->rx_ps_hdr_size << srrctl |= adapter->rx_ps_hdr_size <<
E1000_SRRCTL_BSIZEHDRSIZE_SHIFT; E1000_SRRCTL_BSIZEHDRSIZE_SHIFT;
......
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