diff options
author | Eric Dumazet <edumazet@google.com> | 2018-11-27 18:03:21 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2018-11-30 16:28:03 -0500 |
commit | 6015c71e656bb6895b416c31a8b7db457e45cecf (patch) | |
tree | ba31e8ae21f52048e475daa33f6bb86df5bfc3b5 /net/ipv4/tcp.c | |
parent | 2f69555315ad7dc1ac37366b2ac2429e2d24d444 (diff) |
tcp: md5: add tcp_md5_needed jump label
Most linux hosts never setup TCP MD5 keys. We can avoid a
cache line miss (accessing tp->md5ig_info) on RX and TX
using a jump label.
Signed-off-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4/tcp.c')
-rw-r--r-- | net/ipv4/tcp.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c index 252048776dbb..215e4d3b3616 100644 --- a/net/ipv4/tcp.c +++ b/net/ipv4/tcp.c | |||
@@ -3656,8 +3656,11 @@ bool tcp_alloc_md5sig_pool(void) | |||
3656 | if (unlikely(!tcp_md5sig_pool_populated)) { | 3656 | if (unlikely(!tcp_md5sig_pool_populated)) { |
3657 | mutex_lock(&tcp_md5sig_mutex); | 3657 | mutex_lock(&tcp_md5sig_mutex); |
3658 | 3658 | ||
3659 | if (!tcp_md5sig_pool_populated) | 3659 | if (!tcp_md5sig_pool_populated) { |
3660 | __tcp_alloc_md5sig_pool(); | 3660 | __tcp_alloc_md5sig_pool(); |
3661 | if (tcp_md5sig_pool_populated) | ||
3662 | static_key_slow_inc(&tcp_md5_needed); | ||
3663 | } | ||
3661 | 3664 | ||
3662 | mutex_unlock(&tcp_md5sig_mutex); | 3665 | mutex_unlock(&tcp_md5sig_mutex); |
3663 | } | 3666 | } |