netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Eric Dumazet <eric.dumazet@gmail.com>
To: Michael Chan <mchan@broadcom.com>
Cc: "leitao@linux.vnet.ibm.com" <leitao@linux.vnet.ibm.com>,
	"netdev@vger.kernel.org" <netdev@vger.kernel.org>
Subject: Re: [PATCH] bnx2: avoid flushing statistics when doing a MTU change
Date: Mon, 30 Nov 2009 11:49:05 +0100	[thread overview]
Message-ID: <4B13A321.8070909@gmail.com> (raw)
In-Reply-To: <C27F8246C663564A84BB7AB34397724218065B9851@IRVEXCHCCR01.corp.ad.broadcom.com>

Michael Chan a écrit :
> Eric Dumazet wrote:
> 
>> leitao@linux.vnet.ibm.com a écrit :
>>> Actually when bnx2 changes the interface's MTU size, it resets
>>> the chip and consequently flushes the interface statistics.
>>> This patch saves the statistics in a temporary space in order to
>>> maintain the statistics correct after the chip reset.
>>>
>>> Signed-off-by: Breno Leitao<leitao@linux.vnet.ibm.com>
>>
>>
>>>     return net_stats;
>>>  }
>>> @@ -6989,6 +7004,11 @@ bnx2_change_ring_size(struct bnx2
>> *bp, u32 rx, u32 tx)
>>>  {
>>>     if (netif_running(bp->dev)) {
>>>             bnx2_netif_stop(bp);
>> I wonder if you need to renew this stats before copying them ?
>>  (eg calling bnx2_get_stats())
> 
> Calling bnx2_get_stats() won't refresh the stats counters because
> they are DMA'ed once a second.  There's an I/O to immediately DMA
> the counters:
> 
> REG_WR(bp, BNX2_HC_COMMAND, bp->hc_cmd |
>                                 BNX2_HC_COMMAND_STATS_NOW);
> REG_RD(bp, BNX2_HC_COMMAND);
> 
> We then need to add some delay to wait for the DMA to complete.

Yes, but if you dont call bnx2_get_stats() netdev->stats will contain
possibly very old values.

At least, calling it will give one no more than second error.


  reply	other threads:[~2009-11-30 10:49 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-11-27 16:59 [PATCH] bnx2: avoid flushing statistics when doing a MTU change leitao
2009-11-30  9:20 ` Michael Chan
2009-11-30 10:30 ` Eric Dumazet
2009-11-30 10:43   ` Michael Chan
2009-11-30 10:49     ` Eric Dumazet [this message]
2009-11-30 11:02       ` Michael Chan
2009-11-30 13:17     ` Breno Leitao
2009-11-30 13:32       ` Eric Dumazet
2009-11-30 14:05         ` Breno Leitao
2009-11-30 18:09           ` Michael Chan

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=4B13A321.8070909@gmail.com \
    --to=eric.dumazet@gmail.com \
    --cc=leitao@linux.vnet.ibm.com \
    --cc=mchan@broadcom.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;
as well as URLs for NNTP newsgroup(s).