1 From 12a59abc22d6664f7d3944f625ceefee92de8820 Mon Sep 17 00:00:00 2001
2 From: Eric Dumazet <edumazet@google.com>
3 Date: Sat, 3 Dec 2016 11:14:55 -0800
4 Subject: [PATCH 06/10] tcp: tcp_mtu_probe() is likely to exit early
6 Adding a likely() in tcp_mtu_probe() moves its code which used to
7 be inlined in front of tcp_write_xmit()
9 We still have a cache line miss to access icsk->icsk_mtup.enabled,
10 we will probably have to reorganize fields to help data locality.
12 Signed-off-by: Eric Dumazet <edumazet@google.com>
13 Signed-off-by: David S. Miller <davem@davemloft.net>
15 net/ipv4/tcp_output.c | 18 +++++++++---------
16 1 file changed, 9 insertions(+), 9 deletions(-)
18 --- a/net/ipv4/tcp_output.c
19 +++ b/net/ipv4/tcp_output.c
20 @@ -1960,26 +1960,26 @@ static bool tcp_can_coalesce_send_queue_
22 static int tcp_mtu_probe(struct sock *sk)
24 - struct tcp_sock *tp = tcp_sk(sk);
25 struct inet_connection_sock *icsk = inet_csk(sk);
26 + struct tcp_sock *tp = tcp_sk(sk);
27 struct sk_buff *skb, *nskb, *next;
28 struct net *net = sock_net(sk);
37 /* Not currently probing/verifying,
39 * have enough cwnd, and
40 - * not SACKing (the variable headers throw things off) */
41 - if (!icsk->icsk_mtup.enabled ||
42 - icsk->icsk_mtup.probe_size ||
43 - inet_csk(sk)->icsk_ca_state != TCP_CA_Open ||
44 - tp->snd_cwnd < 11 ||
45 - tp->rx_opt.num_sacks || tp->rx_opt.dsack)
46 + * not SACKing (the variable headers throw things off)
48 + if (likely(!icsk->icsk_mtup.enabled ||
49 + icsk->icsk_mtup.probe_size ||
50 + inet_csk(sk)->icsk_ca_state != TCP_CA_Open ||
51 + tp->snd_cwnd < 11 ||
52 + tp->rx_opt.num_sacks || tp->rx_opt.dsack))
55 /* Use binary search for probe_size between tcp_mss_base,