aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv4/tcp_input.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/ipv4/tcp_input.c')
-rw-r--r--net/ipv4/tcp_input.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c
index 077d9abdfcf5..20f6fac5882e 100644
--- a/net/ipv4/tcp_input.c
+++ b/net/ipv4/tcp_input.c
@@ -77,7 +77,7 @@
77#include <asm/unaligned.h> 77#include <asm/unaligned.h>
78#include <linux/errqueue.h> 78#include <linux/errqueue.h>
79#include <trace/events/tcp.h> 79#include <trace/events/tcp.h>
80#include <linux/static_key.h> 80#include <linux/jump_label_ratelimit.h>
81#include <net/busy_poll.h> 81#include <net/busy_poll.h>
82 82
83int sysctl_tcp_max_orphans __read_mostly = NR_FILE; 83int sysctl_tcp_max_orphans __read_mostly = NR_FILE;
@@ -113,22 +113,28 @@ int sysctl_tcp_max_orphans __read_mostly = NR_FILE;
113#define REXMIT_NEW 2 /* FRTO-style transmit of unsent/new packets */ 113#define REXMIT_NEW 2 /* FRTO-style transmit of unsent/new packets */
114 114
115#if IS_ENABLED(CONFIG_TLS_DEVICE) 115#if IS_ENABLED(CONFIG_TLS_DEVICE)
116static DEFINE_STATIC_KEY_FALSE(clean_acked_data_enabled); 116static DEFINE_STATIC_KEY_DEFERRED_FALSE(clean_acked_data_enabled, HZ);
117 117
118void clean_acked_data_enable(struct inet_connection_sock *icsk, 118void clean_acked_data_enable(struct inet_connection_sock *icsk,
119 void (*cad)(struct sock *sk, u32 ack_seq)) 119 void (*cad)(struct sock *sk, u32 ack_seq))
120{ 120{
121 icsk->icsk_clean_acked = cad; 121 icsk->icsk_clean_acked = cad;
122 static_branch_inc(&clean_acked_data_enabled); 122 static_branch_inc(&clean_acked_data_enabled.key);
123} 123}
124EXPORT_SYMBOL_GPL(clean_acked_data_enable); 124EXPORT_SYMBOL_GPL(clean_acked_data_enable);
125 125
126void clean_acked_data_disable(struct inet_connection_sock *icsk) 126void clean_acked_data_disable(struct inet_connection_sock *icsk)
127{ 127{
128 static_branch_dec(&clean_acked_data_enabled); 128 static_branch_slow_dec_deferred(&clean_acked_data_enabled);
129 icsk->icsk_clean_acked = NULL; 129 icsk->icsk_clean_acked = NULL;
130} 130}
131EXPORT_SYMBOL_GPL(clean_acked_data_disable); 131EXPORT_SYMBOL_GPL(clean_acked_data_disable);
132
133void clean_acked_data_flush(void)
134{
135 static_key_deferred_flush(&clean_acked_data_enabled);
136}
137EXPORT_SYMBOL_GPL(clean_acked_data_flush);
132#endif 138#endif
133 139
134static void tcp_gro_dev_warn(struct sock *sk, const struct sk_buff *skb, 140static void tcp_gro_dev_warn(struct sock *sk, const struct sk_buff *skb,
@@ -3598,7 +3604,7 @@ static int tcp_ack(struct sock *sk, const struct sk_buff *skb, int flag)
3598 icsk->icsk_retransmits = 0; 3604 icsk->icsk_retransmits = 0;
3599 3605
3600#if IS_ENABLED(CONFIG_TLS_DEVICE) 3606#if IS_ENABLED(CONFIG_TLS_DEVICE)
3601 if (static_branch_unlikely(&clean_acked_data_enabled)) 3607 if (static_branch_unlikely(&clean_acked_data_enabled.key))
3602 if (icsk->icsk_clean_acked) 3608 if (icsk->icsk_clean_acked)
3603 icsk->icsk_clean_acked(sk, ack); 3609 icsk->icsk_clean_acked(sk, ack);
3604#endif 3610#endif