Skip to content

Commit

Permalink
tcp: remove unneeded code from tcp_stream_alloc_skb()
Browse files Browse the repository at this point in the history
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>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Eric Dumazet authored and David S. Miller committed Oct 26, 2021
1 parent 8a794df commit c432288
Showing 1 changed file with 0 additions and 3 deletions.
3 changes: 0 additions & 3 deletions net/ipv4/tcp.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down

0 comments on commit c432288

Please sign in to comment.