Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 78563
b: refs/heads/master
c: d647b36
h: refs/heads/master
i:
  78561: 36075be
  78559: 98585fe
v: v3
  • Loading branch information
Herbert Xu authored and David S. Miller committed Jan 28, 2008
1 parent 1b04206 commit 82958bd
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 5 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 2caf62f6cae46e36b1c4a1b0f2d9ef82af89cad2
refs/heads/master: d647b36a69bf0a630ebf981bde3c0651e2779e5e
21 changes: 17 additions & 4 deletions trunk/include/net/snmp.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@

#include <linux/cache.h>
#include <linux/snmp.h>
#include <linux/smp.h>

/*
* Mibs are stored in array of unsigned long.
Expand Down Expand Up @@ -135,14 +136,26 @@ struct linux_mib {
#define SNMP_INC_STATS_BH(mib, field) \
(per_cpu_ptr(mib[0], raw_smp_processor_id())->mibs[field]++)
#define SNMP_INC_STATS_USER(mib, field) \
(per_cpu_ptr(mib[1], raw_smp_processor_id())->mibs[field]++)
do { \
per_cpu_ptr(mib[1], get_cpu())->mibs[field]++; \
put_cpu(); \
} while (0)
#define SNMP_INC_STATS(mib, field) \
(per_cpu_ptr(mib[!in_softirq()], raw_smp_processor_id())->mibs[field]++)
do { \
per_cpu_ptr(mib[!in_softirq()], get_cpu())->mibs[field]++; \
put_cpu(); \
} while (0)
#define SNMP_DEC_STATS(mib, field) \
(per_cpu_ptr(mib[!in_softirq()], raw_smp_processor_id())->mibs[field]--)
do { \
per_cpu_ptr(mib[!in_softirq()], get_cpu())->mibs[field]--; \
put_cpu(); \
} while (0)
#define SNMP_ADD_STATS_BH(mib, field, addend) \
(per_cpu_ptr(mib[0], raw_smp_processor_id())->mibs[field] += addend)
#define SNMP_ADD_STATS_USER(mib, field, addend) \
(per_cpu_ptr(mib[1], raw_smp_processor_id())->mibs[field] += addend)
do { \
per_cpu_ptr(mib[1], get_cpu())->mibs[field] += addend; \
put_cpu(); \
} while (0)

#endif

0 comments on commit 82958bd

Please sign in to comment.