diff mbox series

[net-next] ipv6: tcp: consistently use MAX_TCP_HEADER

Message ID 20220222031115.4005060-1-eric.dumazet@gmail.com (mailing list archive)
State Accepted
Commit 0ebea8f9b81cc02bbef2ec720a4c19e841c03217
Delegated to: Netdev Maintainers
Headers show
Series [net-next] ipv6: tcp: consistently use MAX_TCP_HEADER | expand

Checks

Context Check Description
netdev/tree_selection success Clearly marked for net-next
netdev/fixes_present success Fixes tag not required for -next series
netdev/subject_prefix success Link
netdev/cover_letter success Single patches do not need cover letters
netdev/patch_count success Link
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 2 this patch: 2
netdev/cc_maintainers warning 2 maintainers not CCed: dsahern@kernel.org yoshfuji@linux-ipv6.org
netdev/build_clang success Errors and warnings before: 0 this patch: 0
netdev/module_param success Was 0 now: 0
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/verify_fixes success No Fixes tag
netdev/build_allmodconfig_warn success Errors and warnings before: 2 this patch: 2
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 14 lines checked
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0

Commit Message

Eric Dumazet Feb. 22, 2022, 3:11 a.m. UTC
From: Eric Dumazet <edumazet@google.com>

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.

Signed-off-by: Eric Dumazet <edumazet@google.com>
---
 net/ipv6/tcp_ipv6.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

Comments

David Ahern Feb. 22, 2022, 6:47 p.m. UTC | #1
On 2/21/22 8:11 PM, Eric Dumazet wrote:
> From: Eric Dumazet <edumazet@google.com>
> 
> 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.
> 
> Signed-off-by: Eric Dumazet <edumazet@google.com>
> ---
>  net/ipv6/tcp_ipv6.c | 5 ++---
>  1 file changed, 2 insertions(+), 3 deletions(-)
> 

Reviewed-by: David Ahern <dsahern@kernel.org>
patchwork-bot+netdevbpf@kernel.org Feb. 23, 2022, 1:40 a.m. UTC | #2
Hello:

This patch was applied to netdev/net-next.git (master)
by Jakub Kicinski <kuba@kernel.org>:

On Mon, 21 Feb 2022 19:11:15 -0800 you wrote:
> From: Eric Dumazet <edumazet@google.com>
> 
> 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!
diff mbox series

Patch

diff --git a/net/ipv6/tcp_ipv6.c b/net/ipv6/tcp_ipv6.c
index 0c648bf07f395d5e1ec0917d32fe55a46e853912..309a8a583bcac089ff93daef6da2eadebd018092 100644
--- a/net/ipv6/tcp_ipv6.c
+++ b/net/ipv6/tcp_ipv6.c
@@ -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);