net: move sysctl_skb_defer_max to net_hotdata
sysctl_skb_defer_max is used in TCP fast path, move it to net_hodata. Signed-off-by: Eric Dumazet <edumazet@google.com> Reviewed-by: David Ahern <dsahern@kernel.org> Link: https://lore.kernel.org/r/20240429134025.1233626-3-edumazet@google.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
parent
a86a0661b8
commit
d480dc76d9
|
@ -39,6 +39,7 @@ struct net_hotdata {
|
|||
int dev_tx_weight;
|
||||
int dev_rx_weight;
|
||||
int sysctl_max_skb_frags;
|
||||
int sysctl_skb_defer_max;
|
||||
};
|
||||
|
||||
#define inet_ehash_secret net_hotdata.tcp_protocol.secret
|
||||
|
|
|
@ -4450,7 +4450,6 @@ EXPORT_SYMBOL(__dev_direct_xmit);
|
|||
*************************************************************************/
|
||||
static DEFINE_PER_CPU(struct task_struct *, backlog_napi);
|
||||
|
||||
unsigned int sysctl_skb_defer_max __read_mostly = 64;
|
||||
int weight_p __read_mostly = 64; /* old backlog weight */
|
||||
int dev_weight_rx_bias __read_mostly = 1; /* bias for backlog weight */
|
||||
int dev_weight_tx_bias __read_mostly = 1; /* bias for output_queue quota */
|
||||
|
|
|
@ -36,7 +36,6 @@ int dev_addr_init(struct net_device *dev);
|
|||
void dev_addr_check(struct net_device *dev);
|
||||
|
||||
/* sysctls not referred to from outside net/core/ */
|
||||
extern unsigned int sysctl_skb_defer_max;
|
||||
extern int netdev_unregister_timeout_secs;
|
||||
extern int weight_p;
|
||||
extern int dev_weight_rx_bias;
|
||||
|
|
|
@ -19,5 +19,6 @@ struct net_hotdata net_hotdata __cacheline_aligned = {
|
|||
.dev_tx_weight = 64,
|
||||
.dev_rx_weight = 64,
|
||||
.sysctl_max_skb_frags = MAX_SKB_FRAGS,
|
||||
.sysctl_skb_defer_max = 64,
|
||||
};
|
||||
EXPORT_SYMBOL(net_hotdata);
|
||||
|
|
|
@ -6985,7 +6985,7 @@ nodefer: kfree_skb_napi_cache(skb);
|
|||
DEBUG_NET_WARN_ON_ONCE(skb->destructor);
|
||||
|
||||
sd = &per_cpu(softnet_data, cpu);
|
||||
defer_max = READ_ONCE(sysctl_skb_defer_max);
|
||||
defer_max = READ_ONCE(net_hotdata.sysctl_skb_defer_max);
|
||||
if (READ_ONCE(sd->defer_count) >= defer_max)
|
||||
goto nodefer;
|
||||
|
||||
|
|
|
@ -654,7 +654,7 @@ static struct ctl_table net_core_table[] = {
|
|||
},
|
||||
{
|
||||
.procname = "skb_defer_max",
|
||||
.data = &sysctl_skb_defer_max,
|
||||
.data = &net_hotdata.sysctl_skb_defer_max,
|
||||
.maxlen = sizeof(unsigned int),
|
||||
.mode = 0644,
|
||||
.proc_handler = proc_dointvec_minmax,
|
||||
|
|
Loading…
Reference in New Issue