From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by dpdk.org (Postfix) with ESMTP id 2193F1B4BC for ; Thu, 29 Nov 2018 14:22:16 +0100 (CET) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 8829930C13BC; Thu, 29 Nov 2018 13:22:15 +0000 (UTC) Received: from ktraynor.remote.csb (ovpn-117-230.ams2.redhat.com [10.36.117.230]) by smtp.corp.redhat.com (Postfix) with ESMTP id 44B8C1001F50; Thu, 29 Nov 2018 13:22:13 +0000 (UTC) From: Kevin Traynor To: Rasesh Mody Cc: dpdk stable Date: Thu, 29 Nov 2018 13:20:18 +0000 Message-Id: <20181129132128.7609-18-ktraynor@redhat.com> In-Reply-To: <20181129132128.7609-1-ktraynor@redhat.com> References: <20181129132128.7609-1-ktraynor@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.42]); Thu, 29 Nov 2018 13:22:15 +0000 (UTC) Subject: [dpdk-stable] patch 'net/bnx2x: fix VF link state update' has been queued to stable release 18.08.1 X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Nov 2018 13:22:16 -0000 Hi, FYI, your patch has been queued to stable release 18.08.1 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 12/08/18. So please shout if anyone has objections. Also note that after the patch there's a diff of the upstream commit vs the patch applied to the branch. If the code is different (ie: not only metadata diffs), due for example to a change in context or macro names, please double check it. Thanks. Kevin Traynor --- >>From e2ac0b8aca9a15a45ad3bd112955b71b9abc0667 Mon Sep 17 00:00:00 2001 From: Rasesh Mody Date: Thu, 8 Nov 2018 21:19:30 +0000 Subject: [PATCH] net/bnx2x: fix VF link state update [ upstream commit 39ae74caa0d1158df15ea1e2f8e893eee1a2189d ] In general the VF driver should not access the chip. For VF link status update, VF driver should not use HW lock, use bnx2x_link_report_locked() instead. Add few prints for releasing previously held HW locks. Fixes: a9b58b15ed51 ("net/bnx2x: fix to add PHY lock") Signed-off-by: Rasesh Mody --- drivers/net/bnx2x/bnx2x.c | 25 +++++++++++++++++++------ 1 file changed, 19 insertions(+), 6 deletions(-) diff --git a/drivers/net/bnx2x/bnx2x.c b/drivers/net/bnx2x/bnx2x.c index 279759366..a6d2687a2 100644 --- a/drivers/net/bnx2x/bnx2x.c +++ b/drivers/net/bnx2x/bnx2x.c @@ -200,6 +200,10 @@ static int bnx2x_acquire_hw_lock(struct bnx2x_softc *sc, uint32_t resource) int cnt; +#ifndef RTE_LIBRTE_BNX2X_DEBUG_PERIODIC if (resource) PMD_INIT_FUNC_TRACE(sc); +#else + PMD_INIT_FUNC_TRACE(sc); +#endif /* validate the resource is within range */ @@ -249,6 +253,10 @@ static int bnx2x_release_hw_lock(struct bnx2x_softc *sc, uint32_t resource) uint32_t hw_lock_control_reg; +#ifndef RTE_LIBRTE_BNX2X_DEBUG_PERIODIC if (resource) PMD_INIT_FUNC_TRACE(sc); +#else + PMD_INIT_FUNC_TRACE(sc); +#endif /* validate the resource is within range */ @@ -7042,5 +7050,5 @@ void bnx2x_link_status_update(struct bnx2x_softc *sc) bnx2x_link_report(sc); } else { - bnx2x_link_report(sc); + bnx2x_link_report_locked(sc); bnx2x_stats_handle(sc, STATS_EVENT_LINK_UP); } @@ -9389,4 +9397,6 @@ static int bnx2x_prev_unload(struct bnx2x_softc *sc) uint32_t rc = 0; + PMD_INIT_FUNC_TRACE(sc); + /* * Clear HW from errors which may have resulted from an interrupted @@ -9396,20 +9406,21 @@ static int bnx2x_prev_unload(struct bnx2x_softc *sc) /* Release previously held locks */ - if (SC_FUNC(sc) <= 5) - hw_lock_reg = (MISC_REG_DRIVER_CONTROL_1 + SC_FUNC(sc) * 8); - else - hw_lock_reg = - (MISC_REG_DRIVER_CONTROL_7 + (SC_FUNC(sc) - 6) * 8); + hw_lock_reg = (SC_FUNC(sc) <= 5) ? + (MISC_REG_DRIVER_CONTROL_1 + SC_FUNC(sc) * 8) : + (MISC_REG_DRIVER_CONTROL_7 + (SC_FUNC(sc) - 6) * 8); hw_lock_val = (REG_RD(sc, hw_lock_reg)); if (hw_lock_val) { if (hw_lock_val & HW_LOCK_RESOURCE_NVRAM) { + PMD_DRV_LOG(DEBUG, sc, "Releasing previously held NVRAM lock\n"); REG_WR(sc, MCP_REG_MCPR_NVM_SW_ARB, (MCPR_NVM_SW_ARB_ARB_REQ_CLR1 << SC_PORT(sc))); } + PMD_DRV_LOG(DEBUG, sc, "Releasing previously held HW lock\n"); REG_WR(sc, hw_lock_reg, 0xffffffff); } if (MCPR_ACCESS_LOCK_LOCK & REG_RD(sc, MCP_REG_MCPR_ACCESS_LOCK)) { + PMD_DRV_LOG(DEBUG, sc, "Releasing previously held ALR\n"); REG_WR(sc, MCP_REG_MCPR_ACCESS_LOCK, 0); } @@ -9741,4 +9752,6 @@ int bnx2x_attach(struct bnx2x_softc *sc) (SHMEM_RD(sc, func_mb[SC_FW_MB_IDX(sc)].drv_mb_header) & DRV_MSG_SEQ_NUMBER_MASK); + PMD_DRV_LOG(DEBUG, sc, "prev unload fw_seq 0x%04x", + sc->fw_seq); bnx2x_prev_unload(sc); } -- 2.19.0 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2018-11-29 13:11:35.466044197 +0000 +++ 0017-net-bnx2x-fix-VF-link-state-update.patch 2018-11-29 13:11:34.000000000 +0000 @@ -1,15 +1,16 @@ -From 39ae74caa0d1158df15ea1e2f8e893eee1a2189d Mon Sep 17 00:00:00 2001 +From e2ac0b8aca9a15a45ad3bd112955b71b9abc0667 Mon Sep 17 00:00:00 2001 From: Rasesh Mody Date: Thu, 8 Nov 2018 21:19:30 +0000 Subject: [PATCH] net/bnx2x: fix VF link state update +[ upstream commit 39ae74caa0d1158df15ea1e2f8e893eee1a2189d ] + In general the VF driver should not access the chip. For VF link status update, VF driver should not use HW lock, use bnx2x_link_report_locked() instead. Add few prints for releasing previously held HW locks. Fixes: a9b58b15ed51 ("net/bnx2x: fix to add PHY lock") -Cc: stable@dpdk.org Signed-off-by: Rasesh Mody ---