From: David Miller <davem@davemloft.net>
To: liang.li@windriver.com
Cc: leoli@freescale.com, avorontsov@ru.mvista.com,
netdev@vger.kernel.org, linuxppc-dev@ozlabs.org
Subject: Re: [v2 PATCH] ucc_geth: fix ethtool set ring param bug
Date: Mon, 06 Sep 2010 13:22:23 -0700 (PDT) [thread overview]
Message-ID: <20100906.132223.48506151.davem@davemloft.net> (raw)
In-Reply-To: <1283443364-2136-1-git-send-email-liang.li@windriver.com>
From: Liang Li <liang.li@windriver.com>
Date: Fri, 3 Sep 2010 00:02:44 +0800
> + printk(KERN_INFO "Stopping interface %s.\n", netdev->name);
...
> + printk(KERN_INFO "Reactivating interface %s.\n", netdev->name);
Please get rid of these log messages.
Also, this isn't the way to implement this.
Abstract out the one and only operation that can fail when you change
the ring size, which is the memory allocations, into seperate code.
Allocate the newly sized rings first, and if that fails abort the
ring size change attempt. This will let the device continue to
function and operate properly even if the ring resizing fails.
Then stop the RX/TX DMA, switch the ring pointers and configuration
inside of the device, restart RX/TX DMA, and finally free up the
old ring memory.
I know why you want to use *_close() and *_open(), it requires less
coding and work on your part. But this is why the error handling
behavior is difficult and what happens on failure (device goes down
and becomes inoperative) is extremely unpleasant for the user.
The user should be able to make this kind of change over an SSH
shell that uses the interface itself, and not expect to lose
connectivity completely just because the ring allocation fails.
Thanks.
prev parent reply other threads:[~2010-09-06 20:22 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
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 [this message]
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=20100906.132223.48506151.davem@davemloft.net \
--to=davem@davemloft.net \
--cc=avorontsov@ru.mvista.com \
--cc=leoli@freescale.com \
--cc=liang.li@windriver.com \
--cc=linuxppc-dev@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).