mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-09-04 20:19:47 +08:00

Currently network taps unbound to any interface are linked in the global ptype_all list, affecting the performance in all the network namespaces. Add per netns ptypes chains, so that in the mentioned case only the netns owning the packet socket(s) is affected. While at that drop the global ptype_all list: no in kernel user registers a tap on "any" type without specifying either the target device or the target namespace (and IMHO doing that would not make any sense). Note that this adds a conditional in the fast path (to check for per netns ptype_specific list) and increases the dataset size by a cacheline (owing the per netns lists). Reviewed-by: Sabrina Dubroca <sd@queasysnail.net> Signed-off-by: Paolo Abeni <pabeni@redhat.com> Reviewed-by: Eric Dumazet <edumaze@google.com> Link: https://patch.msgid.link/ae405f98875ee87f8150c460ad162de7e466f8a7.1742494826.git.pabeni@redhat.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
25 lines
685 B
C
25 lines
685 B
C
// SPDX-License-Identifier: GPL-2.0-or-later
|
|
#include <linux/cache.h>
|
|
#include <linux/jiffies.h>
|
|
#include <linux/list.h>
|
|
#include <net/hotdata.h>
|
|
#include <net/proto_memory.h>
|
|
|
|
struct net_hotdata net_hotdata __cacheline_aligned = {
|
|
.offload_base = LIST_HEAD_INIT(net_hotdata.offload_base),
|
|
.gro_normal_batch = 8,
|
|
|
|
.netdev_budget = 300,
|
|
/* Must be at least 2 jiffes to guarantee 1 jiffy timeout */
|
|
.netdev_budget_usecs = 2 * USEC_PER_SEC / HZ,
|
|
|
|
.tstamp_prequeue = 1,
|
|
.max_backlog = 1000,
|
|
.dev_tx_weight = 64,
|
|
.dev_rx_weight = 64,
|
|
.sysctl_max_skb_frags = MAX_SKB_FRAGS,
|
|
.sysctl_skb_defer_max = 64,
|
|
.sysctl_mem_pcpu_rsv = SK_MEMORY_PCPU_RESERVE
|
|
};
|
|
EXPORT_SYMBOL(net_hotdata);
|