diff options
author | Pavel Kubelun <be.dissent@gmail.com> | 2017-07-25 03:57:31 -0400 |
---|---|---|
committer | Stijn Tintel <stijn@linux-ipv6.be> | 2017-10-08 15:19:07 +0300 |
commit | b2ea46fe236ae02d845f94cf984cbc1786870333 (patch) | |
tree | 277ff9cd154420367c261324e69ba831e3c762b7 /target/linux/generic/backport-4.9/024-1-tcp-tsq-add-tsq_flags-tsq_enum.patch | |
parent | 3a69ad3b2a0df578ca340ba95f35230ee9529c9c (diff) | |
download | upstream-b2ea46fe236ae02d845f94cf984cbc1786870333.tar.gz upstream-b2ea46fe236ae02d845f94cf984cbc1786870333.tar.bz2 upstream-b2ea46fe236ae02d845f94cf984cbc1786870333.zip |
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 <be.dissent@gmail.com>
Diffstat (limited to 'target/linux/generic/backport-4.9/024-1-tcp-tsq-add-tsq_flags-tsq_enum.patch')
-rw-r--r-- | target/linux/generic/backport-4.9/024-1-tcp-tsq-add-tsq_flags-tsq_enum.patch | 90 |
1 files changed, 90 insertions, 0 deletions
diff --git a/target/linux/generic/backport-4.9/024-1-tcp-tsq-add-tsq_flags-tsq_enum.patch b/target/linux/generic/backport-4.9/024-1-tcp-tsq-add-tsq_flags-tsq_enum.patch new file mode 100644 index 0000000000..20311498aa --- /dev/null +++ b/target/linux/generic/backport-4.9/024-1-tcp-tsq-add-tsq_flags-tsq_enum.patch @@ -0,0 +1,90 @@ +From 40fc3423b983b864bf70b03199191260ae9b2ea6 Mon Sep 17 00:00:00 2001 +From: Eric Dumazet <edumazet@google.com> +Date: Sat, 3 Dec 2016 11:14:50 -0800 +Subject: [PATCH 01/10] tcp: tsq: add tsq_flags / tsq_enum + +This is a cleanup, to ease code review of following patches. + +Old 'enum tsq_flags' is renamed, and a new enumeration is added +with the flags used in cmpxchg() operations as opposed to +single bit operations. + +Signed-off-by: Eric Dumazet <edumazet@google.com> +Signed-off-by: David S. Miller <davem@davemloft.net> +--- + include/linux/tcp.h | 11 ++++++++++- + net/ipv4/tcp_output.c | 16 ++++++++-------- + 2 files changed, 18 insertions(+), 9 deletions(-) + +--- a/include/linux/tcp.h ++++ b/include/linux/tcp.h +@@ -367,7 +367,7 @@ struct tcp_sock { + u32 *saved_syn; + }; + +-enum tsq_flags { ++enum tsq_enum { + TSQ_THROTTLED, + TSQ_QUEUED, + TCP_TSQ_DEFERRED, /* tcp_tasklet_func() found socket was owned */ +@@ -378,6 +378,15 @@ enum tsq_flags { + */ + }; + ++enum tsq_flags { ++ TSQF_THROTTLED = (1UL << TSQ_THROTTLED), ++ TSQF_QUEUED = (1UL << TSQ_QUEUED), ++ TCPF_TSQ_DEFERRED = (1UL << TCP_TSQ_DEFERRED), ++ TCPF_WRITE_TIMER_DEFERRED = (1UL << TCP_WRITE_TIMER_DEFERRED), ++ TCPF_DELACK_TIMER_DEFERRED = (1UL << TCP_DELACK_TIMER_DEFERRED), ++ TCPF_MTU_REDUCED_DEFERRED = (1UL << TCP_MTU_REDUCED_DEFERRED), ++}; ++ + static inline struct tcp_sock *tcp_sk(const struct sock *sk) + { + return (struct tcp_sock *)sk; +--- a/net/ipv4/tcp_output.c ++++ b/net/ipv4/tcp_output.c +@@ -784,10 +784,10 @@ static void tcp_tasklet_func(unsigned lo + } + } + +-#define TCP_DEFERRED_ALL ((1UL << TCP_TSQ_DEFERRED) | \ +- (1UL << TCP_WRITE_TIMER_DEFERRED) | \ +- (1UL << TCP_DELACK_TIMER_DEFERRED) | \ +- (1UL << TCP_MTU_REDUCED_DEFERRED)) ++#define TCP_DEFERRED_ALL (TCPF_TSQ_DEFERRED | \ ++ TCPF_WRITE_TIMER_DEFERRED | \ ++ TCPF_DELACK_TIMER_DEFERRED | \ ++ TCPF_MTU_REDUCED_DEFERRED) + /** + * tcp_release_cb - tcp release_sock() callback + * @sk: socket +@@ -808,7 +808,7 @@ void tcp_release_cb(struct sock *sk) + nflags = flags & ~TCP_DEFERRED_ALL; + } while (cmpxchg(&tp->tsq_flags, flags, nflags) != flags); + +- if (flags & (1UL << TCP_TSQ_DEFERRED)) ++ if (flags & TCPF_TSQ_DEFERRED) + tcp_tsq_handler(sk); + + /* Here begins the tricky part : +@@ -822,15 +822,15 @@ void tcp_release_cb(struct sock *sk) + */ + sock_release_ownership(sk); + +- if (flags & (1UL << TCP_WRITE_TIMER_DEFERRED)) { ++ if (flags & TCPF_WRITE_TIMER_DEFERRED) { + tcp_write_timer_handler(sk); + __sock_put(sk); + } +- if (flags & (1UL << TCP_DELACK_TIMER_DEFERRED)) { ++ if (flags & TCPF_DELACK_TIMER_DEFERRED) { + tcp_delack_timer_handler(sk); + __sock_put(sk); + } +- if (flags & (1UL << TCP_MTU_REDUCED_DEFERRED)) { ++ if (flags & TCPF_MTU_REDUCED_DEFERRED) { + inet_csk(sk)->icsk_af_ops->mtu_reduced(sk); + __sock_put(sk); + } |