From mboxrd@z Thu Jan 1 00:00:00 1970 From: Chas Williams <3chas3@gmail.com> Subject: [PATCH] bnx2x: check sc->state to prevent double init Date: Tue, 8 Dec 2015 09:48:24 -0500 Message-ID: <1449586104-9977-1-git-send-email-3chas3@gmail.com> To: dev@dpdk.org Return-path: Received: from mail-qg0-f46.google.com (mail-qg0-f46.google.com [209.85.192.46]) by dpdk.org (Postfix) with ESMTP id ED5BB559C for ; Tue, 8 Dec 2015 15:48:32 +0100 (CET) Received: by qgec40 with SMTP id c40so18785880qge.2 for ; Tue, 08 Dec 2015 06:48:32 -0800 (PST) List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 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