From: Arnaldo Carvalho de Melo <acme@conectiva.com.br>
To: "David S.Miller" <davem@redhat.com>
Cc: netdev@oss.sgi.com
Subject: [RFC] SNMP_ADD_STATS
Date: Wed, 12 Jun 2002 15:23:48 -0300 [thread overview]
Message-ID: <20020612182348.GP1073@conectiva.com.br> (raw)
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
next reply other threads:[~2002-06-12 18:23 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-06-12 18:23 Arnaldo Carvalho de Melo [this message]
2002-06-12 22:47 ` [RFC] SNMP_ADD_STATS kuznet
2002-06-12 22:58 ` David S. Miller
2002-06-13 0:11 ` Andi Kleen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20020612182348.GP1073@conectiva.com.br \
--to=acme@conectiva.com.br \
--cc=davem@redhat.com \
--cc=netdev@oss.sgi.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).