diff mbox series

[net-next,3/3] tcp: remove unneeded code from tcp_stream_alloc_skb()

Message ID 20211025221342.806029-4-eric.dumazet@gmail.com (mailing list archive)
State Accepted
Commit c4322884ed2132beee95a16234035ad7cc991f09
Delegated to: Netdev Maintainers
Headers show
Series tcp: tcp_stream_alloc_skb() changes | expand

Checks

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

Commit Message

Eric Dumazet Oct. 25, 2021, 10:13 p.m. UTC
From: Eric Dumazet <edumazet@google.com>

Aligning @size argument to 4 bytes is not needed.

The header alignment has nothing to do with @size.

It really depends on skb->head alignment and MAX_TCP_HEADER.

Signed-off-by: Eric Dumazet <edumazet@google.com>
---
 net/ipv4/tcp.c | 3 ---
 1 file changed, 3 deletions(-)

Comments

Soheil Hassas Yeganeh Oct. 25, 2021, 11:09 p.m. UTC | #1
On Mon, Oct 25, 2021 at 6:13 PM Eric Dumazet <eric.dumazet@gmail.com> wrote:
>
> From: Eric Dumazet <edumazet@google.com>
>
> Aligning @size argument to 4 bytes is not needed.
>
> The header alignment has nothing to do with @size.
>
> It really depends on skb->head alignment and MAX_TCP_HEADER.
>
> Signed-off-by: Eric Dumazet <edumazet@google.com>

Acked-by: Soheil Hassas Yeganeh <soheil@google.com>

> ---
>  net/ipv4/tcp.c | 3 ---
>  1 file changed, 3 deletions(-)
>
> diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c
> index 121400557fde898283a8eae3b09d93479c4a089e..0a27b7ef1a9db8aea8d98cff4b8ab7092994febd 100644
> --- a/net/ipv4/tcp.c
> +++ b/net/ipv4/tcp.c
> @@ -861,9 +861,6 @@ struct sk_buff *tcp_stream_alloc_skb(struct sock *sk, int size, gfp_t gfp,
>  {
>         struct sk_buff *skb;
>
> -       /* The TCP header must be at least 32-bit aligned.  */
> -       size = ALIGN(size, 4);
> -
>         if (unlikely(tcp_under_memory_pressure(sk)))
>                 sk_mem_reclaim_partial(sk);
>
> --
> 2.33.0.1079.g6e70778dc9-goog
>
diff mbox series

Patch

diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c
index 121400557fde898283a8eae3b09d93479c4a089e..0a27b7ef1a9db8aea8d98cff4b8ab7092994febd 100644
--- a/net/ipv4/tcp.c
+++ b/net/ipv4/tcp.c
@@ -861,9 +861,6 @@  struct sk_buff *tcp_stream_alloc_skb(struct sock *sk, int size, gfp_t gfp,
 {
 	struct sk_buff *skb;
 
-	/* The TCP header must be at least 32-bit aligned.  */
-	size = ALIGN(size, 4);
-
 	if (unlikely(tcp_under_memory_pressure(sk)))
 		sk_mem_reclaim_partial(sk);