Thread (8 messages) flat view 8 messages, 3 authors, 2021-10-26

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

From: Soheil Hassas Yeganeh <hidden>
Date: 2021-10-25 23:10:34

On Mon, Oct 25, 2021 at 6:13 PM Eric Dumazet [off-list ref] 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 <redacted>
quoted hunk ↗ jump to hunk
---
 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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help