netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [RFC] SNMP_ADD_STATS
@ 2002-06-12 18:23 Arnaldo Carvalho de Melo
  2002-06-12 22:47 ` kuznet
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Arnaldo Carvalho de Melo @ 2002-06-12 18:23 UTC (permalink / raw)
  To: David S.Miller; +Cc: netdev

Hi,

	I've been cleaning up the network stacks and one thing that made me
have a use for the barf bags I have handy is this type of construct:

    ip_statistics[smp_processor_id()*2 + !in_softirq()].IpFragCreates += nfrags;

I've noticed that there is:

#define SNMP_INC_STATS(mib, field) ((mib)[2*smp_processor_id()+!in_softirq()].field++)

and

#define IP_INC_STATS(field) SNMP_INC_STATS(ip_statistics, field)

So I propose that we have

#define SNMP_ADD_STATS(mib, field, incr) ((mib)[2*smp_processor_id()+!in_softirq()].field += incr)

and

#define IP_ADD_STATS(field,incr) SNMP_ADD_STATS(ip_statistics, field, incr)

Any objections?

- Arnaldo

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2002-06-13  0:11 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-06-12 18:23 [RFC] SNMP_ADD_STATS Arnaldo Carvalho de Melo
2002-06-12 22:47 ` kuznet
2002-06-12 22:58 ` David S. Miller
2002-06-13  0:11 ` Andi Kleen

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).