From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm1-f48.google.com (mail-wm1-f48.google.com [209.85.128.48]) by dpdk.org (Postfix) with ESMTP id 6C60A2C52 for ; Mon, 19 Nov 2018 13:25:59 +0100 (CET) Received: by mail-wm1-f48.google.com with SMTP id t15-v6so5067623wmt.0 for ; Mon, 19 Nov 2018 04:25:59 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=P7nak271HdGuyqEpvW5/yTLxZocbJmFIOc0ddcA99Nk=; b=S1f8blHRcr+c6r/YMN2JGMRGWGECk3ZNv0yJgjdmtwijse0wQIxaCq5Tc0JXrFlkZn 8+zrTqfWqjHiCqoRzrlFvML5eeLQlJ/a/uxqrvfQIeaGZfgvO2lfT1F48lZ5gz0CscG9 tXeTXWI6GyJtsSt3HrB9KmICWB666hPlH5biEzjws3aNuc+jIeNpTP0EbfPLEnfFSUvD k7758CMqM/kxO0yYx2LRWY4OouwnGkCBgeKUwt8KXI4qNMkcFL2TvoMLJNv26JUL4LXP 6IYdcPUfScmPO60du5dbtQvD7vapwhe8BtFhfjzBbCCjxrkO/D054DzomMo0g7Xs1xsJ 3wmA== X-Gm-Message-State: AGRZ1gKSvydpZrTvGcj3itFXIVJUOq3vtjpwFrl8keYvYQv7OaBckauq VlHKxtQ+4PrcrDQfxxBcJ4A= X-Google-Smtp-Source: AJdET5fU3aIjylBDHNcv34hcq+RimbaL3AB4B6pR+OI8OXds8EWgZ6sPa9ZHx435nCY4m+T6s8oP/A== X-Received: by 2002:a1c:1c88:: with SMTP id c130-v6mr6954629wmc.115.1542630359024; Mon, 19 Nov 2018 04:25:59 -0800 (PST) Received: from localhost ([2a01:4b00:f419:6f00:8361:8946:ba2b:d556]) by smtp.gmail.com with ESMTPSA id r76-v6sm33165368wmb.21.2018.11.19.04.25.58 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 19 Nov 2018 04:25:58 -0800 (PST) From: Luca Boccassi To: Rasesh Mody Cc: dpdk stable Date: Mon, 19 Nov 2018 12:25:27 +0000 Message-Id: <20181119122538.14207-10-bluca@debian.org> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20181119122538.14207-1-bluca@debian.org> References: <20181108180111.25873-1-bluca@debian.org> <20181119122538.14207-1-bluca@debian.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-stable] patch 'net/bnx2x: fix VF link state update' has been queued to LTS release 16.11.9 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: Mon, 19 Nov 2018 12:25:59 -0000 Hi, FYI, your patch has been queued to LTS release 16.11.9 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 11/21/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. Luca Boccassi --- >>From f86204d63a27c3d6ddc8b1d63f21fb359d583ed0 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 92abdbbd4..7cf9d1c4e 100644 --- a/drivers/net/bnx2x/bnx2x.c +++ b/drivers/net/bnx2x/bnx2x.c @@ -202,8 +202,12 @@ static int bnx2x_acquire_hw_lock(struct bnx2x_softc *sc, uint32_t resource) uint32_t hw_lock_control_reg; 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 */ if (resource > HW_LOCK_MAX_RESOURCE_VALUE) { @@ -251,8 +255,12 @@ static int bnx2x_release_hw_lock(struct bnx2x_softc *sc, uint32_t resource) int func = SC_FUNC(sc); 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 */ if (resource > HW_LOCK_MAX_RESOURCE_VALUE) { @@ -7049,7 +7057,7 @@ 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); } } @@ -9412,6 +9420,8 @@ static int bnx2x_prev_unload(struct bnx2x_softc *sc) uint32_t fw, hw_lock_reg, hw_lock_val; uint32_t rc = 0; + PMD_INIT_FUNC_TRACE(sc); + /* * Clear HW from errors which may have resulted from an interrupted * DMAE transaction. @@ -9419,22 +9429,23 @@ static int bnx2x_prev_unload(struct bnx2x_softc *sc) bnx2x_prev_interrupted_dmae(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); } @@ -9764,6 +9775,8 @@ int bnx2x_attach(struct bnx2x_softc *sc) sc->fw_seq = (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.1 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2018-11-19 12:15:18.312223623 +0000 +++ 0010-net-bnx2x-fix-VF-link-state-update.patch 2018-11-19 12:15:18.095611432 +0000 @@ -1,15 +1,16 @@ -From 39ae74caa0d1158df15ea1e2f8e893eee1a2189d Mon Sep 17 00:00:00 2001 +From f86204d63a27c3d6ddc8b1d63f21fb359d583ed0 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 --- @@ -17,10 +18,10 @@ 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 +index 92abdbbd4..7cf9d1c4e 100644 --- a/drivers/net/bnx2x/bnx2x.c +++ b/drivers/net/bnx2x/bnx2x.c -@@ -199,8 +199,12 @@ static int bnx2x_acquire_hw_lock(struct bnx2x_softc *sc, uint32_t resource) +@@ -202,8 +202,12 @@ static int bnx2x_acquire_hw_lock(struct bnx2x_softc *sc, uint32_t resource) uint32_t hw_lock_control_reg; int cnt; @@ -33,7 +34,7 @@ /* validate the resource is within range */ if (resource > HW_LOCK_MAX_RESOURCE_VALUE) { -@@ -248,8 +252,12 @@ static int bnx2x_release_hw_lock(struct bnx2x_softc *sc, uint32_t resource) +@@ -251,8 +255,12 @@ static int bnx2x_release_hw_lock(struct bnx2x_softc *sc, uint32_t resource) int func = SC_FUNC(sc); uint32_t hw_lock_control_reg; @@ -46,7 +47,7 @@ /* validate the resource is within range */ if (resource > HW_LOCK_MAX_RESOURCE_VALUE) { -@@ -7041,7 +7049,7 @@ void bnx2x_link_status_update(struct bnx2x_softc *sc) +@@ -7049,7 +7057,7 @@ void bnx2x_link_status_update(struct bnx2x_softc *sc) } bnx2x_link_report(sc); } else { @@ -55,7 +56,7 @@ bnx2x_stats_handle(sc, STATS_EVENT_LINK_UP); } } -@@ -9388,6 +9396,8 @@ static int bnx2x_prev_unload(struct bnx2x_softc *sc) +@@ -9412,6 +9420,8 @@ static int bnx2x_prev_unload(struct bnx2x_softc *sc) uint32_t fw, hw_lock_reg, hw_lock_val; uint32_t rc = 0; @@ -64,7 +65,7 @@ /* * Clear HW from errors which may have resulted from an interrupted * DMAE transaction. -@@ -9395,22 +9405,23 @@ static int bnx2x_prev_unload(struct bnx2x_softc *sc) +@@ -9419,22 +9429,23 @@ static int bnx2x_prev_unload(struct bnx2x_softc *sc) bnx2x_prev_interrupted_dmae(sc); /* Release previously held locks */ @@ -93,7 +94,7 @@ REG_WR(sc, MCP_REG_MCPR_ACCESS_LOCK, 0); } -@@ -9740,6 +9751,8 @@ int bnx2x_attach(struct bnx2x_softc *sc) +@@ -9764,6 +9775,8 @@ int bnx2x_attach(struct bnx2x_softc *sc) sc->fw_seq = (SHMEM_RD(sc, func_mb[SC_FW_MB_IDX(sc)].drv_mb_header) & DRV_MSG_SEQ_NUMBER_MASK);