[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20090206.013310.68845344.davem@davemloft.net>
Date: Fri, 06 Feb 2009 01:33:10 -0800 (PST)
From: David Miller <davem@...emloft.net>
To: ivecera@...hat.com
Cc: romieu@...zoreil.com, netdev@...r.kernel.org
Subject: Re: [PATCH] r8169: Don't update statistics counters when interface
is down
From: Ivan Vecera <ivecera@...hat.com>
Date: Wed, 4 Feb 2009 11:31:58 +0100
> Francois Romieu wrote:
> >
> > int dev_close(struct net_device *dev)
> > {
> > [...]
> > clear_bit(__LINK_STATE_START, &dev->state);
> > -> netif_running is not true anymore
> > [...]
> > if (ops->ndo_stop)
> > ops->ndo_stop(dev);
> >
> > -> Calling rtl8169_update_counters in rtl8169_close looks like a no-op.
> Yes that's true, it's better to test whether the receiver is enabled or not.
>
> >
> > Aside from that, I do not understand from the description the need for
> > the "while (wait--)" loop.
> To avoid potential endless loop, only for sure.
>
> >
> > Aside from the aside, the diff can probably be shorter if a local "counters"
> > variable is kept in the ethtool function (nit).
> I wanted to update counters also when the interface is going down and this needs
> to store the counters in device struct. These will be returned when the
> interface is down (resp. the receiver is disabled).
>
> Updated patch with correct test condition:
Francois, any objections?
--
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