From: Naohiro Ooiwa <nooiwa@miraclelinux.com>
To: Michael Chan <mchan@broadcom.com>
Cc: Rick Jones <rick.jones2@hp.com>,
"netdev@vger.kernel.org" <netdev@vger.kernel.org>
Subject: Re: [PATCH] bnx2: Fix the behavior of ethtool when ONBOOT=no
Date: Mon, 29 Jun 2009 09:49:44 +0900 [thread overview]
Message-ID: <4A480FA8.4000401@miraclelinux.com> (raw)
In-Reply-To: <1245862760.12000.507.camel@nseg_linux_HP1.broadcom.com>
Hi Michael
Thank you for your comment.
I tried to create a patch of bnx2x driver.
It's the same fix as bnx2 driver.
Could you please check the my patch ?
Of cource, I made sure of compile.
Best Regards,
Naohiro Ooiwa
Signed-off-by: Naohiro Ooiwa <nooiwa@miraclelinux.com>
---
drivers/net/bnx2x_main.c | 10 +++++++++-
1 files changed, 9 insertions(+), 1 deletions(-)
diff --git a/drivers/net/bnx2x_main.c b/drivers/net/bnx2x_main.c
index fbf1352..951714a 100644
--- a/drivers/net/bnx2x_main.c
+++ b/drivers/net/bnx2x_main.c
@@ -8637,6 +8637,14 @@ static int bnx2x_nway_reset(struct net_device *dev)
return 0;
}
+static u32
+bnx2x_get_link(struct net_device *dev)
+{
+ struct bnx2x *bp = netdev_priv(dev);
+
+ return bp->link_vars.link_up;
+}
+
static int bnx2x_get_eeprom_len(struct net_device *dev)
{
struct bnx2x *bp = netdev_priv(dev);
@@ -10034,7 +10042,7 @@ static struct ethtool_ops bnx2x_ethtool_ops = {
.get_msglevel = bnx2x_get_msglevel,
.set_msglevel = bnx2x_set_msglevel,
.nway_reset = bnx2x_nway_reset,
- .get_link = ethtool_op_get_link,
+ .get_link = bnx2x_get_link,
.get_eeprom_len = bnx2x_get_eeprom_len,
.get_eeprom = bnx2x_get_eeprom,
.set_eeprom = bnx2x_set_eeprom,
--
1.5.4.1
Michael Chan wrote:
> On Wed, 2009-06-24 at 09:43 -0700, Rick Jones wrote:
>> Naohiro Ooiwa wrote:
>>> Hi Michael
>>>
>>> I found a little bug.
>>>
>>> When configure in ifcfg-eth* is ONBOOT=no,
>>> the behavior of ethtool command is wrong.
>>>
>>> # grep ONBOOT /etc/sysconfig/network-scripts/ifcfg-eth2
>>> ONBOOT=no
>>> # ethtool eth2 | tail -n1
>>> Link detected: yes
>>>
>>> I think "Link detected" should be "no".
>> Why? Sure, there is no IP on the link, but does that mean the link is
>> otherwise unusable? Is ethtool only about IP status?
>>
>
> Once the device is closed, we no longer keep track of the link state and
> no longer have register access to determine the link state. So we
> assume it is down. In reality, it may still be up if WoL is enabled or
> management firmware is running, but the driver can no longer keep track
> of it. If we have to assume one or the other, I think it is more
> correct to assume it is down.
>
>
>
next prev parent reply other threads:[~2009-06-29 0:49 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-06-24 2:57 [PATCH] bnx2: Fix the behavior of ethtool when ONBOOT=no Naohiro Ooiwa
2009-06-24 3:48 ` Michael Chan
2009-06-24 4:43 ` Naohiro Ooiwa
2009-06-24 5:04 ` Michael Chan
2009-06-24 5:45 ` Naohiro Ooiwa
2009-06-24 7:08 ` David Miller
2009-06-24 7:16 ` David Miller
2009-06-24 8:39 ` Naohiro Ooiwa
2009-06-24 16:43 ` Rick Jones
2009-06-24 16:59 ` Michael Chan
2009-06-24 23:42 ` David Miller
2009-06-24 23:48 ` Michael Chan
2009-06-25 0:12 ` David Miller
2009-06-25 0:25 ` David Miller
2009-06-26 4:30 ` Naohiro Ooiwa
2009-06-29 0:49 ` Naohiro Ooiwa [this message]
2009-06-30 14:50 ` Eilon Greenstein
2009-06-30 19:46 ` David Miller
2009-07-02 4:46 ` Naohiro Ooiwa
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=4A480FA8.4000401@miraclelinux.com \
--to=nooiwa@miraclelinux.com \
--cc=mchan@broadcom.com \
--cc=netdev@vger.kernel.org \
--cc=rick.jones2@hp.com \
/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).