14 Nov, 2011
1 commit
-
Reading /proc/net/snmp6 on a machine with a lot of cpus is very
expensive (can be ~88000 us).This is because ICMPV6MSG MIB uses 4096 bytes per cpu, and folding
values for all possible cpus can read 16 Mbytes of memory (32MBytes on
non x86 arches)ICMP messages are not considered as fast path on a typical server, and
eventually few cpus handle them anyway. We can afford an atomic
operation instead of using percpu data.This saves 4096 bytes per cpu and per network namespace.
Signed-off-by: Eric Dumazet
Signed-off-by: David S. Miller
01 Nov, 2011
1 commit
-
These files are non modular, but need to export symbols using
the macros now living in export.h -- call out the include so
that things won't break when we remove the implicit presence
of module.h from everywhere.Signed-off-by: Paul Gortmaker
20 May, 2011
1 commit
-
ipv6 has per device ICMP SNMP counters, taking too much space because
they use percpu storage.needed size per device is :
(512+4)*sizeof(long)*number_of_possible_cpus*2On a 32bit kernel, 16 possible cpus, this wastes more than 64kbytes of
memory per ipv6 enabled network device, taken in vmalloc pool.Since ICMP messages are rare, just use shared counters (atomic_long_t)
Per network space ICMP counters are still using percpu memory, we might
also convert them to shared counters in a future patch.Signed-off-by: Eric Dumazet
CC: Denys Fedoryshchenko
Signed-off-by: David S. Miller
31 Oct, 2010
1 commit
-
commit a18135eb9389 (Add UDP_MIB_{SND,RCV}BUFERRORS handling.)
forgot to make the necessary changes in net/ipv6/proc.c to report
additional counters in /proc/net/snmp6Signed-off-by: Eric Dumazet
Signed-off-by: David S. Miller
01 Jul, 2010
1 commit
-
/proc/net/snmp and /proc/net/netstat expose SNMP counters.
Width of these counters is either 32 or 64 bits, depending on the size
of "unsigned long" in kernel.This means user program parsing these files must already be prepared to
deal with 64bit values, regardless of user program being 32 or 64 bit.This patch introduces 64bit snmp values for IPSTAT mib, where some
counters can wrap pretty fast if they are 32bit wide.# netstat -s|egrep "InOctets|OutOctets"
InOctets: 244068329096
OutOctets: 244069348848Signed-off-by: Eric Dumazet
Signed-off-by: David S. Miller
18 May, 2010
1 commit
-
This patch removes from net/ (but not any netfilter files)
all the unnecessary return; statements that precede the
last closing brace of void functions.It does not remove the returns that are immediately
preceded by a label as gcc doesn't like that.Done via:
$ grep -rP --include=*.[ch] -l "return;\n}" net/ | \
xargs perl -i -e 'local $/ ; while (<>) { s/\n[ \t\n]+return;\n}/\n}/g; print; }'Signed-off-by: Joe Perches
Signed-off-by: David S. Miller
04 Apr, 2010
1 commit
-
When ip_append() fails because of socket limit or memory shortage,
increment ICMP_MIB_OUTERRORS counter, so that "netstat -s" can report
these errors.LANG=C netstat -s | grep "ICMP messages failed"
0 ICMP messages failedFor IPV6, implement ICMP6_MIB_OUTERRORS counter as well.
# grep Icmp6OutErrors /proc/net/dev_snmp6/*
/proc/net/dev_snmp6/eth0:Icmp6OutErrors 0
/proc/net/dev_snmp6/lo:Icmp6OutErrors 0Signed-off-by: Eric Dumazet
Signed-off-by: David S. Miller
17 Feb, 2010
1 commit
-
Add __percpu sparse annotations to net.
These annotations are to make sparse consider percpu variables to be
in a different address space and warn if accessed without going
through percpu accessors. This patch doesn't affect normal builds.The macro and type tricks around snmp stats make things a bit
interesting. DEFINE/DECLARE_SNMP_STAT() macros mark the target field
as __percpu and SNMP_UPD_PO_STATS() macro is updated accordingly. All
snmp_mib_*() users which used to cast the argument to (void **) are
updated to cast it to (void __percpu **).Signed-off-by: Tejun Heo
Acked-by: David S. Miller
Cc: Patrick McHardy
Cc: Arnaldo Carvalho de Melo
Cc: Vlad Yasevich
Cc: netdev@vger.kernel.org
Signed-off-by: David S. Miller
23 Jan, 2010
1 commit
-
Signed-off-by: Alexey Dobriyan
Signed-off-by: David S. Miller
18 Jan, 2010
1 commit
-
__net_init/__net_exit are apparently not going away, so use them
to full extent.In some cases __net_init was removed, because it was called from
__net_exit code.Signed-off-by: Alexey Dobriyan
Signed-off-by: David S. Miller
11 Jan, 2010
1 commit
-
Stanse found a potential null dereference in snmp6_unregister_dev.
There is a check for idev being NULL, but it is dereferenced
earlier. But idev cannot be NULL when passed to
snmp6_unregister_dev, so remove the test.Signed-off-by: Jiri Slaby
Cc: "David S. Miller"
Cc: Alexey Kuznetsov
Cc: "Pekka Savola (ipv6)"
Cc: James Morris
Cc: Hideaki YOSHIFUJI
Cc: Patrick McHardy
Cc: netdev@vger.kernel.org
Signed-off-by: David S. Miller
06 Aug, 2009
1 commit
-
String literals are constant, and usually, we can also tag the array
of pointers const too, moving it to the .rodata section.Signed-off-by: Jan Engelhardt
Signed-off-by: David S. Miller
27 Apr, 2009
1 commit
-
The IP MIB (RFC 4293) defines stats for InOctets, OutOctets, InMcastOctets and
OutMcastOctets:
http://tools.ietf.org/html/rfc4293
But it seems we don't track those in any way that easy to separate from other
protocols. This patch adds those missing counters to the stats file. Tested
successfully by meWith help from Eric Dumazet.
Signed-off-by: Neil Horman
Signed-off-by: David S. Miller
20 Nov, 2008
1 commit
-
Because "name" is static, it can be occasionally be filled with
somewhat garbage if two processes read /proc/net/snmp6.Also, remove useless casts and "-1" -- snprintf() correctly terminates it's
output.Signed-off-by: Alexey Dobriyan
Signed-off-by: David S. Miller
09 Oct, 2008
1 commit
-
Signed-off-by: Denis V. Lunev
Signed-off-by: David S. Miller
08 Oct, 2008
8 commits
-
Signed-off-by: Denis V. Lunev
Signed-off-by: David S. Miller -
Signed-off-by: Denis V. Lunev
Signed-off-by: David S. Miller -
Signed-off-by: Denis V. Lunev
Signed-off-by: David S. Miller -
Unused net variable will become used very soon.
Signed-off-by: Denis V. Lunev
Signed-off-by: David S. Miller -
idev has been stored on seq->private. NULL has been stored for global
statistics.The situation is changed with net namespace. We need to store pointer to
struct net and the only place is seq->private. So, we'll have for
/proc/net/dev_snmp6/* and for /proc/net/snmp6 pointers of two different
types stored in the same field.This effectively requires to separate seq_ops of these files.
Signed-off-by: Denis V. Lunev
Signed-off-by: David S. Miller -
Simple, comsolidate sockstat6 staff in one place, at the beginning of
the file. Right now sockstat6_seq_open/sockstat6_seq_fops looks like an
intrusion in the middle of snmp6 code.Signed-off-by: Denis V. Lunev
Signed-off-by: David S. Miller -
Do the same for /proc/net/snmp6.
Signed-off-by: Denis V. Lunev
Signed-off-by: David S. Miller -
Signed-off-by: Denis V. Lunev
Signed-off-by: David S. Miller
30 Jul, 2008
1 commit
-
This call is no longer needed, sockstat6 is per namespace so it is
removed at the namespace subsystem destruction.Signed-off-by: Daniel Lezcano
Signed-off-by: David S. Miller
20 Jul, 2008
1 commit
-
Without CONFIG_NET_NS, namespace is always &init_net.
Compiler will be able to omit namespace comparisons with this patch.Signed-off-by: YOSHIFUJI Hideaki
Signed-off-by: David S. Miller
18 Jul, 2008
2 commits
-
They are symmetrical to single_open ones :)
Signed-off-by: Pavel Emelyanov
Signed-off-by: David S. Miller -
There are already 7 of them - time to kill some duplicate code.
Signed-off-by: Pavel Emelyanov
Signed-off-by: David S. Miller
12 Jun, 2008
1 commit
-
This patch removes CVS keywords that weren't updated for a long time
from comments.Signed-off-by: Adrian Bunk
Signed-off-by: David S. Miller
02 May, 2008
1 commit
-
Simply replace proc_create and further data assigned with proc_create_data.
Signed-off-by: Denis V. Lunev
Signed-off-by: David S. Miller
01 Apr, 2008
3 commits
-
Do with the sockstat6 file what we've already done for the sockstat.
Same good side effect - ipv6 reassembling stats are now shown per-net.Signed-off-by: Pavel Emelyanov
Signed-off-by: David S. Miller -
Currently they live in init_net only, but now almost all the info
they can provide is available per-net.Signed-off-by: Pavel Emelyanov
Signed-off-by: David S. Miller -
This counter is about to become per-proto-and-per-net, so we'll need
two arguments to determine which cell in this "table" to work with.All the places, but proc already pass proper net to it - proc will be
tuned a bit later.Some indentation with spaces in proc files is done to keep the file
coding style consistent.Signed-off-by: Pavel Emelyanov
Signed-off-by: David S. Miller
26 Mar, 2008
1 commit
-
Introduce per-net_device inlines: dev_net(), dev_net_set().
Without CONFIG_NET_NS, no namespace other than &init_net exists.
Let's explicitly define them to help compiler optimizations.Signed-off-by: YOSHIFUJI Hideaki
07 Mar, 2008
1 commit
-
This reverts commit db1ed684f6c430c4cdad67d058688b8a1b5e607c ("[IPV6]
UDP: Rename IPv6 UDP files."), commit
8be8af8fa4405652e6c0797db5465a4be8afb998 ("[IPV4] UDP: Move
IPv4-specific bits to other file.") and commit
e898d4db2749c6052072e9bc4448e396cbdeb06a ("[UDP]: Allow users to
configure UDP-Lite.").First, udplite is of such small cost, and it is a core protocol just
like TCP and normal UDP are.We spent enormous amounts of effort to make udplite share as much code
with core UDP as possible. All of that work is less valuable if we're
just going to slap a config option on udplite support.It is also causing build failures, as reported on linux-next, showing
that the changeset was not tested very well. In fact, this is the
second build failure resulting from the udplite change.Finally, the config options provided was a bool, instead of a modular
option. Meaning the udplite code does not even get build tested
by allmodconfig builds, and furthermore the user is not presented
with a reasonable modular build option which is particularly needed
by distribution vendors.Signed-off-by: David S. Miller
06 Mar, 2008
1 commit
-
This patchset avoids creation of the /proc entry for snmp6 when
the call is made from a network namespace different from the init_net.Signed-off-by: Daniel Lezcano
Signed-off-by: David S. Miller
04 Mar, 2008
1 commit
-
Let's give users an option for disabling UDP-Lite (~4K).
old:
| text data bss dec hex filename
| 286498 12432 6072 305002 4a76a net/ipv4/built-in.o
| 193830 8192 3204 205226 321aa net/ipv6/ipv6.onew (without UDP-Lite):
| text data bss dec hex filename
| 284086 12136 5432 301654 49a56 net/ipv4/built-in.o
| 191835 7832 3076 202743 317f7 net/ipv6/ipv6.oSigned-off-by: YOSHIFUJI Hideaki
29 Feb, 2008
1 commit
-
Use proc_create() to make sure that ->proc_fops be setup before gluing
PDE to main tree.Signed-off-by: Wang Chen
Signed-off-by: David S. Miller
29 Jan, 2008
3 commits
-
This is also simple, but introduces more changes, since
then mem counter is altered in more places.Signed-off-by: Pavel Emelyanov
Signed-off-by: David S. Miller -
This is simple - just move the variable from struct inet_frags
to struct netns_frags and adjust the usage appropriately.Signed-off-by: Pavel Emelyanov
Signed-off-by: David S. Miller -
1) Cleanups (all functions are prefixed by sock_prot_inuse)
sock_prot_inc_use(prot) -> sock_prot_inuse_add(prot,-1)
sock_prot_dec_use(prot) -> sock_prot_inuse_add(prot,-1)
sock_prot_inuse() -> sock_prot_inuse_get()New functions :
sock_prot_inuse_init() and sock_prot_inuse_free() to abstract pcounter use.
2) if CONFIG_PROC_FS=n, we can zap 'inuse' member from "struct proto",
since nobody wants to read the inuse value.This saves 1372 bytes on i386/SMP and some cpu cycles.
Signed-off-by: Eric Dumazet
Signed-off-by: David S. Miller