igb: cope with large MAX_SKB_FRAGS.
Subsystems (3)
PATCH 1/1 igb: cope with large MAX_SKB_FRAGS.
From: Paolo Abeni <[email protected]>
Sabrina reports that the igb driver does not cope well with large MAX_SKB_FRAG values: setting MAX_SKB_FRAG to 45 causes payload corruption on TX.
The root cause of the issue is that the driver does not take into account properly the (possibly large) shared info size when selecting the ring layout, and will try to fit two packets inside the same 4K page even when the 1st fraglist will trump over the 2nd head.
Address the issue forcing the driver to fit a single packet per page, leaving there enough room to store the (currently) largest possible skb_shared_info.
--- drivers/net/ethernet/intel/igb/igb_main.c | 1 + 1 file changed, 1 insertion(+)
drivers/net/ethernet/intel/igb/igb_main.c +1 -0
@@ -4833,6 +4833,7 @@ static void igb_set_rx_buffer_len(struct igb_adapter *adapter,#if (PAGE_SIZE <8192 )if (adapter->max_frame_size >IGB_MAX_FRAME_BUILD_SKB || +SKB_HEAD_ALIGN (adapter->max_frame_size) > (PAGE_SIZE /2 ) ||rd32 (E1000_RCTL ) &E1000_RCTL_SBP )set_ring_uses_large_buffer (rx_ring);#endif
Signature · 1 line
2.44.0
Quoted 15 lines · Tue, Apr 23, 2024 at 12:24:46PM CEST, [email protected] wrote:
From: Paolo Abeni <[email protected]>
Sabrina reports that the igb driver does not cope well with large
MAX_SKB_FRAGvalues: settingMAX_SKB_FRAGto 45 causes payload corruption on TX.The root cause of the issue is that the driver does not take into account properly the (possibly large) shared info size when selecting the ring layout, and will try to fit two packets inside the same 4K page even when the 1st fraglist will trump over the 2nd head.
Address the issue forcing the driver to fit a single packet per page, leaving there enough room to store the (currently) largest possible
skb_shared_info.
Quoted 7 lines
Fixes 3948b05950fd ("net: introduce a config option to tweak MAX_SKB_FRAG")Reported-by Jan Tluka <[email protected]>Reported-by Jirka Hladky <[email protected]>Reported-by Sabrina Dubroca <[email protected]>Tested-by Sabrina Dubroca <[email protected]>Tested-by Corinna Vinschen <[email protected]>Signed-off-by Paolo Abeni <[email protected]>
Next time, please indicate target tree (net) in [patch] brackets.
Quoted 20 lines
---
drivers/net/ethernet/intel/igb/igb_main.c| 1 +1 file changed, 1 insertion(+)drivers/net/ethernet/intel/igb/igb_main.c +1
-0@@ -4833,6 +4833,7 @@ static void igb_set_rx_buffer_len(struct igb_adapter *adapter,#if (PAGE_SIZE <8192 )if (adapter->max_frame_size >IGB_MAX_FRAME_BUILD_SKB || +SKB_HEAD_ALIGN (adapter->max_frame_size) > (PAGE_SIZE /2 ) ||rd32 (E1000_RCTL ) &E1000_RCTL_SBP )set_ring_uses_large_buffer (rx_ring);#endif Signature · 1 line
2.44.0
Quoted 22 lines · Tue, Apr 23, 2024 at 12:24:46PM CEST, [email protected] wrote:
From: Paolo Abeni <[email protected]>
Sabrina reports that the igb driver does not cope well with large
MAX_SKB_FRAGvalues: settingMAX_SKB_FRAGto 45 causes payload corruption on TX.The root cause of the issue is that the driver does not take into account properly the (possibly large) shared info size when selecting the ring layout, and will try to fit two packets inside the same 4K page even when the 1st fraglist will trump over the 2nd head.
Address the issue forcing the driver to fit a single packet per page, leaving there enough room to store the (currently) largest possible
skb_shared_info.Fixes 3948b05950fd ("net: introduce a config option to tweak MAX_SKB_FRAG")Reported-by Jan Tluka <[email protected]>Reported-by Jirka Hladky <[email protected]>Reported-by Sabrina Dubroca <[email protected]>Tested-by Sabrina Dubroca <[email protected]>Tested-by Corinna Vinschen <[email protected]>Signed-off-by Paolo Abeni <[email protected]>
Quoted 2 lines
---
drivers/net/ethernet/intel/igb/igb_main.c| 1 +
Also, please use get_maintainer.pl script to get cclist.
Dear Corinna,
Thank you for the patch.
Am 23.04.24 um 12:24 schrieb Corinna Vinschen:
Quoted 1 line
From: Paolo Abeni <[email protected]>
It’d be great if you removed the trailing dot/period in the commit message summary.
Quoted 4 lines
Sabrina reports that the igb driver does not cope well with large
MAX_SKB_FRAGvalues: settingMAX_SKB_FRAGto 45 causes payload corruption on TX.
Quoted 8 lines
The root cause of the issue is that the driver does not take into account properly the (possibly large) shared info size when selecting the ring layout, and will try to fit two packets inside the same 4K page even when the 1st fraglist will trump over the 2nd head.
Address the issue forcing the driver to fit a single packet per page, leaving there enough room to store the (currently) largest possible
skb_shared_info.
If you have a reproducer for this, it’d be great if you could document it in the commit message.
Quoted 16 lines
Fixes 3948b05950fd ("net: introduce a config option to tweak MAX_SKB_FRAG")Reported-by Jan Tluka <[email protected]>Reported-by Jirka Hladky <[email protected]>Reported-by Sabrina Dubroca <[email protected]>Tested-by Sabrina Dubroca <[email protected]>Tested-by Corinna Vinschen <[email protected]>Signed-off-by Paolo Abeni <[email protected]>--- drivers/net/ethernet/intel/igb/igb_main.c | 1 + 1 file changed, 1 insertion(+)drivers/net/ethernet/intel/igb/igb_main.c +0
-0
drivers/net/ethernet/intel/igb/igb_main.c static void igb_set_rx_buffer_len(struct igb_adapter *adapter, · line 4839
Quoted 7 lines
drivers/net/ethernet/intel/igb/igb_main.c +1
-0@@ -4833,6 +4833,7 @@ static void igb_set_rx_buffer_len(struct igb_adapter *adapter,#if (PAGE_SIZE <8192 )if (adapter->max_frame_size >IGB_MAX_FRAME_BUILD_SKB || +SKB_HEAD_ALIGN (adapter->max_frame_size) > (PAGE_SIZE /2 ) ||rd32 (E1000_RCTL ) &E1000_RCTL_SBP )set_ring_uses_large_buffer (rx_ring);#endif
Kind regards,
Paul
Hi Paul,
Quoted 21 lines · Paul Menzel
Dear Corinna,
Thank you for the patch.
Am 23.04.24 um 12:24 schrieb Corinna Vinschen:
Quoted 1 line
From: Paolo Abeni <[email protected]>
It’d be great if you removed the trailing dot/period in the commit message summary.
Quoted 9 lines
Sabrina reports that the igb driver does not cope well with large
MAX_SKB_FRAGvalues: settingMAX_SKB_FRAGto 45 causes payload corruption on TX.The root cause of the issue is that the driver does not take into account properly the (possibly large) shared info size when selecting the ring layout, and will try to fit two packets inside the same 4K page even when the 1st fraglist will trump over the 2nd head.
Quoted 6 lines
Quoted 3 lines
Address the issue forcing the driver to fit a single packet per page, leaving there enough room to store the (currently) largest possible
skb_shared_info.If you have a reproducer for this, it’d be great if you could document it in the commit message.
I fixed the trailing dot and added a reproducer.
Thanks,
Corinna
Hi Jiri,
Quoted 26 lines · Jiri Pirko
Quoted 22 lines · Tue, Apr 23, 2024 at 12:24:46PM CEST, [email protected] wrote:
From: Paolo Abeni <[email protected]>
Sabrina reports that the igb driver does not cope well with large
MAX_SKB_FRAGvalues: settingMAX_SKB_FRAGto 45 causes payload corruption on TX.The root cause of the issue is that the driver does not take into account properly the (possibly large) shared info size when selecting the ring layout, and will try to fit two packets inside the same 4K page even when the 1st fraglist will trump over the 2nd head.
Address the issue forcing the driver to fit a single packet per page, leaving there enough room to store the (currently) largest possible
skb_shared_info.Fixes 3948b05950fd ("net: introduce a config option to tweak MAX_SKB_FRAG")Reported-by Jan Tluka <[email protected]>Reported-by Jirka Hladky <[email protected]>Reported-by Sabrina Dubroca <[email protected]>Tested-by Sabrina Dubroca <[email protected]>Tested-by Corinna Vinschen <[email protected]>Signed-off-by Paolo Abeni <[email protected]>Quoted 2 lines
---
drivers/net/ethernet/intel/igb/igb_main.c| 1 +
Quoted 1 line
Also, please use get_maintainer.pl script to get cclist.
done and done in v2 (for which I forgot the "in-reply-to" now, d'uh)
Thanks,
Corinna
Quoted 29 lines · Tue, Apr 23, 2024 at 03:54:05PM CEST, [email protected] wrote:
Hi Jiri,
Quoted 26 lines · Jiri Pirko
Quoted 24 lines · Tue, Apr 23, 2024 at 12:24:46PM CEST, [email protected] wrote:
From: Paolo Abeni <[email protected]>
Sabrina reports that the igb driver does not cope well with large
MAX_SKB_FRAGvalues: settingMAX_SKB_FRAGto 45 causes payload corruption on TX.The root cause of the issue is that the driver does not take into account properly the (possibly large) shared info size when selecting the ring layout, and will try to fit two packets inside the same 4K page even when the 1st fraglist will trump over the 2nd head.
Address the issue forcing the driver to fit a single packet per page, leaving there enough room to store the (currently) largest possible
skb_shared_info.Fixes 3948b05950fd ("net: introduce a config option to tweak MAX_SKB_FRAG")Reported-by Jan Tluka <[email protected]>Reported-by Jirka Hladky <[email protected]>Reported-by Sabrina Dubroca <[email protected]>Tested-by Sabrina Dubroca <[email protected]>Tested-by Corinna Vinschen <[email protected]>Signed-off-by Paolo Abeni <[email protected]>---
drivers/net/ethernet/intel/igb/igb_main.c| 1 +
Quoted 3 lines
Quoted 1 line
Also, please use get_maintainer.pl script to get cclist.
done and done in v2 (for which I forgot the "in-reply-to" now, d'uh)
In-reply-to is not needed. Send each V to separate thread.
Quoted 5 lines
Thanks,
Corinna