From: Eric Dumazet <eric.dumazet@gmail.com>
To: eilong@broadcom.com
Cc: David Miller <davem@davemloft.net>,
dmitry@broadcom.com, zenczykowski@gmail.com, maze@google.com,
netdev@vger.kernel.org, yuvalmin@broadcom.com
Subject: Re: [PATCH] bnx2x: fix occasional statistics off-by-4GB error
Date: Sun, 17 Mar 2013 13:25:52 -0700 [thread overview]
Message-ID: <1363551952.29475.93.camel@edumazet-glaptop> (raw)
In-Reply-To: <1363549074.4752.3.camel@lb-tlvb-eilong.il.broadcom.com>
On Sun, 2013-03-17 at 21:37 +0200, Eilon Greenstein wrote:
> On Sun, 2013-03-17 at 14:24 -0400, David Miller wrote:
> > From: "Dmitry Kravkov" <dmitry@broadcom.com>
> > Date: Sun, 17 Mar 2013 13:10:37 +0000
> >
> > > Probably this commit resolved the issue:
> > >
> > > commit bef05406ac0ea6f468e1e25e9934f3011ea9259b
> > > Author: Dmitry Kravkov <dmitry@broadcom.com>
> > > Date: Tue Sep 11 04:34:08 2012 +0000
> > >
> > > bnx2x: Avoid sending multiple statistics queries
> > >
> > > Can you try it pls?
> >
> > These are completely seperate bugs.
> >
> > The macro in question does not handle rollover of the lower 32-bits of
> > the statistic properly at all, and therefore Maciej's patch should be
> > applied and queud up for -stable.
> >
> > Please give it your ACK unless you can find a bug in his change.
>
> Both the high value and the low value are read from the chip - so this
> patch will increment the higher 32 bits twice (well, more than once).
> Not taking the HW/FW high counter at all is also not acceptable since
> the reading frequency is not high enough without those.
>
> So the original patch is nacked, but we are trying to figure out what is
> causing the statistics to misbehave and it might be related to sending
> statistics query twice.
This looks like the typical problem of updating a 64bit value in non
atomic way.
Its guaranteed to happen on 32bit hosts.
We had to introduce include/linux/u64_stats_sync.h to help to solve this
without adding extra cost on 64bit arches.
In bnx2x case, we perform 32bit operations even on 64bit host, so we
probably need to add a seqcount_t, so that a stat consumer can detect it
read a stale value.
next prev parent reply other threads:[~2013-03-17 20:25 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-03-15 21:03 bnx2x statistics occasionally wrong by near multiples of 4GB Maciej Żenczykowski
2013-03-15 21:56 ` [PATCH] bnx2x: fix occasional statistics off-by-4GB error Maciej Żenczykowski
2013-03-17 13:10 ` Dmitry Kravkov
2013-03-17 18:24 ` David Miller
2013-03-17 19:37 ` Eilon Greenstein
2013-03-17 20:25 ` Eric Dumazet [this message]
2013-03-17 20:53 ` Eilon Greenstein
2013-03-17 23:17 ` Eric Dumazet
2013-03-18 7:27 ` Eilon Greenstein
2013-03-18 6:18 ` Maciej Żenczykowski
2013-03-18 10:06 ` Eilon Greenstein
2013-03-18 17:13 ` David Miller
2013-03-18 19:54 ` Maciej Żenczykowski
2013-03-18 20:05 ` David Miller
2013-03-18 20:06 ` Maciej Żenczykowski
2013-03-18 20:35 ` Eric Dumazet
2013-03-18 20:36 ` Maciej Żenczykowski
2013-03-21 21:23 ` Maciej Żenczykowski
2013-03-21 21:25 ` David Miller
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=1363551952.29475.93.camel@edumazet-glaptop \
--to=eric.dumazet@gmail.com \
--cc=davem@davemloft.net \
--cc=dmitry@broadcom.com \
--cc=eilong@broadcom.com \
--cc=maze@google.com \
--cc=netdev@vger.kernel.org \
--cc=yuvalmin@broadcom.com \
--cc=zenczykowski@gmail.com \
/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