Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

tcp: tcp_make_synack() minor changes

There is no need to allocate 15 bytes in excess for a SYNACK packet,
as it contains no data, only headers.

SYNACK are always generated in softirq context, and contain a single
segment, we can use TCP_INC_STATS_BH()

Signed-off-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

Eric Dumazet and committed by
David S. Miller
a0b8486c e5fd387a

+2 -2
+2 -2
net/ipv4/tcp_output.c
··· 2741 2741 int tcp_header_size; 2742 2742 int mss; 2743 2743 2744 - skb = sock_wmalloc(sk, MAX_TCP_HEADER + 15, 1, GFP_ATOMIC); 2744 + skb = sock_wmalloc(sk, MAX_TCP_HEADER, 1, GFP_ATOMIC); 2745 2745 if (unlikely(!skb)) { 2746 2746 dst_release(dst); 2747 2747 return NULL; ··· 2811 2811 th->window = htons(min(req->rcv_wnd, 65535U)); 2812 2812 tcp_options_write((__be32 *)(th + 1), tp, &opts); 2813 2813 th->doff = (tcp_header_size >> 2); 2814 - TCP_ADD_STATS(sock_net(sk), TCP_MIB_OUTSEGS, tcp_skb_pcount(skb)); 2814 + TCP_INC_STATS_BH(sock_net(sk), TCP_MIB_OUTSEGS); 2815 2815 2816 2816 #ifdef CONFIG_TCP_MD5SIG 2817 2817 /* Okay, we have all we need - do the md5 hash if needed */