Skip to content

Commit

Permalink
igb: prevent skb_over panic w/ mtu smaller than 1K
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: Jeff Kirsher <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
Alexander Duyck authored and davem330 committed Jan 31, 2009
1 parent bbd98fe commit ec54d7d
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions drivers/net/igb/igb_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -1834,11 +1834,11 @@ static void igb_setup_rctl(struct igb_adapter *adapter)
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;

/* Setup buffer sizes */
Expand All @@ -1864,7 +1864,7 @@ static void igb_setup_rctl(struct igb_adapter *adapter)
*/
/* allocations using alloc_page take too long for regular MTU
* 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;
srrctl |= adapter->rx_ps_hdr_size <<
E1000_SRRCTL_BSIZEHDRSIZE_SHIFT;
Expand Down

0 comments on commit ec54d7d

Please sign in to comment.