From b2ea46fe236ae02d845f94cf984cbc1786870333 Mon Sep 17 00:00:00 2001 From: Pavel Kubelun Date: Tue, 25 Jul 2017 03:57:31 -0400 Subject: generic: net: tcp: backport tcp tx performance patches An overall throughput gain of 22 % for heavy TCP use over a single TX queue. Original patchset comment https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?h=v4.13&id=3f4888adae7c1619b990d98a9b967536f71822b8 Signed-off-by: Pavel Kubelun --- ...tcp-tcp_mtu_probe-is-likely-to-exit-early.patch | 55 ++++++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 target/linux/generic/backport-4.9/024-6-tcp-tcp_mtu_probe-is-likely-to-exit-early.patch (limited to 'target/linux/generic/backport-4.9/024-6-tcp-tcp_mtu_probe-is-likely-to-exit-early.patch') diff --git a/target/linux/generic/backport-4.9/024-6-tcp-tcp_mtu_probe-is-likely-to-exit-early.patch b/target/linux/generic/backport-4.9/024-6-tcp-tcp_mtu_probe-is-likely-to-exit-early.patch new file mode 100644 index 0000000000..f0ae2a938e --- /dev/null +++ b/target/linux/generic/backport-4.9/024-6-tcp-tcp_mtu_probe-is-likely-to-exit-early.patch @@ -0,0 +1,55 @@ +From 12a59abc22d6664f7d3944f625ceefee92de8820 Mon Sep 17 00:00:00 2001 +From: Eric Dumazet +Date: Sat, 3 Dec 2016 11:14:55 -0800 +Subject: [PATCH 06/10] 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 +Signed-off-by: David S. Miller +--- + net/ipv4/tcp_output.c | 18 +++++++++--------- + 1 file changed, 9 insertions(+), 9 deletions(-) + +--- a/net/ipv4/tcp_output.c ++++ b/net/ipv4/tcp_output.c +@@ -1925,26 +1925,26 @@ static inline void tcp_mtu_check_reprobe + */ + static int tcp_mtu_probe(struct sock *sk) + { +- struct tcp_sock *tp = tcp_sk(sk); + struct inet_connection_sock *icsk = inet_csk(sk); ++ struct tcp_sock *tp = tcp_sk(sk); + struct sk_buff *skb, *nskb, *next; + struct net *net = sock_net(sk); +- int len; + int probe_size; + int size_needed; +- int copy; ++ int copy, len; + int mss_now; + int interval; + + /* Not currently probing/verifying, + * not in recovery, + * have enough cwnd, and +- * not SACKing (the variable headers throw things off) */ +- if (!icsk->icsk_mtup.enabled || +- icsk->icsk_mtup.probe_size || +- inet_csk(sk)->icsk_ca_state != TCP_CA_Open || +- tp->snd_cwnd < 11 || +- tp->rx_opt.num_sacks || tp->rx_opt.dsack) ++ * not SACKing (the variable headers throw things off) ++ */ ++ if (likely(!icsk->icsk_mtup.enabled || ++ icsk->icsk_mtup.probe_size || ++ inet_csk(sk)->icsk_ca_state != TCP_CA_Open || ++ tp->snd_cwnd < 11 || ++ tp->rx_opt.num_sacks || tp->rx_opt.dsack)) + return -1; + + /* Use binary search for probe_size between tcp_mss_base, -- cgit v1.2.3