Skip to contentSkip to conversation

ipv6: tcp: consistently use MAX_TCP_HEADER

PATCH Applied Eric Dumazet 3 participants 3 messages Feb 22, 2022 – Feb 23, 2022

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ipv6: tcp: consistently use MAX_TCP_HEADER

From: Eric Dumazet <[email protected]>

All other skbs allocated for TCP tx are using MAX_TCP_HEADER already.

MAX_HEADER can be too small for some cases (like eBPF based encapsulation), so this can avoid extra pskb_expand_head() in lower stacks.

---
 net/ipv6/tcp_ipv6.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
net/ipv6/tcp_ipv6.c +2 -3
index 0c648bf07f395d5e1ec0917d32fe55a46e853912..309a8a583bcac089ff93daef6da2eadebd018092 100644
@@ -921,12 +921,11 @@ static void tcp_v6_send_response(const struct sock *sk, struct sk_buff *skb, u32
 	}
 #endif
 
-	buff = alloc_skb(MAX_HEADER + sizeof(struct ipv6hdr) + tot_len,
-			 GFP_ATOMIC);
+	buff = alloc_skb(MAX_TCP_HEADER, GFP_ATOMIC);
 	if (!buff)
 		return;
 
-	skb_reserve(buff, MAX_HEADER + sizeof(struct ipv6hdr) + tot_len);
+	skb_reserve(buff, MAX_TCP_HEADER);
 
 	t1 = skb_push(buff, tot_len);
 	skb_reset_transport_header(buff);
Signature · 1 line
2.35.1.473.g83b2b277ed-goog
Reviewed-by on v1 1/1
#1 lore raw
Quoted 4 lines · Eric Dumazet

From: Eric Dumazet <[email protected]>

All other skbs allocated for TCP tx are using MAX_TCP_HEADER already.

Quoted 8 lines

MAX_HEADER can be too small for some cases (like eBPF based encapsulation), so this can avoid extra pskb_expand_head() in lower stacks.

---
 net/ipv6/tcp_ipv6.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
#2 lore raw
In reply to Eric Dumazet
This patch was applied to netdev/net-next.git (master) by Jakub Kicinski <[email protected]>:

Hello:

This patch was applied to netdev/net-next.git (master) by Jakub Kicinski <[email protected]>:

Quoted 8 lines · On Mon, 21 Feb 2022 19:11:15 -0800 you wrote:

From: Eric Dumazet <[email protected]>

All other skbs allocated for TCP tx are using MAX_TCP_HEADER already.

MAX_HEADER can be too small for some cases (like eBPF based encapsulation), so this can avoid extra pskb_expand_head() in lower stacks.

[...]

Here is the summary with links:
- [net-next] ipv6: tcp: consistently use MAX_TCP_HEADER

    https://git.kernel.org/netdev/net-next/c/0ebea8f9b81c

You are awesome, thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html