patches for DPDK stable branches
 help / color / mirror / Atom feed
* [PATCH 1/3] net/bnxt: fix vector mode for P7 devices
       [not found] <20240606233116.38445-1-ajit.khaparde@broadcom.com>
@ 2024-06-06 23:31 ` Ajit Khaparde
  2024-06-06 23:31 ` [PATCH 2/3] net/bnxt: refactor backing store qcaps v2 Ajit Khaparde
  2024-06-06 23:31 ` [PATCH 3/3] net/bnxt: fix backing store logging Ajit Khaparde
  2 siblings, 0 replies; 3+ messages in thread
From: Ajit Khaparde @ 2024-06-06 23:31 UTC (permalink / raw)
  To: dev; +Cc: stable

[-- Attachment #1: Type: text/plain, Size: 1617 bytes --]

Fix vector code to update the producer index correctly especially
for P7 devices where the code needs to handle epoch bit indication
correctly to the hardware.

Fixes: 30656a1cace8 ("net/bnxt: refactor epoch setting")
Cc: stable@dpdk.org

Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
---
 drivers/net/bnxt/bnxt_ring.h            | 3 ++-
 drivers/net/bnxt/bnxt_rxtx_vec_common.h | 6 +++++-
 2 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/drivers/net/bnxt/bnxt_ring.h b/drivers/net/bnxt/bnxt_ring.h
index 1bae4b33d9..b33fb75284 100644
--- a/drivers/net/bnxt/bnxt_ring.h
+++ b/drivers/net/bnxt/bnxt_ring.h
@@ -89,7 +89,8 @@ static inline void bnxt_db_write(struct bnxt_db_info *db, uint32_t idx)
 	if (db->db_64) {
 		uint64_t key_idx = db->db_key64 | db_idx;
 
-		rte_write64(key_idx, doorbell);
+		rte_compiler_barrier();
+		rte_write64_relaxed(key_idx, doorbell);
 	} else {
 		uint32_t key_idx = db->db_key32 | db_idx;
 
diff --git a/drivers/net/bnxt/bnxt_rxtx_vec_common.h b/drivers/net/bnxt/bnxt_rxtx_vec_common.h
index 2294f0aa3c..f608b5152e 100644
--- a/drivers/net/bnxt/bnxt_rxtx_vec_common.h
+++ b/drivers/net/bnxt/bnxt_rxtx_vec_common.h
@@ -88,7 +88,11 @@ bnxt_rxq_rearm(struct bnxt_rx_queue *rxq, struct bnxt_rx_ring_info *rxr)
 	}
 
 	rxq->rxrearm_start += nb;
-	bnxt_db_write(&rxr->rx_db, rxq->rxrearm_start - 1);
+	/*
+	 * We can pass rxq->rxrearm_star - 1 as well, but then the epoch
+	 * bit calculation is messed up.
+	 */
+	bnxt_db_write(&rxr->rx_db, rxr->rx_raw_prod);
 	if (rxq->rxrearm_start >= rxq->nb_rx_desc)
 		rxq->rxrearm_start = 0;
 
-- 
2.39.2 (Apple Git-143)


[-- Attachment #2: S/MIME Cryptographic Signature --]
[-- Type: application/pkcs7-signature, Size: 4218 bytes --]

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

* [PATCH 2/3] net/bnxt: refactor backing store qcaps v2
       [not found] <20240606233116.38445-1-ajit.khaparde@broadcom.com>
  2024-06-06 23:31 ` [PATCH 1/3] net/bnxt: fix vector mode for P7 devices Ajit Khaparde
@ 2024-06-06 23:31 ` Ajit Khaparde
  2024-06-06 23:31 ` [PATCH 3/3] net/bnxt: fix backing store logging Ajit Khaparde
  2 siblings, 0 replies; 3+ messages in thread
From: Ajit Khaparde @ 2024-06-06 23:31 UTC (permalink / raw)
  To: dev; +Cc: Damodharam Ammepalli, stable

[-- Attachment #1: Type: text/plain, Size: 2264 bytes --]

From: Damodharam Ammepalli <damodharam.ammepalli@broadcom.com>

During bnxt_hwrm_func_backing_store_types_count driver
increments types only for valid type but not in
bnxt_hwrm_func_backing_store_cfg_v2. Implement the same
logic in store cfg also to prevent ctx types control loop
exiting the loop prematurely while firmware still has valid
types to return if queried.

Fixes: fe2f715ca580 ("net/bnxt: support backing store v2")
Cc: stable@dpdk.org

Signed-off-by: Damodharam Ammepalli <damodharam.ammepalli@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
---
 drivers/net/bnxt/bnxt_hwrm.c | 16 ++++++++++++----
 1 file changed, 12 insertions(+), 4 deletions(-)

diff --git a/drivers/net/bnxt/bnxt_hwrm.c b/drivers/net/bnxt/bnxt_hwrm.c
index 6ea7089a3f..9ea5cc090f 100644
--- a/drivers/net/bnxt/bnxt_hwrm.c
+++ b/drivers/net/bnxt/bnxt_hwrm.c
@@ -6352,11 +6352,14 @@ int bnxt_hwrm_func_backing_store_qcaps_v2(struct bnxt *bp)
 	uint16_t types, type;
 	int rc;
 
-	for (types = 0, type = 0; types < bp->ctx->types && type != BNXT_CTX_INV; types++) {
-		struct bnxt_ctx_mem *ctxm = &bp->ctx->ctx_arr[types];
+	types = 0;
+	type = 0;
+	do {
+		struct bnxt_ctx_mem *ctxm;
 		uint8_t init_val, init_off, i;
 		uint32_t *p;
 		uint32_t flags;
+		bool cnt = true;
 
 		HWRM_PREP(&req, HWRM_FUNC_BACKING_STORE_QCAPS_V2, BNXT_USE_CHIMP_MB);
 		req.type = rte_cpu_to_le_16(type);
@@ -6365,9 +6368,12 @@ int bnxt_hwrm_func_backing_store_qcaps_v2(struct bnxt *bp)
 
 		flags = rte_le_to_cpu_32(resp->flags);
 		type = rte_le_to_cpu_16(resp->next_valid_type);
-		if (!(flags & HWRM_FUNC_BACKING_STORE_QCAPS_V2_OUTPUT_FLAGS_TYPE_VALID))
+		if (!(flags & HWRM_FUNC_BACKING_STORE_QCAPS_V2_OUTPUT_FLAGS_TYPE_VALID)) {
+			cnt = false;
 			goto next;
+		}
 
+		ctxm = &bp->ctx->ctx_arr[types];
 		ctxm->type = rte_le_to_cpu_16(resp->type);
 
 		ctxm->flags = flags;
@@ -6404,8 +6410,10 @@ int bnxt_hwrm_func_backing_store_qcaps_v2(struct bnxt *bp)
 		last_valid_type = ctxm->type;
 		last_valid_idx = types;
 next:
+		if (cnt)
+			types++;
 		HWRM_UNLOCK();
-	}
+	} while (types < bp->ctx->types && type != BNXT_CTX_INV);
 	ctx->ctx_arr[last_valid_idx].last = true;
 	PMD_DRV_LOG(DEBUG, "Last valid type 0x%x\n", last_valid_type);
 
-- 
2.39.2 (Apple Git-143)


[-- Attachment #2: S/MIME Cryptographic Signature --]
[-- Type: application/pkcs7-signature, Size: 4218 bytes --]

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

* [PATCH 3/3] net/bnxt: fix backing store logging
       [not found] <20240606233116.38445-1-ajit.khaparde@broadcom.com>
  2024-06-06 23:31 ` [PATCH 1/3] net/bnxt: fix vector mode for P7 devices Ajit Khaparde
  2024-06-06 23:31 ` [PATCH 2/3] net/bnxt: refactor backing store qcaps v2 Ajit Khaparde
@ 2024-06-06 23:31 ` Ajit Khaparde
  2 siblings, 0 replies; 3+ messages in thread
From: Ajit Khaparde @ 2024-06-06 23:31 UTC (permalink / raw)
  To: dev; +Cc: stable, Damodharam Ammepalli

[-- Attachment #1: Type: text/plain, Size: 3249 bytes --]

Backing store type count can increase with newer firmware.
So a static bnxt_backing_store_types can cause unnecessary faults.
Instead of logging the string for the backing store type, just log
the value provided by the firmware.

Fixes: fe2f715ca580 ("net/bnxt: support backing store v2")
Cc: stable@dpdk.org

Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Reviewed-by: Damodharam Ammepalli <damodharam.ammepalli@broadcom.com>
---
 drivers/net/bnxt/bnxt_hwrm.c | 48 ++++--------------------------------
 1 file changed, 5 insertions(+), 43 deletions(-)

diff --git a/drivers/net/bnxt/bnxt_hwrm.c b/drivers/net/bnxt/bnxt_hwrm.c
index 9ea5cc090f..fc142672f6 100644
--- a/drivers/net/bnxt/bnxt_hwrm.c
+++ b/drivers/net/bnxt/bnxt_hwrm.c
@@ -31,43 +31,6 @@ struct bnxt_plcmodes_cfg {
 	uint16_t	hds_threshold;
 };
 
-const char *bnxt_backing_store_types[] = {
-	"Queue pair",
-	"Shared receive queue",
-	"Completion queue",
-	"Virtual NIC",
-	"Statistic context",
-	"Slow-path TQM ring",
-	"Fast-path TQM ring",
-	"Unused",
-	"Unused",
-	"Unused",
-	"Unused",
-	"Unused",
-	"Unused",
-	"Unused",
-	"MR and MAV Context",
-	"TIM",
-	"Unused",
-	"Unused",
-	"Unused",
-	"Tx key context",
-	"Rx key context",
-	"Mid-path TQM ring",
-	"SQ Doorbell shadow region",
-	"RQ Doorbell shadow region",
-	"SRQ Doorbell shadow region",
-	"CQ Doorbell shadow region",
-	"QUIC Tx key context",
-	"QUIC Rx key context",
-	"Invalid type",
-	"Invalid type",
-	"Invalid type",
-	"Invalid type",
-	"Invalid type",
-	"Invalid type"
-};
-
 const char *media_type[] = { "Unknown", "Twisted Pair",
 	"Direct Attached Copper", "Fiber"
 };
@@ -6402,8 +6365,8 @@ int bnxt_hwrm_func_backing_store_qcaps_v2(struct bnxt *bp)
 			ctxm->split[i] = rte_le_to_cpu_32(*p);
 
 		PMD_DRV_LOG(DEBUG,
-			    "type:%s size:%d multiple:%d max:%d min:%d split:%d init_val:%d init_off:%d init:%d bmap:0x%x\n",
-			    bnxt_backing_store_types[ctxm->type], ctxm->entry_size,
+			    "type:0x%x size:%d multiple:%d max:%d min:%d split:%d init_val:%d init_off:%d init:%d bmap:0x%x\n",
+			    ctxm->type, ctxm->entry_size,
 			    ctxm->entry_multiple, ctxm->max_entries, ctxm->min_entries,
 			    ctxm->split_entry_cnt, init_val, init_off,
 			    BNXT_CTX_INIT_VALID(flags), ctxm->instance_bmap);
@@ -6446,8 +6409,7 @@ int bnxt_hwrm_func_backing_store_types_count(struct bnxt *bp)
 		HWRM_UNLOCK();
 
 		if (flags & HWRM_FUNC_BACKING_STORE_QCAPS_V2_OUTPUT_FLAGS_TYPE_VALID) {
-			PMD_DRV_LOG(DEBUG, "Valid types 0x%x - %s\n",
-				    req.type, bnxt_backing_store_types[req.type]);
+			PMD_DRV_LOG(DEBUG, "Valid types 0x%x\n", req.type);
 			types++;
 		}
 	} while (type != HWRM_FUNC_BACKING_STORE_QCAPS_V2_OUTPUT_TYPE_INVALID);
@@ -6625,8 +6587,8 @@ int bnxt_hwrm_func_backing_store_cfg_v2(struct bnxt *bp,
 				      &req.page_size_pbl_level,
 				      &req.page_dir);
 		PMD_DRV_LOG(DEBUG,
-			    "Backing store config V2 type:%s last %d, instance %d, hw %d\n",
-			    bnxt_backing_store_types[req.type], ctxm->last, j, w);
+			    "Backing store config V2 type:0x%x last %d, instance %d, hw %d\n",
+			    req.type, ctxm->last, j, w);
 		if (ctxm->last && i == (w - 1))
 			req.flags =
 			rte_cpu_to_le_32(BACKING_STORE_CFG_V2_IN_FLG_CFG_ALL_DONE);
-- 
2.39.2 (Apple Git-143)


[-- Attachment #2: S/MIME Cryptographic Signature --]
[-- Type: application/pkcs7-signature, Size: 4218 bytes --]

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

end of thread, other threads:[~2024-06-06 23:31 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <20240606233116.38445-1-ajit.khaparde@broadcom.com>
2024-06-06 23:31 ` [PATCH 1/3] net/bnxt: fix vector mode for P7 devices Ajit Khaparde
2024-06-06 23:31 ` [PATCH 2/3] net/bnxt: refactor backing store qcaps v2 Ajit Khaparde
2024-06-06 23:31 ` [PATCH 3/3] net/bnxt: fix backing store logging Ajit Khaparde

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