[dpdk-stable] patch 'net/bnx2x: fix fastpath SB allocation for SRIOV' has been queued to LTS release 18.11.3

Kevin Traynor ktraynor at redhat.com
Wed Aug 28 15:41:44 CEST 2019


Hi,

FYI, your patch has been queued to LTS release 18.11.3

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 09/04/19. 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. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://github.com/kevintraynor/dpdk-stable-queue

This queued commit can be viewed at:
https://github.com/kevintraynor/dpdk-stable-queue/commit/ae110478a3face082f270c58d430676064763ff2

Thanks.

Kevin Traynor

---
>From ae110478a3face082f270c58d430676064763ff2 Mon Sep 17 00:00:00 2001
From: Rasesh Mody <rmody at marvell.com>
Date: Wed, 3 Jul 2019 16:43:13 -0700
Subject: [PATCH] net/bnx2x: fix fastpath SB allocation for SRIOV

[ upstream commit 0cdbc98f6ed48b769ed5b22a61c38fbe3c90538a ]

For SRIOV, fastpath status blocks are not allocated resulting in
segfault. Separate out fastpath DMA allocation/free from rest of
memory allocation/free. It is now done as part of NIC load/unload.

Comment indentation changes in bnx2x_alloc_hsi_mem() and
bnx2x_free_hsi_mem() APIs.

Fixes: f0219d98defd ("net/bnx2x: fix interrupt flood")

Signed-off-by: Rasesh Mody <rmody at marvell.com>
---
 drivers/net/bnx2x/bnx2x.c | 117 +++++++++++++++++++-------------------
 1 file changed, 60 insertions(+), 57 deletions(-)

diff --git a/drivers/net/bnx2x/bnx2x.c b/drivers/net/bnx2x/bnx2x.c
index 4ac5ea8d8..3b034b1e9 100644
--- a/drivers/net/bnx2x/bnx2x.c
+++ b/drivers/net/bnx2x/bnx2x.c
@@ -2121,4 +2121,7 @@ bnx2x_nic_unload(struct bnx2x_softc *sc, uint32_t unload_mode, uint8_t keep_link
 	}
 
+	/* free the host hardware/software hsi structures */
+	bnx2x_free_hsi_mem(sc);
+
 	bnx2x_free_fw_stats_mem(sc);
 
@@ -2404,7 +2407,4 @@ static void bnx2x_free_mem(struct bnx2x_softc *sc)
 
 	bnx2x_free_ilt_lines_mem(sc);
-
-	/* free the host hardware/software hsi structures */
-	bnx2x_free_hsi_mem(sc);
 }
 
@@ -2457,11 +2457,4 @@ static int bnx2x_alloc_mem(struct bnx2x_softc *sc)
 	}
 
-	/* allocate the host hardware/software hsi structures */
-	if (bnx2x_alloc_hsi_mem(sc) != 0) {
-		PMD_DRV_LOG(ERR, sc, "bnx2x_alloc_hsi_mem was failed");
-		bnx2x_free_mem(sc);
-		return -ENXIO;
-	}
-
 	return 0;
 }
@@ -7243,4 +7236,12 @@ int bnx2x_nic_load(struct bnx2x_softc *sc)
 	}
 
+	/* allocate the host hardware/software hsi structures */
+	if (bnx2x_alloc_hsi_mem(sc) != 0) {
+		PMD_DRV_LOG(ERR, sc, "bnx2x_alloc_hsi_mem was failed");
+		sc->state = BNX2X_STATE_CLOSED;
+		rc = -ENOMEM;
+		goto bnx2x_nic_load_error0;
+	}
+
 	if (bnx2x_alloc_fw_stats_mem(sc) != 0) {
 		sc->state = BNX2X_STATE_CLOSED;
@@ -7458,4 +7459,5 @@ bnx2x_nic_load_error0:
 
 	bnx2x_free_fw_stats_mem(sc);
+	bnx2x_free_hsi_mem(sc);
 	bnx2x_free_mem(sc);
 
@@ -8903,7 +8905,7 @@ int bnx2x_alloc_hsi_mem(struct bnx2x_softc *sc)
 
 	if (IS_PF(sc)) {
-/************************/
-/* DEFAULT STATUS BLOCK */
-/************************/
+		/************************/
+		/* DEFAULT STATUS BLOCK */
+		/************************/
 
 		if (bnx2x_dma_alloc(sc, sizeof(struct host_sp_status_block),
@@ -8915,7 +8917,7 @@ int bnx2x_alloc_hsi_mem(struct bnx2x_softc *sc)
 		sc->def_sb =
 		    (struct host_sp_status_block *)sc->def_sb_dma.vaddr;
-/***************/
-/* EVENT QUEUE */
-/***************/
+		/***************/
+		/* EVENT QUEUE */
+		/***************/
 
 		if (bnx2x_dma_alloc(sc, BNX2X_PAGE_SIZE,
@@ -8928,7 +8930,7 @@ int bnx2x_alloc_hsi_mem(struct bnx2x_softc *sc)
 		sc->eq = (union event_ring_elem *)sc->eq_dma.vaddr;
 
-/*************/
-/* SLOW PATH */
-/*************/
+		/*************/
+		/* SLOW PATH */
+		/*************/
 
 		if (bnx2x_dma_alloc(sc, sizeof(struct bnx2x_slowpath),
@@ -8942,7 +8944,7 @@ int bnx2x_alloc_hsi_mem(struct bnx2x_softc *sc)
 		sc->sp = (struct bnx2x_slowpath *)sc->sp_dma.vaddr;
 
-/*******************/
-/* SLOW PATH QUEUE */
-/*******************/
+		/*******************/
+		/* SLOW PATH QUEUE */
+		/*******************/
 
 		if (bnx2x_dma_alloc(sc, BNX2X_PAGE_SIZE,
@@ -8957,7 +8959,7 @@ int bnx2x_alloc_hsi_mem(struct bnx2x_softc *sc)
 		sc->spq = (struct eth_spe *)sc->spq_dma.vaddr;
 
-/***************************/
-/* FW DECOMPRESSION BUFFER */
-/***************************/
+		/***************************/
+		/* FW DECOMPRESSION BUFFER */
+		/***************************/
 
 		if (bnx2x_dma_alloc(sc, FW_BUF_SIZE, &sc->gz_buf_dma,
@@ -8983,7 +8985,7 @@ int bnx2x_alloc_hsi_mem(struct bnx2x_softc *sc)
 		fp->index = i;
 
-/*******************/
-/* FP STATUS BLOCK */
-/*******************/
+		/*******************/
+		/* FP STATUS BLOCK */
+		/*******************/
 
 		snprintf(buf, sizeof(buf), "fp_%d_sb", i);
@@ -9016,7 +9018,7 @@ void bnx2x_free_hsi_mem(struct bnx2x_softc *sc)
 		fp = &sc->fp[i];
 
-/*******************/
-/* FP STATUS BLOCK */
-/*******************/
+		/*******************/
+		/* FP STATUS BLOCK */
+		/*******************/
 
 		memset(&fp->status_block, 0, sizeof(fp->status_block));
@@ -9024,39 +9026,40 @@ void bnx2x_free_hsi_mem(struct bnx2x_softc *sc)
 	}
 
-	/***************************/
-	/* FW DECOMPRESSION BUFFER */
-	/***************************/
+	if (IS_PF(sc)) {
+		/***************************/
+		/* FW DECOMPRESSION BUFFER */
+		/***************************/
 
-	bnx2x_dma_free(&sc->gz_buf_dma);
-	sc->gz_buf = NULL;
+		bnx2x_dma_free(&sc->gz_buf_dma);
+		sc->gz_buf = NULL;
 
-	/*******************/
-	/* SLOW PATH QUEUE */
-	/*******************/
+		/*******************/
+		/* SLOW PATH QUEUE */
+		/*******************/
 
-	bnx2x_dma_free(&sc->spq_dma);
-	sc->spq = NULL;
+		bnx2x_dma_free(&sc->spq_dma);
+		sc->spq = NULL;
 
-	/*************/
-	/* SLOW PATH */
-	/*************/
+		/*************/
+		/* SLOW PATH */
+		/*************/
 
-	bnx2x_dma_free(&sc->sp_dma);
-	sc->sp = NULL;
+		bnx2x_dma_free(&sc->sp_dma);
+		sc->sp = NULL;
 
-	/***************/
-	/* EVENT QUEUE */
-	/***************/
+		/***************/
+		/* EVENT QUEUE */
+		/***************/
 
-	bnx2x_dma_free(&sc->eq_dma);
-	sc->eq = NULL;
+		bnx2x_dma_free(&sc->eq_dma);
+		sc->eq = NULL;
 
-	/************************/
-	/* DEFAULT STATUS BLOCK */
-	/************************/
-
-	bnx2x_dma_free(&sc->def_sb_dma);
-	sc->def_sb = NULL;
+		/************************/
+		/* DEFAULT STATUS BLOCK */
+		/************************/
 
+		bnx2x_dma_free(&sc->def_sb_dma);
+		sc->def_sb = NULL;
+	}
 }
 
-- 
2.20.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2019-08-28 14:32:32.264882681 +0100
+++ 0009-net-bnx2x-fix-fastpath-SB-allocation-for-SRIOV.patch	2019-08-28 14:32:31.615957940 +0100
@@ -1 +1 @@
-From 0cdbc98f6ed48b769ed5b22a61c38fbe3c90538a Mon Sep 17 00:00:00 2001
+From ae110478a3face082f270c58d430676064763ff2 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 0cdbc98f6ed48b769ed5b22a61c38fbe3c90538a ]
+
@@ -14 +15,0 @@
-Cc: stable at dpdk.org
@@ -22 +23 @@
-index 877f5b73d..1a088269f 100644
+index 4ac5ea8d8..3b034b1e9 100644


More information about the stable mailing list