summaryrefslogtreecommitdiffstats
path: root/net/ipv4
diff options
context:
space:
mode:
authorEric Dumazet <edumazet@google.com>2021-09-30 03:03:32 +0200
committerDavid S. Miller <davem@davemloft.net>2021-09-30 15:17:10 +0200
commit59f09ae8fac4a990070fc6bdc889d0e0118664ea (patch)
treeb2a2ae1c36876b2ef1aea66848d36b9b51cc41f2 /net/ipv4
parentnet/mlx4_en: Add XDP_REDIRECT statistics (diff)
downloadlinux-59f09ae8fac4a990070fc6bdc889d0e0118664ea.tar.xz
linux-59f09ae8fac4a990070fc6bdc889d0e0118664ea.zip
net: snmp: inline snmp_get_cpu_field()
This trivial function is called ~90,000 times on 256 cpus hosts, when reading /proc/net/netstat. And this number keeps inflating. Inlining it saves many cycles. Signed-off-by: Eric Dumazet <edumazet@google.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4')
-rw-r--r--net/ipv4/af_inet.c6
1 files changed, 0 insertions, 6 deletions
diff --git a/net/ipv4/af_inet.c b/net/ipv4/af_inet.c
index 2fc6074583a4..8eb428387bac 100644
--- a/net/ipv4/af_inet.c
+++ b/net/ipv4/af_inet.c
@@ -1662,12 +1662,6 @@ int inet_ctl_sock_create(struct sock **sk, unsigned short family,
}
EXPORT_SYMBOL_GPL(inet_ctl_sock_create);
-u64 snmp_get_cpu_field(void __percpu *mib, int cpu, int offt)
-{
- return *(((unsigned long *)per_cpu_ptr(mib, cpu)) + offt);
-}
-EXPORT_SYMBOL_GPL(snmp_get_cpu_field);
-
unsigned long snmp_fold_field(void __percpu *mib, int offt)
{
unsigned long res = 0;