Subject: Re: [PATCH] snmp: add missing counters for RFC 4293

From: Eric Dumazet <[email-masked]>
Date: Wed, 22 Apr 2009 07:15:15 +0200

Neil Horman a écrit :
> Hey all-
> 	New patch, taking Erics commentary pointing out my prior stupidity into
> account :).
> 
> 
> The IP MIB (RFC 4293) defines stats for InOctets, OutOctets, InMcastOctets and
> OutMcastOctets:
> http://tools.ietf.org/html/rfc4293
> But it seems we don't track those in any way that easy to separate from other
> protocols.  This patch adds those missing counters to the stats file.  Tested
> successfully by me

Well, looking now at the patch again, I think you cannot add new fields
without breaking existing apps. My previous review stoped at this _BH thing
wihthout looking further :)

Also, it seems some RFC4293 items are already handled, since commit d831666e
from Mitsuru Chinen. Check net/ipv4/proc.c, line 114

/* Following RFC4293 items are displayed in /proc/net/netstat */
static const struct snmp_mib snmp4_ipextstats_list[] = {
        SNMP_MIB_ITEM("InNoRoutes", IPSTATS_MIB_INNOROUTES),
        SNMP_MIB_ITEM("InTruncatedPkts", IPSTATS_MIB_INTRUNCATEDPKTS),
        SNMP_MIB_ITEM("InMcastPkts", IPSTATS_MIB_INMCASTPKTS),
        SNMP_MIB_ITEM("OutMcastPkts", IPSTATS_MIB_OUTMCASTPKTS),
        SNMP_MIB_ITEM("InBcastPkts", IPSTATS_MIB_INBCASTPKTS),
        SNMP_MIB_ITEM("OutBcastPkts", IPSTATS_MIB_OUTBCASTPKTS),
        SNMP_MIB_SENTINEL
};

# grep IpExt /proc/net/netstat
IpExt: InNoRoutes InTruncatedPkts InMcastPkts OutMcastPkts InBcastPkts OutBcastPkts
IpExt: 0 0 0 0 5089 0

So you might add items after existing ones, in IpExt preferably, in order not
breaking old applications.

Thanks