From: Eric Dumazet <eric.dumazet@gmail.com>
To: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Cc: Jesper Dangaard Brouer <hawk@diku.dk>,
Alexander Duyck <alexander.h.duyck@intel.com>,
Jesper Dangaard Brouer <hawk@comx.dk>,
"David S. Miller" <davem@davemloft.net>,
netdev <netdev@vger.kernel.org>,
Carolyn Wyborny <carolyn.wyborny@intel.com>
Subject: Re: [net-next PATCH] igb: update adapter stats when reading /proc/net/dev.
Date: Wed, 06 Oct 2010 05:28:49 +0200 [thread overview]
Message-ID: <1286335729.4861.13.camel@edumazet-laptop> (raw)
In-Reply-To: <AANLkTi=+rkietX9jAMy5BRVwAENf-mK15py7y+LYQ-XJ@mail.gmail.com>
Le mardi 05 octobre 2010 à 15:34 -0700, Jeff Kirsher a écrit :
> On Tue, Oct 5, 2010 at 14:16, Jesper Dangaard Brouer <hawk@diku.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.
next prev parent reply other threads:[~2010-10-06 3:28 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-10-05 14:18 [net-next PATCH] igb: update adapter stats when reading /proc/net/dev Jesper Dangaard Brouer
2010-10-05 14:41 ` Eric Dumazet
2010-10-05 14:53 ` Jesper Dangaard Brouer
2010-10-05 15:19 ` Eric Dumazet
2010-10-05 21:01 ` Eric Dumazet
2010-10-05 21:16 ` Jesper Dangaard Brouer
2010-10-05 22:34 ` Jeff Kirsher
2010-10-06 3:28 ` Eric Dumazet [this message]
2010-10-06 4:36 ` [PATCH net-next] igb: fix stats handling Eric Dumazet
2010-10-06 5:49 ` Jeff Kirsher
2010-10-06 11:36 ` Jesper Dangaard Brouer
2010-10-09 23:57 ` Tantilov, Emil S
2010-10-10 8:14 ` [PATCH net-next V2] " Eric Dumazet
2010-10-12 0:12 ` Jeff Kirsher
2010-10-06 5:47 ` [net-next PATCH] igb: update adapter stats when reading /proc/net/dev Jeff Kirsher
2010-10-07 6:36 ` David Miller
2010-10-07 6:44 ` Eric Dumazet
2010-10-07 6:46 ` David Miller
2010-10-07 10:06 ` Jesper Dangaard Brouer
2010-10-07 10:24 ` Eric Dumazet
2010-10-07 11:36 ` Jesper Dangaard Brouer
-- strict thread matches above, loose matches on Subject: below --
2010-01-12 13:41 Jesper Dangaard Brouer
2010-01-14 1:30 ` David Miller
2010-01-14 3:01 ` Jeff Kirsher
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=1286335729.4861.13.camel@edumazet-laptop \
--to=eric.dumazet@gmail.com \
--cc=alexander.h.duyck@intel.com \
--cc=carolyn.wyborny@intel.com \
--cc=davem@davemloft.net \
--cc=hawk@comx.dk \
--cc=hawk@diku.dk \
--cc=jeffrey.t.kirsher@intel.com \
--cc=netdev@vger.kernel.org \
/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