SNMP STATs question

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



In include/net/snmp.h, I see:

///// NOTE: these first 2 #defines are not used anywhere.

#define SNMP_STAT_USRPTR(name)	(name[0])
#define SNMP_STAT_BHPTR(name)	(name[1])

so it looks like BH => [1], USR => [0].
However, these appear to be the opposite of that (and we are safe
since the ones above aren't used)...
Or do I just have my head on backwards today?

#define SNMP_INC_STATS_BH(mib, field) 	\
	(per_cpu_ptr(mib[0], smp_processor_id())->field++)
#define SNMP_INC_STATS_USER(mib, field) \
	(per_cpu_ptr(mib[1], smp_processor_id())->field++)
#define SNMP_INC_STATS(mib, field) 	\
	(per_cpu_ptr(mib[!in_softirq()], smp_processor_id())->field++)
#define SNMP_DEC_STATS(mib, field) 	\
	(per_cpu_ptr(mib[!in_softirq()], smp_processor_id())->field--)
#define SNMP_ADD_STATS_BH(mib, field, addend) 	\
	(per_cpu_ptr(mib[0], smp_processor_id())->field += addend)
#define SNMP_ADD_STATS_USER(mib, field, addend) 	\
	(per_cpu_ptr(mib[1], smp_processor_id())->field += addend)


Thanks,
--
~Randy
-
: send the line "unsubscribe linux-net" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Netdev]     [Ethernet Bridging]     [Linux 802.1Q VLAN]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Git]     [Bugtraq]     [Yosemite News and Information]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux PCI]     [Linux Admin]     [Samba]

  Powered by Linux