[dpdk-stable] patch 'net/bnxt: fix TQM ring context memory size' has been queued to stable release 19.11.3

luca.boccassi at gmail.com luca.boccassi at gmail.com
Tue May 19 15:05:29 CEST 2020


Hi,

FYI, your patch has been queued to stable release 19.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 05/21/20. 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.

Thanks.

Luca Boccassi

---
>From abe65fce866a24fb36ccd2da847be7258b48370a Mon Sep 17 00:00:00 2001
From: Kalesh AP <kalesh-anakkur.purayil at broadcom.com>
Date: Wed, 6 May 2020 11:57:10 +0530
Subject: [PATCH] net/bnxt: fix TQM ring context memory size

[ upstream commit 2f8cc21f0943e1fde68b38e09f9bf238d0eb7811 ]

The current formulas to calculate the TQM slow path and fast path ring
context memory sizes are not quite correct. TQM slow path entry is
array index 0 of ctx->tqm_mem[]. The other array entries are for fast
path. Fix these sizes according to firmware spec. for 57500 and newer
chips.

Fixes: cc5e26b8ef98 ("net/bnxt: increase TQM entry allocation")

Signed-off-by: Kalesh AP <kalesh-anakkur.purayil at broadcom.com>
Reviewed-by: Somnath Kotur <somnath.kotur at broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde at broadcom.com>
---
 drivers/net/bnxt/bnxt_ethdev.c | 16 +++++++++++-----
 1 file changed, 11 insertions(+), 5 deletions(-)

diff --git a/drivers/net/bnxt/bnxt_ethdev.c b/drivers/net/bnxt/bnxt_ethdev.c
index 7a9c557b52..fe134108b6 100644
--- a/drivers/net/bnxt/bnxt_ethdev.c
+++ b/drivers/net/bnxt/bnxt_ethdev.c
@@ -4429,6 +4429,7 @@ int bnxt_alloc_ctx_mem(struct bnxt *bp)
 	struct bnxt_ctx_pg_info *ctx_pg;
 	struct bnxt_ctx_mem_info *ctx;
 	uint32_t mem_size, ena, entries;
+	uint32_t entries_sp, min;
 	int i, rc;
 
 	rc = bnxt_hwrm_func_backing_store_qcaps(bp);
@@ -4476,15 +4477,20 @@ int bnxt_alloc_ctx_mem(struct bnxt *bp)
 	if (rc)
 		return rc;
 
-	entries = ctx->qp_max_l2_entries +
-		  ctx->vnic_max_vnic_entries +
-		  ctx->tqm_min_entries_per_ring;
+	min = ctx->tqm_min_entries_per_ring;
+
+	entries_sp = ctx->qp_max_l2_entries +
+		     ctx->vnic_max_vnic_entries +
+		     2 * ctx->qp_min_qp1_entries + min;
+	entries_sp = bnxt_roundup(entries_sp, ctx->tqm_entries_multiple);
+
+	entries = ctx->qp_max_l2_entries + ctx->qp_min_qp1_entries;
 	entries = bnxt_roundup(entries, ctx->tqm_entries_multiple);
-	entries = clamp_t(uint32_t, entries, ctx->tqm_min_entries_per_ring,
+	entries = clamp_t(uint32_t, entries, min,
 			  ctx->tqm_max_entries_per_ring);
 	for (i = 0, ena = 0; i < ctx->tqm_fp_rings_count + 1; i++) {
 		ctx_pg = ctx->tqm_mem[i];
-		ctx_pg->entries = entries;
+		ctx_pg->entries = i ? entries : entries_sp;
 		mem_size = ctx->tqm_entry_size * ctx_pg->entries;
 		rc = bnxt_alloc_ctx_mem_blk(bp, ctx_pg, mem_size, "tqm_mem", i);
 		if (rc)
-- 
2.20.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2020-05-19 14:04:52.494717622 +0100
+++ 0194-net-bnxt-fix-TQM-ring-context-memory-size.patch	2020-05-19 14:04:44.552654463 +0100
@@ -1,8 +1,10 @@
-From 2f8cc21f0943e1fde68b38e09f9bf238d0eb7811 Mon Sep 17 00:00:00 2001
+From abe65fce866a24fb36ccd2da847be7258b48370a Mon Sep 17 00:00:00 2001
 From: Kalesh AP <kalesh-anakkur.purayil at broadcom.com>
 Date: Wed, 6 May 2020 11:57:10 +0530
 Subject: [PATCH] net/bnxt: fix TQM ring context memory size
 
+[ upstream commit 2f8cc21f0943e1fde68b38e09f9bf238d0eb7811 ]
+
 The current formulas to calculate the TQM slow path and fast path ring
 context memory sizes are not quite correct. TQM slow path entry is
 array index 0 of ctx->tqm_mem[]. The other array entries are for fast
@@ -10,7 +12,6 @@
 chips.
 
 Fixes: cc5e26b8ef98 ("net/bnxt: increase TQM entry allocation")
-Cc: stable at dpdk.org
 
 Signed-off-by: Kalesh AP <kalesh-anakkur.purayil at broadcom.com>
 Reviewed-by: Somnath Kotur <somnath.kotur at broadcom.com>
@@ -20,10 +21,10 @@
  1 file changed, 11 insertions(+), 5 deletions(-)
 
 diff --git a/drivers/net/bnxt/bnxt_ethdev.c b/drivers/net/bnxt/bnxt_ethdev.c
-index d877ff655d..dab291c7ce 100644
+index 7a9c557b52..fe134108b6 100644
 --- a/drivers/net/bnxt/bnxt_ethdev.c
 +++ b/drivers/net/bnxt/bnxt_ethdev.c
-@@ -4672,6 +4672,7 @@ int bnxt_alloc_ctx_mem(struct bnxt *bp)
+@@ -4429,6 +4429,7 @@ int bnxt_alloc_ctx_mem(struct bnxt *bp)
  	struct bnxt_ctx_pg_info *ctx_pg;
  	struct bnxt_ctx_mem_info *ctx;
  	uint32_t mem_size, ena, entries;
@@ -31,7 +32,7 @@
  	int i, rc;
  
  	rc = bnxt_hwrm_func_backing_store_qcaps(bp);
-@@ -4719,15 +4720,20 @@ int bnxt_alloc_ctx_mem(struct bnxt *bp)
+@@ -4476,15 +4477,20 @@ int bnxt_alloc_ctx_mem(struct bnxt *bp)
  	if (rc)
  		return rc;
  


More information about the stable mailing list