From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: <3chas3@gmail.com> 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) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=L7uJ1OnfZTdej1NROVE+g3kri5FOWjryd9fHH23dxEk=; b=YAvyzyHtC9KXHKZ5+OqtiFIQnvdKTaSi6Qzc5pMbiE/MKTyN63mY1/BGs5C8QThJ7S jw7WxiR6yN0hv473pThsthaXZ/rDWiWARVs3DVj65r+O6XR8HAxJBKsSjPu4IsyctUk+ +n6dObmuzvi2uSYzMOt7vdH6MsrdRRQdOMsWBzUvqTmrv2IKTd1XlDVQ2vGS4/WFxVYh V+ZqgFWB11LditM9RYvjwP7pdSNgK7MH9xDjyAfELW2jJh2sDVLkKfgpstnNuBOpEJgc SoOAPPv/w+qaT8F12GwzIKKIsmtt81T/2/W9gWqWdJycYbB4fR9HrnPVK/LyE5D/RjO+ 7IPw== X-Received: by 10.140.93.52 with SMTP id c49mr4480834qge.101.1449586112488; Tue, 08 Dec 2015 06:48:32 -0800 (PST) Received: from foobar.home (pool-71-163-182-126.washdc.fios.verizon.net. [71.163.182.126]) by smtp.gmail.com with ESMTPSA id 144sm1609591qhw.48.2015.12.08.06.48.31 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 08 Dec 2015 06:48:31 -0800 (PST) From: Chas Williams <3chas3@gmail.com> To: dev@dpdk.org Date: Tue, 8 Dec 2015 09:48:24 -0500 Message-Id: <1449586104-9977-1-git-send-email-3chas3@gmail.com> X-Mailer: git-send-email 2.1.0 Subject: [dpdk-dev] [PATCH] bnx2x: check sc->state to prevent double init X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Dec 2015 14:48:33 -0000 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