DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH 1/2] net/bnx2x: fix for PCI FLR after ungraceful exit
@ 2018-04-18 20:15 Rasesh Mody
  2018-04-18 20:15 ` [dpdk-dev] [PATCH 2/2] net/bnx2x: make init and driver logtype names consistent Rasesh Mody
  2018-04-19 22:15 ` [dpdk-dev] [PATCH 1/2] net/bnx2x: fix for PCI FLR after ungraceful exit Ferruh Yigit
  0 siblings, 2 replies; 3+ messages in thread
From: Rasesh Mody @ 2018-04-18 20:15 UTC (permalink / raw)
  To: dev; +Cc: Rasesh Mody, ferruh.yigit, Dept-EngDPDKDev, stable

From: Rasesh Mody <rasesh.mody@qlogic.com>

This patch provides a fix for PCI function level reset after an
ungraceful exit from an application. The fix is to enable internal
target read as part of device attach before getting device information
from device config space, device itself and shared memory. In addition
to that, add a 200ms delay for the recovery flow to complete.

Fixes: 540a211084a7 ("bnx2x: driver core")
Cc: stable@dpdk.org

Signed-off-by: Rasesh Mody <rasesh.mody@qlogic.com>
---
 drivers/net/bnx2x/bnx2x.c |   24 ++++++++++++------------
 1 file changed, 12 insertions(+), 12 deletions(-)

diff --git a/drivers/net/bnx2x/bnx2x.c b/drivers/net/bnx2x/bnx2x.c
index 382b50f..bfd9cce 100644
--- a/drivers/net/bnx2x/bnx2x.c
+++ b/drivers/net/bnx2x/bnx2x.c
@@ -8285,16 +8285,6 @@ static int bnx2x_get_device_info(struct bnx2x_softc *sc)
 			REG_WR(sc, PXP2_REG_PGL_ADDR_90_F1, 0);
 			REG_WR(sc, PXP2_REG_PGL_ADDR_94_F1, 0);
 		}
-
-/*
- * Enable internal target-read (in case we are probed after PF
- * FLR). Must be done prior to any BAR read access. Only for
- * 57712 and up
- */
-		if (!CHIP_IS_E1x(sc)) {
-			REG_WR(sc, PGLUE_B_REG_INTERNAL_PFID_ENABLE_TARGET_READ,
-			       1);
-		}
 	}
 
 	/* get the nvram size */
@@ -9671,7 +9661,17 @@ int bnx2x_attach(struct bnx2x_softc *sc)
 	bnx2x_init_rte(sc);
 
 	if (IS_PF(sc)) {
-/* get device info and set params */
+		/* Enable internal target-read (in case we are probed after PF
+		 * FLR). Must be done prior to any BAR read access. Only for
+		 * 57712 and up
+		 */
+		if (!CHIP_IS_E1x(sc)) {
+			REG_WR(sc, PGLUE_B_REG_INTERNAL_PFID_ENABLE_TARGET_READ,
+			       1);
+			DELAY(200000);
+		}
+
+		/* get device info and set params */
 		if (bnx2x_get_device_info(sc) != 0) {
 			PMD_DRV_LOG(NOTICE, "getting device info");
 			return -ENXIO;
@@ -9680,7 +9680,7 @@ int bnx2x_attach(struct bnx2x_softc *sc)
 /* get phy settings from shmem and 'and' against admin settings */
 		bnx2x_get_phy_info(sc);
 	} else {
-/* Left mac of VF unfilled, PF should set it for VF */
+		/* Left mac of VF unfilled, PF should set it for VF */
 		memset(sc->link_params.mac_addr, 0, ETHER_ADDR_LEN);
 	}
 
-- 
1.7.10.3

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [dpdk-dev] [PATCH 2/2] net/bnx2x: make init and driver logtype names consistent
  2018-04-18 20:15 [dpdk-dev] [PATCH 1/2] net/bnx2x: fix for PCI FLR after ungraceful exit Rasesh Mody
@ 2018-04-18 20:15 ` Rasesh Mody
  2018-04-19 22:15 ` [dpdk-dev] [PATCH 1/2] net/bnx2x: fix for PCI FLR after ungraceful exit Ferruh Yigit
  1 sibling, 0 replies; 3+ messages in thread
From: Rasesh Mody @ 2018-04-18 20:15 UTC (permalink / raw)
  To: dev; +Cc: Rasesh Mody, ferruh.yigit, Dept-EngDPDKDev

From: Rasesh Mody <rasesh.mody@qlogic.com>

Signed-off-by: Rasesh Mody <rasesh.mody@qlogic.com>
---
 doc/guides/nics/bnx2x.rst        |    1 +
 drivers/net/bnx2x/bnx2x_ethdev.c |    4 ++--
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/doc/guides/nics/bnx2x.rst b/doc/guides/nics/bnx2x.rst
index 31f146a..cecbfc2 100644
--- a/doc/guides/nics/bnx2x.rst
+++ b/doc/guides/nics/bnx2x.rst
@@ -194,6 +194,7 @@ This section provides instructions to configure SR-IOV with Linux OS.
    using the instructions outlined in the Application notes below.
 
 #. Running testpmd:
+   (Supply ``--log-level="pmd.net.bnx2x.driver",7`` to view informational messages):
 
    Follow instructions available in the document
    :ref:`compiling and testing a PMD for a NIC <pmd_build_and_test>`
diff --git a/drivers/net/bnx2x/bnx2x_ethdev.c b/drivers/net/bnx2x/bnx2x_ethdev.c
index e08ef77..6ccbb99 100644
--- a/drivers/net/bnx2x/bnx2x_ethdev.c
+++ b/drivers/net/bnx2x/bnx2x_ethdev.c
@@ -697,10 +697,10 @@ static int eth_bnx2x_pci_remove(struct rte_pci_device *pci_dev)
 static void
 bnx2x_init_log(void)
 {
-	bnx2x_logtype_init = rte_log_register("pmd.bnx2x.init");
+	bnx2x_logtype_init = rte_log_register("pmd.net.bnx2x.init");
 	if (bnx2x_logtype_init >= 0)
 		rte_log_set_level(bnx2x_logtype_init, RTE_LOG_NOTICE);
-	bnx2x_logtype_driver = rte_log_register("pmd.bnx2x.driver");
+	bnx2x_logtype_driver = rte_log_register("pmd.net.bnx2x.driver");
 	if (bnx2x_logtype_driver >= 0)
 		rte_log_set_level(bnx2x_logtype_driver, RTE_LOG_NOTICE);
 }
-- 
1.7.10.3

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [dpdk-dev] [PATCH 1/2] net/bnx2x: fix for PCI FLR after ungraceful exit
  2018-04-18 20:15 [dpdk-dev] [PATCH 1/2] net/bnx2x: fix for PCI FLR after ungraceful exit Rasesh Mody
  2018-04-18 20:15 ` [dpdk-dev] [PATCH 2/2] net/bnx2x: make init and driver logtype names consistent Rasesh Mody
@ 2018-04-19 22:15 ` Ferruh Yigit
  1 sibling, 0 replies; 3+ messages in thread
From: Ferruh Yigit @ 2018-04-19 22:15 UTC (permalink / raw)
  To: Rasesh Mody, dev; +Cc: Rasesh Mody, Dept-EngDPDKDev, stable

On 4/18/2018 9:15 PM, Rasesh Mody wrote:
> From: Rasesh Mody <rasesh.mody@qlogic.com>
> 
> This patch provides a fix for PCI function level reset after an
> ungraceful exit from an application. The fix is to enable internal
> target read as part of device attach before getting device information
> from device config space, device itself and shared memory. In addition
> to that, add a 200ms delay for the recovery flow to complete.
> 
> Fixes: 540a211084a7 ("bnx2x: driver core")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Rasesh Mody <rasesh.mody@qlogic.com>

Series applied to dpdk-next-net/master, thanks.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2018-04-19 22:15 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-04-18 20:15 [dpdk-dev] [PATCH 1/2] net/bnx2x: fix for PCI FLR after ungraceful exit Rasesh Mody
2018-04-18 20:15 ` [dpdk-dev] [PATCH 2/2] net/bnx2x: make init and driver logtype names consistent Rasesh Mody
2018-04-19 22:15 ` [dpdk-dev] [PATCH 1/2] net/bnx2x: fix for PCI FLR after ungraceful exit Ferruh Yigit

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).