From: Liang Li <liang.li@windriver.com>
To: Ben Hutchings <bhutchings@solarflare.com>
Cc: netdev@vger.kernel.org, avorontsov@ru.mvista.com,
linuxppc-dev@lists.ozlabs.org, davem@davemloft.net
Subject: Re: [PATCH] ucc_geth: fix ethtool set ring param bug
Date: Tue, 31 Aug 2010 23:16:29 +0800 [thread overview]
Message-ID: <20100831151629.GA21442@localhost> (raw)
In-Reply-To: <1283265682.2244.0.camel@achroite.uk.solarflarecom.com>
On Tue, Aug 31, 2010 at 03:41:22PM +0100, Ben Hutchings wrote:
> On Mon, 2010-08-30 at 22:47 +0800, Liang Li wrote:
> > It's common sense that when we should do change to driver ring
> > desc/buffer etc only after 'stop/shutdown' the device. When we
> > do change while devices/driver is running, kernel oops occur:
> [...]
> > diff --git a/drivers/net/ucc_geth_ethtool.c b/drivers/net/ucc_geth_ethtool.c
> > index 6f92e48..1b37aaa 100644
> > --- a/drivers/net/ucc_geth_ethtool.c
> > +++ b/drivers/net/ucc_geth_ethtool.c
> > @@ -255,13 +255,18 @@ uec_set_ringparam(struct net_device *netdev,
> > return -EINVAL;
> > }
> >
> > - ug_info->bdRingLenRx[queue] = ring->rx_pending;
> > - ug_info->bdRingLenTx[queue] = ring->tx_pending;
> > -
> > if (netif_running(netdev)) {
> > - /* FIXME: restart automatically */
> > - printk(KERN_INFO
> > - "Please re-open the interface.\n");
> > + printk(KERN_INFO "Stopping interface %s.\n", netdev->name);
> > + ucc_geth_close(netdev);
> > +
> > + ug_info->bdRingLenRx[queue] = ring->rx_pending;
> > + ug_info->bdRingLenTx[queue] = ring->tx_pending;
> > +
> > + printk(KERN_INFO "Reactivating interface %s.\n", netdev->name);
> > + ucc_geth_open(netdev);
>
> What if ucc_geth_open() fails?
I did some runtime tests but did not witness the ucc_geth_open fail.
Assume it may fail for some reason, then I tend to think give out
warnings for request user to open/enable it mannually? Or we may need
to keep the 'FIXME' line?
Thanks,
-Liang Li
>
> Ben.
>
> > + } else {
> > + ug_info->bdRingLenRx[queue] = ring->rx_pending;
> > + ug_info->bdRingLenTx[queue] = ring->tx_pending;
> > }
> >
> > return ret;
>
> --
> Ben Hutchings, Senior Software Engineer, Solarflare Communications
> Not speaking for my employer; that's the marketing department's job.
> They asked us to note that Solarflare product names are trademarked.
>
next prev parent reply other threads:[~2010-08-31 15:16 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-08-30 14:47 [PATCH] ucc_geth: fix ethtool set ring param bug Liang Li
2010-08-31 14:41 ` Ben Hutchings
2010-08-31 15:16 ` Liang Li [this message]
2010-08-31 15:23 ` Ben Hutchings
2010-09-01 1:43 ` [v1 PATCH] " Liang Li
2010-09-01 13:42 ` Ben Hutchings
2010-09-02 0:50 ` Liang Li
2010-09-02 11:11 ` Ben Hutchings
2010-09-02 15:48 ` Liang Li
2010-09-02 16:32 ` Ben Hutchings
2010-09-02 16:02 ` [v2 " Liang Li
2010-09-02 18:04 ` Ben Hutchings
2010-09-03 1:20 ` Liang Li
2010-09-06 20:22 ` 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=20100831151629.GA21442@localhost \
--to=liang.li@windriver.com \
--cc=avorontsov@ru.mvista.com \
--cc=bhutchings@solarflare.com \
--cc=davem@davemloft.net \
--cc=linuxppc-dev@lists.ozlabs.org \
--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).