netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net] igb: set max size RX buffer when store bad packet is enabled
@ 2023-08-24 20:46 Tony Nguyen
  2023-08-28  6:10 ` patchwork-bot+netdevbpf
  2023-08-28 10:00 ` David Laight
  0 siblings, 2 replies; 3+ messages in thread
From: Tony Nguyen @ 2023-08-24 20:46 UTC (permalink / raw)
  To: davem, kuba, pabeni, edumazet, netdev
  Cc: Radoslaw Tyl, anthony.l.nguyen, greearb, jesse.brandeburg,
	stable, Manfred Rudigier, Arpana Arland

From: Radoslaw Tyl <radoslawx.tyl@intel.com>

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: stable@vger.kernel.org
Fixes: 89eaefb61dc9 ("igb: Support RX-ALL feature flag.")
Reported-by: Manfred Rudigier <manfred.rudigier@omicronenergy.com>
Signed-off-by: Radoslaw Tyl <radoslawx.tyl@intel.com>
Tested-by: Arpana Arland <arpanax.arland@intel.com> (A Contingent worker at Intel)
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
---
 drivers/net/ethernet/intel/igb/igb_main.c | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/drivers/net/ethernet/intel/igb/igb_main.c b/drivers/net/ethernet/intel/igb/igb_main.c
index 9a2561409b06..08e3df37089f 100644
--- a/drivers/net/ethernet/intel/igb/igb_main.c
+++ b/drivers/net/ethernet/intel/igb/igb_main.c
@@ -4814,6 +4814,10 @@ void igb_configure_rx_ring(struct igb_adapter *adapter,
 static void igb_set_rx_buffer_len(struct igb_adapter *adapter,
 				  struct igb_ring *rx_ring)
 {
+#if (PAGE_SIZE < 8192)
+	struct e1000_hw *hw = &adapter->hw;
+#endif
+
 	/* set build_skb and buffer size flags */
 	clear_ring_build_skb_enabled(rx_ring);
 	clear_ring_uses_large_buffer(rx_ring);
@@ -4824,10 +4828,9 @@ static void igb_set_rx_buffer_len(struct igb_adapter *adapter,
 	set_ring_build_skb_enabled(rx_ring);
 
 #if (PAGE_SIZE < 8192)
-	if (adapter->max_frame_size <= IGB_MAX_FRAME_BUILD_SKB)
-		return;
-
-	set_ring_uses_large_buffer(rx_ring);
+	if (adapter->max_frame_size > IGB_MAX_FRAME_BUILD_SKB ||
+	    rd32(E1000_RCTL) & E1000_RCTL_SBP)
+		set_ring_uses_large_buffer(rx_ring);
 #endif
 }
 
-- 
2.38.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH net] igb: set max size RX buffer when store bad packet is enabled
  2023-08-24 20:46 [PATCH net] igb: set max size RX buffer when store bad packet is enabled Tony Nguyen
@ 2023-08-28  6:10 ` patchwork-bot+netdevbpf
  2023-08-28 10:00 ` David Laight
  1 sibling, 0 replies; 3+ messages in thread
From: patchwork-bot+netdevbpf @ 2023-08-28  6:10 UTC (permalink / raw)
  To: Tony Nguyen
  Cc: davem, kuba, pabeni, edumazet, netdev, radoslawx.tyl, greearb,
	jesse.brandeburg, stable, manfred.rudigier, arpanax.arland

Hello:

This patch was applied to netdev/net.git (main)
by David S. Miller <davem@davemloft.net>:

On Thu, 24 Aug 2023 13:46:19 -0700 you wrote:
> From: Radoslaw Tyl <radoslawx.tyl@intel.com>
> 
> 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: stable@vger.kernel.org
> Fixes: 89eaefb61dc9 ("igb: Support RX-ALL feature flag.")
> Reported-by: Manfred Rudigier <manfred.rudigier@omicronenergy.com>
> Signed-off-by: Radoslaw Tyl <radoslawx.tyl@intel.com>
> Tested-by: Arpana Arland <arpanax.arland@intel.com> (A Contingent worker at Intel)
> Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
> 
> [...]

Here is the summary with links:
  - [net] igb: set max size RX buffer when store bad packet is enabled
    https://git.kernel.org/netdev/net/c/bb5ed01cd242

You are awesome, thank you!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



^ permalink raw reply	[flat|nested] 3+ messages in thread

* RE: [PATCH net] igb: set max size RX buffer when store bad packet is enabled
  2023-08-24 20:46 [PATCH net] igb: set max size RX buffer when store bad packet is enabled Tony Nguyen
  2023-08-28  6:10 ` patchwork-bot+netdevbpf
@ 2023-08-28 10:00 ` David Laight
  1 sibling, 0 replies; 3+ messages in thread
From: David Laight @ 2023-08-28 10:00 UTC (permalink / raw)
  To: 'Tony Nguyen', davem, kuba, pabeni, edumazet, netdev
  Cc: Radoslaw Tyl, greearb, jesse.brandeburg, stable,
	Manfred Rudigier, Arpana Arland

From: Tony Nguyen
> Sent: 24 August 2023 21:46
> 
> From: Radoslaw Tyl <radoslawx.tyl@intel.com>
> 
> 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.

How much does that actually help?
In principle there is no limit to the length of an ethernet frame.
So the code has to handle overlong packets whatever the receive
buffer size is set to.

Modern ethernet hardware probably has configurable rx frame length
limits - but with old hardware the drivers had to handle frames
longer than 'buffer_size * ring_size'.

	David

> 
> Cc: stable@vger.kernel.org
> Fixes: 89eaefb61dc9 ("igb: Support RX-ALL feature flag.")
> Reported-by: Manfred Rudigier <manfred.rudigier@omicronenergy.com>
> Signed-off-by: Radoslaw Tyl <radoslawx.tyl@intel.com>
> Tested-by: Arpana Arland <arpanax.arland@intel.com> (A Contingent worker at Intel)
> Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
> ---
>  drivers/net/ethernet/intel/igb/igb_main.c | 11 +++++++----
>  1 file changed, 7 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/net/ethernet/intel/igb/igb_main.c b/drivers/net/ethernet/intel/igb/igb_main.c
> index 9a2561409b06..08e3df37089f 100644
> --- a/drivers/net/ethernet/intel/igb/igb_main.c
> +++ b/drivers/net/ethernet/intel/igb/igb_main.c
> @@ -4814,6 +4814,10 @@ void igb_configure_rx_ring(struct igb_adapter *adapter,
>  static void igb_set_rx_buffer_len(struct igb_adapter *adapter,
>  				  struct igb_ring *rx_ring)
>  {
> +#if (PAGE_SIZE < 8192)
> +	struct e1000_hw *hw = &adapter->hw;
> +#endif
> +
>  	/* set build_skb and buffer size flags */
>  	clear_ring_build_skb_enabled(rx_ring);
>  	clear_ring_uses_large_buffer(rx_ring);
> @@ -4824,10 +4828,9 @@ static void igb_set_rx_buffer_len(struct igb_adapter *adapter,
>  	set_ring_build_skb_enabled(rx_ring);
> 
>  #if (PAGE_SIZE < 8192)
> -	if (adapter->max_frame_size <= IGB_MAX_FRAME_BUILD_SKB)
> -		return;
> -
> -	set_ring_uses_large_buffer(rx_ring);
> +	if (adapter->max_frame_size > IGB_MAX_FRAME_BUILD_SKB ||
> +	    rd32(E1000_RCTL) & E1000_RCTL_SBP)
> +		set_ring_uses_large_buffer(rx_ring);
>  #endif
>  }
> 
> --
> 2.38.1
> 

-
Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK
Registration No: 1397386 (Wales)


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2023-08-28 10:00 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-08-24 20:46 [PATCH net] igb: set max size RX buffer when store bad packet is enabled Tony Nguyen
2023-08-28  6:10 ` patchwork-bot+netdevbpf
2023-08-28 10:00 ` David Laight

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).