idpf: do not linearize big TSO packets
Subsystems (3)
PATCH 1/1 idpf: do not linearize big TSO packets
idpf has a limit on number of scatter-gather frags that can be used per segment.
Currently, idpf_tx_start() checks if the limit is hit and forces a linearization of the whole packet.
This requires high order allocations that can fail under memory pressure. A full size BIG-TCP packet would require order-7 alocation on x86_64 :/
We can move the check earlier from idpf_features_check() for TSO packets, to force GSO in this case, removing the cost of a big copy.
This means that a linearization will eventually happen with sizes smaller than one MSS.
__idpf_chk_linearize() is renamed to idpf_chk_tso_segment() and moved to idpf_lib.c
--- drivers/net/ethernet/intel/idpf/idpf.h | 2 + drivers/net/ethernet/intel/idpf/idpf_lib.c | 102 +++++++++++++++- drivers/net/ethernet/intel/idpf/idpf_txrx.c | 129 ++++---------------- 3 files changed, 120 insertions(+), 113 deletions(-)
drivers/net/ethernet/intel/idpf/idpf.h +2 -0
@@ -148,6 +148,7 @@ enum idpf_vport_state {* @link_speed_mbps: Link speed in mbps * @vport_idx: Relative vport index * @max_tx_hdr_size: Max header length hardware can support +* @tx_max_bufs: Max buffers that can be transmitted with scatter-gather * @state: See enum idpf_vport_state * @netstats: Packet and byte stats * @stats_lock: Lock to protect stats update
@@ -159,6 +160,7 @@ struct idpf_netdev_priv {u32 link_speed_mbps;u16 vport_idx;u16 max_tx_hdr_size; +u16 tx_max_bufs;enum idpf_vport_state state;struct rtnl_link_stats64 netstats;spinlock_t stats_lock;
drivers/net/ethernet/intel/idpf/idpf_lib.c +96 -6
120 lines not on this page · raw message
drivers/net/ethernet/intel/idpf/idpf_txrx.c +22 -107
141 lines not on this page · raw message
Signature · 1 line
2.51.0.rc1.167.g924127e9c0-goog
Quoted 32 lines
From: Eric Dumazet <[email protected]>
idpf has a limit on number of scatter-gather frags that can be used per segment.
Currently,
idpf_tx_start()checks if the limit is hit and forces a linearization of the whole packet.This requires high order allocations that can fail under memory pressure. A full size BIG-TCP packet would require order-7 alocation on
x86_64:/We can move the check earlier from
idpf_features_check()for TSO packets, to force GSO in this case, removing the cost of a big copy.This means that a linearization will eventually happen with sizes smaller than one MSS.
__idpf_chk_linearize()is renamed toidpf_chk_tso_segment()and moved toidpf_lib.cSigned-off-by Eric Dumazet <[email protected]>Cc Tony Nguyen <[email protected]>Cc Przemek Kitszel <[email protected]>Cc Jacob Keller <[email protected]>Cc Madhu Chittim <[email protected]>Cc Pavan Kumar Linga <[email protected]>Cc Joshua Hay <[email protected]>Cc Brian Vazquez <[email protected]>Cc Willem de Bruijn <[email protected]>Cc Andrew Lunn <[email protected]>
Quoted 1 line
---
Brian Vazquez
Tested-byQuoted 35 lines · Joshua A
Quoted 33 lines
From: Eric Dumazet <[email protected]>
idpf has a limit on number of scatter-gather frags that can be used per segment.
Currently,
idpf_tx_start()checks if the limit is hit and forces a linearization of the whole packet.This requires high order allocations that can fail under memory pressure. A full size BIG-TCP packet would require order-7 alocation on
x86_64:/We can move the check earlier from
idpf_features_check()for TSO packets, to force GSO in this case, removing the cost of a big copy.This means that a linearization will eventually happen with sizes smaller than one MSS.
__idpf_chk_linearize()is renamed toidpf_chk_tso_segment()and moved toidpf_lib.cSigned-off-by Eric Dumazet <[email protected]>Cc Tony Nguyen <[email protected]>Cc Przemek Kitszel <[email protected]>Cc Jacob Keller <[email protected]>Cc Madhu Chittim <[email protected]>Cc Pavan Kumar Linga <[email protected]>Cc Joshua Hay <[email protected]>Cc Brian Vazquez <[email protected]>Cc Willem de Bruijn <[email protected]>Cc Andrew Lunn <[email protected]>Quoted 1 line
---
Reviewed-by Joshua Hay <[email protected]>
Quoted 14 lines · Eric Dumazet
idpf has a limit on number of scatter-gather frags that can be used per segment.
Currently,
idpf_tx_start()checks if the limit is hit and forces a linearization of the whole packet.This requires high order allocations that can fail under memory pressure. A full size BIG-TCP packet would require order-7 alocation on
x86_64:/We can move the check earlier from
idpf_features_check()for TSO packets, to force GSO in this case, removing the cost of a big copy.
Quoted 8 lines
This means that a linearization will eventually happen with sizes smaller than one MSS.
__idpf_chk_linearize()is renamed toidpf_chk_tso_segment()and moved toidpf_lib.cSigned-off-by Eric Dumazet <[email protected]>Cc Tony Nguyen <[email protected]>
Quoted 8 lines
Cc Przemek Kitszel <[email protected]>Cc Jacob Keller <[email protected]>Cc Madhu Chittim <[email protected]>Cc Pavan Kumar Linga <[email protected]>Cc Joshua Hay <[email protected]>Cc Brian Vazquez <[email protected]>Cc Willem de Bruijn <[email protected]>Cc Andrew Lunn <[email protected]>
This patch was applied to netdev/net-next.git (main) by Jakub Kicinski <[email protected]>:
Hello:
This patch was applied to netdev/net-next.git (main) by Jakub Kicinski <[email protected]>:
Quoted 11 lines · On Mon, 18 Aug 2025 19:59:34 +0000 you wrote:
idpf has a limit on number of scatter-gather frags that can be used per segment.
Currently,
idpf_tx_start()checks if the limit is hit and forces a linearization of the whole packet.This requires high order allocations that can fail under memory pressure. A full size BIG-TCP packet would require order-7 alocation on
x86_64:/[...]
Here is the summary with links:
- [net-next] idpf: do not linearize big TSO packets
https://git.kernel.org/netdev/net-next/c/02614eee26fb
You are awesome, thank you!
Signature · 2 lines
Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html