diff options
author | Alexander Duyck <alexander.h.duyck@intel.com> | 2009-01-31 03:52:57 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-01-31 03:52:57 -0500 |
commit | ec54d7d6e40b04c16dfce0e41e506198a20c8645 (patch) | |
tree | 7e70f20258f0f3ac35e48e0d4a1fa41d63853997 /drivers/net/igb | |
parent | bbd98fe48a43464b4a044bc4cbeefad284d6aa80 (diff) |
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: Alexander Duyck <alexander.h.duyck@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/igb')
-rw-r--r-- | drivers/net/igb/igb_main.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/net/igb/igb_main.c b/drivers/net/igb/igb_main.c index cc94412ddf89..a50db5398fa5 100644 --- a/drivers/net/igb/igb_main.c +++ b/drivers/net/igb/igb_main.c | |||
@@ -1834,11 +1834,11 @@ static void igb_setup_rctl(struct igb_adapter *adapter) | |||
1834 | rctl |= E1000_RCTL_SECRC; | 1834 | rctl |= E1000_RCTL_SECRC; |
1835 | 1835 | ||
1836 | /* | 1836 | /* |
1837 | * disable store bad packets, long packet enable, and clear size bits. | 1837 | * disable store bad packets and clear size bits. |
1838 | */ | 1838 | */ |
1839 | rctl &= ~(E1000_RCTL_SBP | E1000_RCTL_LPE | E1000_RCTL_SZ_256); | 1839 | rctl &= ~(E1000_RCTL_SBP | E1000_RCTL_SZ_256); |
1840 | 1840 | ||
1841 | if (adapter->netdev->mtu > ETH_DATA_LEN) | 1841 | /* enable LPE when to prevent packets larger than max_frame_size */ |
1842 | rctl |= E1000_RCTL_LPE; | 1842 | rctl |= E1000_RCTL_LPE; |
1843 | 1843 | ||
1844 | /* Setup buffer sizes */ | 1844 | /* Setup buffer sizes */ |
@@ -1864,7 +1864,7 @@ static void igb_setup_rctl(struct igb_adapter *adapter) | |||
1864 | */ | 1864 | */ |
1865 | /* allocations using alloc_page take too long for regular MTU | 1865 | /* allocations using alloc_page take too long for regular MTU |
1866 | * so only enable packet split for jumbo frames */ | 1866 | * so only enable packet split for jumbo frames */ |
1867 | if (rctl & E1000_RCTL_LPE) { | 1867 | if (adapter->netdev->mtu > ETH_DATA_LEN) { |
1868 | adapter->rx_ps_hdr_size = IGB_RXBUFFER_128; | 1868 | adapter->rx_ps_hdr_size = IGB_RXBUFFER_128; |
1869 | srrctl |= adapter->rx_ps_hdr_size << | 1869 | srrctl |= adapter->rx_ps_hdr_size << |
1870 | E1000_SRRCTL_BSIZEHDRSIZE_SHIFT; | 1870 | E1000_SRRCTL_BSIZEHDRSIZE_SHIFT; |