From: Jiang Wang <Jiang.Wang@riverbed.com>
To: Michael Chan <mchan@broadcom.com>,
netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Cc: clala@riverbed.com, Francis.St.Amant@riverbed.com,
Jiang Wang <Jiang.Wang@riverbed.com>,
Jiang Wang <jwang@riverbed.com>
Subject: [PATCH] bnx2: turn off the network statck during initialization
Date: Thu, 16 Aug 2012 11:21:35 -0700 [thread overview]
Message-ID: <1345141295-7589-1-git-send-email-Jiang.Wang@riverbed.com> (raw)
The initialization state of bnx2 driver is wrong. It does not turn
of the Linux network stack using netif_carrier_off. This may lead to
inconsistent report from ethtool as the link is up but speed is
unknown when the cable is not plugged in.
E.g.
Speed: Unknown! (0)<--------------------------------------
Duplex: Half <--------------------------------------
MDI: Unknown! (0)
Port: Twisted Pair
PHYAD: 1
Transceiver: internal
Auto-negotiation: on
Supports Wake-on: g
Wake-on: d
Link detected: yes <---------------------------------------
This patches fixed the problem by turning off the network stack
during initialization.
Signed-off-by: Jiang Wang <jwang@riverbed.com>
---
drivers/net/ethernet/broadcom/bnx2.c | 4 ++++
1 files changed, 4 insertions(+), 0 deletions(-)
diff --git a/drivers/net/ethernet/broadcom/bnx2.c b/drivers/net/ethernet/broadcom/bnx2.c
index ac7b744..ce4548d 100644
--- a/drivers/net/ethernet/broadcom/bnx2.c
+++ b/drivers/net/ethernet/broadcom/bnx2.c
@@ -8463,6 +8463,10 @@ bnx2_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
dev->features |= dev->hw_features;
dev->priv_flags |= IFF_UNICAST_FLT;
+ /* tell the stack to leave us alone until bnx2_open() is called */
+ netif_carrier_off(dev);
+ netif_stop_queue(dev);
+
if ((rc = register_netdev(dev))) {
dev_err(&pdev->dev, "Cannot register net device\n");
goto error;
--
1.7.1
next reply other threads:[~2012-08-16 18:21 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-08-16 18:21 Jiang Wang [this message]
2012-08-16 18:57 ` [PATCH] bnx2: turn off the network statck during initialization Michael Chan
2012-08-16 19:15 ` Jiang Wang
2012-08-16 19:28 ` Michael Chan
2012-08-16 20:28 ` Jiang Wang
2012-08-16 21:13 ` Michael Chan
2012-08-16 21:48 ` Jiang Wang
2012-08-16 22:27 ` Michael Chan
2012-08-16 22:34 ` Jiang Wang
2012-08-16 21:25 ` Ben Hutchings
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=1345141295-7589-1-git-send-email-Jiang.Wang@riverbed.com \
--to=jiang.wang@riverbed.com \
--cc=Francis.St.Amant@riverbed.com \
--cc=clala@riverbed.com \
--cc=jwang@riverbed.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mchan@broadcom.com \
--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