DPDK patches and discussions
 help / color / mirror / Atom feed
From: Chas Williams <3chas3@gmail.com>
To: dev@dpdk.org
Subject: [dpdk-dev] [PATCH] bnx2x: check sc->state to prevent double init
Date: Tue,  8 Dec 2015 09:48:24 -0500	[thread overview]
Message-ID: <1449586104-9977-1-git-send-email-3chas3@gmail.com> (raw)

If the link is up, then the driver cannot be stopped and started
successfully.  Instead of checking the link status, use the driver's
state.

Signed-off-by: Chas Williams <3chas3@gmail.com>
---
 drivers/net/bnx2x/bnx2x.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/bnx2x/bnx2x.c b/drivers/net/bnx2x/bnx2x.c
index 294711f..2dc2a47 100644
--- a/drivers/net/bnx2x/bnx2x.c
+++ b/drivers/net/bnx2x/bnx2x.c
@@ -7430,7 +7430,7 @@ int bnx2x_init(struct bnx2x_softc *sc)
 	int rc;
 
 	/* Check if the driver is still running and bail out if it is. */
-	if (sc->link_vars.link_up) {
+	if (sc->state != BNX2X_STATE_CLOSED) {
 		PMD_DRV_LOG(DEBUG, "Init called while driver is running!");
 		rc = 0;
 		goto bnx2x_init_done;
-- 
2.1.0

             reply	other threads:[~2015-12-08 14:48 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-12-08 14:48 Chas Williams [this message]
2015-12-09 20:24 ` Thomas Monjalon

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=1449586104-9977-1-git-send-email-3chas3@gmail.com \
    --to=3chas3@gmail.com \
    --cc=dev@dpdk.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).