[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20101216121238.53deb370@nehalam>
Date: Thu, 16 Dec 2010 12:12:38 -0800
From: Stephen Hemminger <shemminger@...tta.com>
To: Eric Dumazet <eric.dumazet@...il.com>
Cc: Jesper Dangaard Brouer <hawk@...x.dk>,
Patrick McHardy <kaber@...sh.net>,
Arnaldo Carvalho de Melo <acme@...radead.org>,
Steven Rostedt <srostedt@...hat.com>,
Alexander Duyck <alexander.h.duyck@...el.com>,
netfilter-devel <netfilter-devel@...r.kernel.org>,
netdev <netdev@...r.kernel.org>,
Peter P Waskiewicz Jr <peter.p.waskiewicz.jr@...el.com>
Subject: Re: [PATCH v3 net-next-2.6] netfilter: x_tables: dont block BH
while reading counters
On Thu, 16 Dec 2010 20:58:39 +0100
Eric Dumazet <eric.dumazet@...il.com> wrote:
> Le jeudi 16 décembre 2010 à 09:57 -0800, Stephen Hemminger a écrit :
> > On Thu, 16 Dec 2010 18:53:06 +0100
> > Eric Dumazet <eric.dumazet@...il.com> wrote:
> >
> > > @@ -759,7 +742,7 @@ static struct xt_counters *alloc_counters(const struct xt_table *table)
> > > * about).
> > > */
> > > countersize = sizeof(struct xt_counters) * private->number;
> > > - counters = vmalloc(countersize);
> > > + counters = vzalloc(countersize);
> > >
> > > if (counters == NULL)
> > > return ERR_PTR(-ENOMEM);
> > > @@ -1007,7 +990,7 @@ static int __do_replace(struct net *net, const char *name,
> > > struct arpt_entry *iter;
> > >
> > > ret = 0;
> > > - counters = vmalloc(num_counters * sizeof(struct xt_counters));
> > > + counters = vzalloc(num_counters * sizeof(struct xt_counters));
> > > if (!counters) {
> > > ret = -ENOMEM;
> > > goto out;
> >
> > This seems like a different and unrelated change.
> >
>
> Since you later Acked the patch, you probably know that we now provide
> to get_counters() a zeroed area, since we do a sum for each possible
> cpu, I am answering anyway for other readers ;)
>
> Thanks for reviewing !
You changed from:
get local cpu counters
then sum other cpus
to:
sum all cpu's.
This is fine, and will give the same answer.
--
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists