[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <C27F8246C663564A84BB7AB34397724218065B9851@IRVEXCHCCR01.corp.ad.broadcom.com>
Date: Mon, 30 Nov 2009 02:43:16 -0800
From: "Michael Chan" <mchan@...adcom.com>
To: "'Eric Dumazet'" <eric.dumazet@...il.com>,
"leitao@...ux.vnet.ibm.com" <leitao@...ux.vnet.ibm.com>
cc: "netdev@...r.kernel.org" <netdev@...r.kernel.org>
Subject: Re: [PATCH] bnx2: avoid flushing statistics when doing a MTU
change
Eric Dumazet wrote:
> leitao@...ux.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@...ux.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.
>
>
> > +
> > + /* Save statistics that is going to be reseted */
> > + memcpy(bp->stats_extra, &bp->dev->stats,
> > + sizeof(struct net_device_stats));
> > +
> > bnx2_reset_chip(bp, BNX2_DRV_MSG_CODE_RESET);
> > bnx2_free_skbs(bp);
> > bnx2_free_mem(bp);
--
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