Skip to content

Commit bb5ed01

Browse files
rtylxdavem330
authored andcommitted
igb: set max size RX buffer when store bad packet is enabled
Increase the RX buffer size to 3K when the SBP bit is on. The size of the RX buffer determines the number of pages allocated which may not be sufficient for receive frames larger than the set MTU size. Cc: [email protected] Fixes: 89eaefb ("igb: Support RX-ALL feature flag.") Reported-by: Manfred Rudigier <[email protected]> Signed-off-by: Radoslaw Tyl <[email protected]> Tested-by: Arpana Arland <[email protected]> (A Contingent worker at Intel) Signed-off-by: Tony Nguyen <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent c2f8fd7 commit bb5ed01

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

drivers/net/ethernet/intel/igb/igb_main.c

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4814,6 +4814,10 @@ void igb_configure_rx_ring(struct igb_adapter *adapter,
48144814
static void igb_set_rx_buffer_len(struct igb_adapter *adapter,
48154815
struct igb_ring *rx_ring)
48164816
{
4817+
#if (PAGE_SIZE < 8192)
4818+
struct e1000_hw *hw = &adapter->hw;
4819+
#endif
4820+
48174821
/* set build_skb and buffer size flags */
48184822
clear_ring_build_skb_enabled(rx_ring);
48194823
clear_ring_uses_large_buffer(rx_ring);
@@ -4824,10 +4828,9 @@ static void igb_set_rx_buffer_len(struct igb_adapter *adapter,
48244828
set_ring_build_skb_enabled(rx_ring);
48254829

48264830
#if (PAGE_SIZE < 8192)
4827-
if (adapter->max_frame_size <= IGB_MAX_FRAME_BUILD_SKB)
4828-
return;
4829-
4830-
set_ring_uses_large_buffer(rx_ring);
4831+
if (adapter->max_frame_size > IGB_MAX_FRAME_BUILD_SKB ||
4832+
rd32(E1000_RCTL) & E1000_RCTL_SBP)
4833+
set_ring_uses_large_buffer(rx_ring);
48314834
#endif
48324835
}
48334836

0 commit comments

Comments
 (0)