* [PATCH] snmp: fix SNMP_ADD_STATS()
@ 2010-06-23 10:32 Eric Dumazet
2010-06-23 18:48 ` David Miller
0 siblings, 1 reply; 2+ messages in thread
From: Eric Dumazet @ 2010-06-23 10:32 UTC (permalink / raw)
To: David Miller; +Cc: netdev, Tom Herbert
commit aa2ea0586d9d (tcp: fix outsegs stat for TSO segments) incorrectly
assumed SNMP_ADD_STATS() was used from BH context.
Fix this using mib[!in_softirq()] instead of mib[0]
Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
CC: Tom Herbert <therbert@google.com>
---
include/net/snmp.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/include/net/snmp.h b/include/net/snmp.h
index 92456f1..899003d 100644
--- a/include/net/snmp.h
+++ b/include/net/snmp.h
@@ -134,7 +134,7 @@ struct linux_xfrm_mib {
#define SNMP_ADD_STATS_USER(mib, field, addend) \
this_cpu_add(mib[1]->mibs[field], addend)
#define SNMP_ADD_STATS(mib, field, addend) \
- this_cpu_add(mib[0]->mibs[field], addend)
+ this_cpu_add(mib[!in_softirq()]->mibs[field], addend)
/*
* Use "__typeof__(*mib[0]) *ptr" instead of "__typeof__(mib[0]) ptr"
* to make @ptr a non-percpu pointer.
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] snmp: fix SNMP_ADD_STATS()
2010-06-23 10:32 [PATCH] snmp: fix SNMP_ADD_STATS() Eric Dumazet
@ 2010-06-23 18:48 ` David Miller
0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2010-06-23 18:48 UTC (permalink / raw)
To: eric.dumazet; +Cc: netdev, therbert
From: Eric Dumazet <eric.dumazet@gmail.com>
Date: Wed, 23 Jun 2010 12:32:03 +0200
> commit aa2ea0586d9d (tcp: fix outsegs stat for TSO segments) incorrectly
> assumed SNMP_ADD_STATS() was used from BH context.
>
> Fix this using mib[!in_softirq()] instead of mib[0]
>
> Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Applied, thanks Eric.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2010-06-23 18:48 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-06-23 10:32 [PATCH] snmp: fix SNMP_ADD_STATS() Eric Dumazet
2010-06-23 18:48 ` David Miller
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).