public inbox for linuxppc-dev@ozlabs.org 
 help / color / mirror / Atom feed
From: Ben Hutchings <bhutchings@solarflare•com>
To: Liang Li <liang.li@windriver•com>
Cc: netdev@vger•kernel.org, avorontsov@ru•mvista.com,
	davem@davemloft•net, linuxppc-dev@ozlabs•org
Subject: Re: [v1 PATCH] ucc_geth: fix ethtool set ring param bug
Date: Thu, 02 Sep 2010 17:32:56 +0100	[thread overview]
Message-ID: <1283445176.2272.3.camel@achroite.uk.solarflarecom.com> (raw)
In-Reply-To: <20100902154818.GA30293@localhost>

On Thu, 2010-09-02 at 23:48 +0800, Liang Li wrote:
> On Thu, Sep 02, 2010 at 12:11:47PM +0100, Ben Hutchings wrote:
> > On Thu, 2010-09-02 at 08:50 +0800, Liang Li wrote:
> > > On Wed, Sep 01, 2010 at 02:42:30PM +0100, Ben Hutchings wrote:
> > > > On Wed, 2010-09-01 at 09:43 +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:
> > > > [...]
> > > > > -	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");
> > > > > +		u16 rx_t;
> > > > > +		u16 tx_t;
> > > > > +		printk(KERN_INFO "Stopping interface %s.\n", netdev->name);
> > > > > +		ucc_geth_close(netdev);
> > > > > +
> > > > > +		rx_t = ug_info->bdRingLenRx[queue];
> > > > > +		tx_t = ug_info->bdRingLenTx[queue];
> > > > > +
> > > > > +		ug_info->bdRingLenRx[queue] = ring->rx_pending;
> > > > > +		ug_info->bdRingLenTx[queue] = ring->tx_pending;
> > > > > +
> > > > > +		printk(KERN_INFO "Reactivating interface %s.\n", netdev->name);
> > > > > +		ret = ucc_geth_open(netdev);
> > > > > +		if (ret) {
> > > > > +			printk(KERN_WARNING "uec_set_ringparam: set ring param for running"
> > > > > +					" interface %s failed. Please try to make the interface "
> > > > > +					" down, then try again.\n", netdev->name);
> > > > > +			ug_info->bdRingLenRx[queue] = rx_t;
> > > > > +			ug_info->bdRingLenTx[queue] = tx_t;
> > > > > +		}
> > > > [...]
> > > > 
> > > > Bringing the interface down will call ucc_geth_close(), which will try
> > > > to free resources that have not been allocated!
> > > 
> > > Sorry, I did not understand you on this point. There is no
> > > ucc_geth_close when 'open fail'. What you mean here exactly?
> > [...]
> > 
> > Read your own warning.
> 
> So the warning is mis-leading... We may not need it... Still, let's talk
> about the rare case that 'fail of open', may you please show me what is
> the right thing to do 'clean up work' when ever the open fail. Maybe
> dev_close(net_dev)?

I give up.

Just s/ucc_geth_open/dev_open/ and s/ucc_geth_close/dev_close/.

Ben.

-- 
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.

  reply	other threads:[~2010-09-02 16:33 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
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 [this message]
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=1283445176.2272.3.camel@achroite.uk.solarflarecom.com \
    --to=bhutchings@solarflare$(echo .)com \
    --cc=avorontsov@ru$(echo .)mvista.com \
    --cc=davem@davemloft$(echo .)net \
    --cc=liang.li@windriver$(echo .)com \
    --cc=linuxppc-dev@ozlabs$(echo .)org \
    --cc=netdev@vger$(echo .)kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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