diff options
author | Eric Dumazet <edumazet@google.com> | 2016-12-03 14:14:55 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2016-12-05 13:32:23 -0500 |
commit | 12a59abc22d6664f7d3944f625ceefee92de8820 (patch) | |
tree | 1a440d08ebc7f478066b858f5b071beaebe16e0c /net/ipv4/tcp_output.c | |
parent | 75eefc6c59fd2c5f1ab95a3a113c217237d12a31 (diff) |
tcp: tcp_mtu_probe() is likely to exit early
Adding a likely() in tcp_mtu_probe() moves its code which used to
be inlined in front of tcp_write_xmit()
We still have a cache line miss to access icsk->icsk_mtup.enabled,
we will probably have to reorganize fields to help data locality.
Signed-off-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4/tcp_output.c')
-rw-r--r-- | net/ipv4/tcp_output.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/net/ipv4/tcp_output.c b/net/ipv4/tcp_output.c index d5c46749adab..5f04bee4c86a 100644 --- a/net/ipv4/tcp_output.c +++ b/net/ipv4/tcp_output.c | |||
@@ -1932,26 +1932,26 @@ static inline void tcp_mtu_check_reprobe(struct sock *sk) | |||
1932 | */ | 1932 | */ |
1933 | static int tcp_mtu_probe(struct sock *sk) | 1933 | static int tcp_mtu_probe(struct sock *sk) |
1934 | { | 1934 | { |
1935 | struct tcp_sock *tp = tcp_sk(sk); | ||
1936 | struct inet_connection_sock *icsk = inet_csk(sk); | 1935 | struct inet_connection_sock *icsk = inet_csk(sk); |
1936 | struct tcp_sock *tp = tcp_sk(sk); | ||
1937 | struct sk_buff *skb, *nskb, *next; | 1937 | struct sk_buff *skb, *nskb, *next; |
1938 | struct net *net = sock_net(sk); | 1938 | struct net *net = sock_net(sk); |
1939 | int len; | ||
1940 | int probe_size; | 1939 | int probe_size; |
1941 | int size_needed; | 1940 | int size_needed; |
1942 | int copy; | 1941 | int copy, len; |
1943 | int mss_now; | 1942 | int mss_now; |
1944 | int interval; | 1943 | int interval; |
1945 | 1944 | ||
1946 | /* Not currently probing/verifying, | 1945 | /* Not currently probing/verifying, |
1947 | * not in recovery, | 1946 | * not in recovery, |
1948 | * have enough cwnd, and | 1947 | * have enough cwnd, and |
1949 | * not SACKing (the variable headers throw things off) */ | 1948 | * not SACKing (the variable headers throw things off) |
1950 | if (!icsk->icsk_mtup.enabled || | 1949 | */ |
1951 | icsk->icsk_mtup.probe_size || | 1950 | if (likely(!icsk->icsk_mtup.enabled || |
1952 | inet_csk(sk)->icsk_ca_state != TCP_CA_Open || | 1951 | icsk->icsk_mtup.probe_size || |
1953 | tp->snd_cwnd < 11 || | 1952 | inet_csk(sk)->icsk_ca_state != TCP_CA_Open || |
1954 | tp->rx_opt.num_sacks || tp->rx_opt.dsack) | 1953 | tp->snd_cwnd < 11 || |
1954 | tp->rx_opt.num_sacks || tp->rx_opt.dsack)) | ||
1955 | return -1; | 1955 | return -1; |
1956 | 1956 | ||
1957 | /* Use binary search for probe_size between tcp_mss_base, | 1957 | /* Use binary search for probe_size between tcp_mss_base, |