[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1286335729.4861.13.camel@edumazet-laptop>
Date: Wed, 06 Oct 2010 05:28:49 +0200
From: Eric Dumazet <eric.dumazet@...il.com>
To: Jeff Kirsher <jeffrey.t.kirsher@...el.com>
Cc: Jesper Dangaard Brouer <hawk@...u.dk>,
Alexander Duyck <alexander.h.duyck@...el.com>,
Jesper Dangaard Brouer <hawk@...x.dk>,
"David S. Miller" <davem@...emloft.net>,
netdev <netdev@...r.kernel.org>,
Carolyn Wyborny <carolyn.wyborny@...el.com>
Subject: Re: [net-next PATCH] igb: update adapter stats when reading
/proc/net/dev.
Le mardi 05 octobre 2010 à 15:34 -0700, Jeff Kirsher a écrit :
> On Tue, Oct 5, 2010 at 14:16, Jesper Dangaard Brouer <hawk@...u.dk> wrote:
> > On Tue, 5 Oct 2010, Eric Dumazet wrote:
> >
> >> Le mardi 05 octobre 2010 à 17:19 +0200, Eric Dumazet a écrit :
> >>>
> >>> Le mardi 05 octobre 2010 à 16:53 +0200, Jesper Dangaard Brouer a écrit :
> >>>
> >>>> Its already racy, because "ethtool -S" reads out the stats immediately,
> >>>> and thus races with the timer.
> >>>>
> >>>> See: igb_ethtool.c
> >>>> igb_get_ethtool_stats() invoke igb_update_stats(adapter);
> >>>>
> >>>
> >>> You would be surprised how many bugs are waiting to be found and
> >>> fixed ;)
> >>
> >> I took a look at igb stats, and it appears they also are racy on 32bit
> >> arches. igb uses u64 counters, with no synchronization between
> >> producers(writers) and consumers(readers).
> >
> > Are you saying, that we need more than a simple mutex in igb_update_stats()?
> >
> >
> >> Some fixes are needed ;)
> >
> > The question is then if Intel wants to fix it, or let it be up to you or me?
> >
>
> I will make sure that Carolyn and Alex know about the issue. But,
> feel free to submit a patch if you guys have the time.
>
I woke up early this morning, I'll provide patches to fix issues for
net-next-2.6
I'll let Intel guys doing the backporting work, but for old kernels,
you'll probably need to use "unsigned long" instead of "u64"
My plan is :
- Provide 64bit counters even on 32bit arch
- with proper synchro (include/linux/u64_stats_sync.h)
- Add a spinlock so we can apply Jesper patch.
--
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