[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1440858726.8932.149.camel@edumazet-glaptop2.roam.corp.google.com>
Date: Sat, 29 Aug 2015 07:32:06 -0700
From: Eric Dumazet <eric.dumazet@...il.com>
To: Raghavendra K T <raghavendra.kt@...ux.vnet.ibm.com>
Cc: davem@...emloft.net, kuznet@....inr.ac.ru, jmorris@...ei.org,
yoshfuji@...ux-ipv6.org, kaber@...sh.net, jiri@...nulli.us,
edumazet@...gle.com, hannes@...essinduktion.org,
tom@...bertland.com, azhou@...ira.com, ebiederm@...ssion.com,
ipm@...rality.org.uk, nicolas.dichtel@...nd.com,
serge.hallyn@...onical.com, joe@...ches.com,
netdev@...r.kernel.org, linux-kernel@...r.kernel.org,
anton@....ibm.com, nacc@...ux.vnet.ibm.com,
srikar@...ux.vnet.ibm.com
Subject: Re: [PATCH RFC V3 2/2] net: Optimize snmp stat aggregation by
walking all the percpu data at once
On Sat, 2015-08-29 at 14:37 +0530, Raghavendra K T wrote:
>
> static inline void __snmp6_fill_stats64(u64 *stats, void __percpu *mib,
> - int items, int bytes, size_t syncpoff)
> + int items, int bytes, size_t syncpoff)
> {
> - int i;
> + int i, c;
> int pad = bytes - sizeof(u64) * items;
> + u64 buff[items];
> +
One last comment : using variable length arrays is confusing for the
reader, and sparse as well.
$ make C=2 net/ipv6/addrconf.o
...
CHECK net/ipv6/addrconf.c
net/ipv6/addrconf.c:4733:18: warning: Variable length array is used.
net/ipv6/addrconf.c:4737:25: error: cannot size expression
I suggest you remove 'items' parameter and replace it by
IPSTATS_MIB_MAX, as __snmp6_fill_stats64() is called exactly once.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists