From: Kevin Traynor <ktraynor@redhat.com>
To: Ajit Khaparde <ajit.khaparde@broadcom.com>
Cc: Damodharam Ammepalli <damodharam.ammepalli@broadcom.com>,
Somnath Kotur <somnath.kotur@broadcom.com>,
dpdk stable <stable@dpdk.org>
Subject: patch 'net/bnxt: fix epoch bit calculation' has been queued to stable release 24.11.2
Date: Mon, 24 Mar 2025 16:16:09 +0000 [thread overview]
Message-ID: <20250324161731.63950-2-ktraynor@redhat.com> (raw)
In-Reply-To: <20250324161731.63950-1-ktraynor@redhat.com>
Hi,
FYI, your patch has been queued to stable release 24.11.2
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 03/28/25. 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
This queued commit can be viewed at:
https://github.com/kevintraynor/dpdk-stable/commit/4bbe513ff7134586ed9170c8ad1310db1b4218ff
Thanks.
Kevin
---
From 4bbe513ff7134586ed9170c8ad1310db1b4218ff Mon Sep 17 00:00:00 2001
From: Ajit Khaparde <ajit.khaparde@broadcom.com>
Date: Wed, 26 Feb 2025 14:01:24 -0800
Subject: [PATCH] net/bnxt: fix epoch bit calculation
[ upstream commit 12f77a5f69ee35cf8dae5801c1ed8d4ef2423f97 ]
The epoch bit is a binary value which needs to be toggled with
every pass of the ring in the hardware.
The code was doing this prematurely in vector path.
Improve the ring wrap identification and fix epoch bit calculation
in the vector path.
Fixes: 30656a1cace8 ("net/bnxt: refactor epoch setting")
Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Reviewed-by: Damodharam Ammepalli <damodharam.ammepalli@broadcom.com>
Reviewed-by: Somnath Kotur <somnath.kotur@broadcom.com>
---
drivers/net/bnxt/bnxt_ring.h | 19 +++++++++++++++++++
drivers/net/bnxt/bnxt_rxq.c | 1 +
drivers/net/bnxt/bnxt_rxq.h | 1 +
drivers/net/bnxt/bnxt_rxr.c | 4 ++++
drivers/net/bnxt/bnxt_rxtx_vec_common.h | 11 +++++------
5 files changed, 30 insertions(+), 6 deletions(-)
diff --git a/drivers/net/bnxt/bnxt_ring.h b/drivers/net/bnxt/bnxt_ring.h
index a7470a0e73..3e2bd634a8 100644
--- a/drivers/net/bnxt/bnxt_ring.h
+++ b/drivers/net/bnxt/bnxt_ring.h
@@ -109,4 +109,23 @@ static inline void bnxt_db_write(struct bnxt_db_info *db, uint32_t idx)
}
+static inline void bnxt_db_epoch_write(struct bnxt_db_info *db, uint32_t idx, uint32_t epoch)
+{
+ uint32_t db_idx = DB_RING_IDX(db, idx);
+ void *doorbell = db->doorbell;
+
+ if (db->db_64) {
+ uint64_t key_idx = db->db_key64 | db_idx;
+
+ key_idx |= epoch << DBR_EPOCH_SFT;
+
+ rte_compiler_barrier();
+ rte_write64_relaxed(key_idx, doorbell);
+ } else {
+ uint32_t key_idx = db->db_key32 | db_idx;
+
+ rte_write32(key_idx, doorbell);
+ }
+}
+
static inline void bnxt_db_mpc_write(struct bnxt_db_info *db, uint32_t idx, uint32_t epoch)
{
diff --git a/drivers/net/bnxt/bnxt_rxq.c b/drivers/net/bnxt/bnxt_rxq.c
index a1c3777f33..91b3555df6 100644
--- a/drivers/net/bnxt/bnxt_rxq.c
+++ b/drivers/net/bnxt/bnxt_rxq.c
@@ -426,4 +426,5 @@ int bnxt_rx_queue_setup_op(struct rte_eth_dev *eth_dev,
}
rxq->rx_mbuf_alloc_fail = 0;
+ rxq->epoch = 0;
/* rxq 0 must not be stopped when used as async CPR */
diff --git a/drivers/net/bnxt/bnxt_rxq.h b/drivers/net/bnxt/bnxt_rxq.h
index 0b411a941a..2e4dd20a1a 100644
--- a/drivers/net/bnxt/bnxt_rxq.h
+++ b/drivers/net/bnxt/bnxt_rxq.h
@@ -30,4 +30,5 @@ struct bnxt_rx_queue {
uint16_t rxrearm_start; /* next desc index to reinit. */
#endif
+ uint32_t epoch;
uint16_t port_id; /* Device port identifier */
uint8_t crc_len; /* 0 if CRC stripped, 4 otherwise */
diff --git a/drivers/net/bnxt/bnxt_rxr.c b/drivers/net/bnxt/bnxt_rxr.c
index b53d9a917a..c94abefa01 100644
--- a/drivers/net/bnxt/bnxt_rxr.c
+++ b/drivers/net/bnxt/bnxt_rxr.c
@@ -1367,4 +1367,8 @@ uint16_t bnxt_recv_pkts(void *rx_queue, struct rte_mbuf **rx_pkts,
rxq->rxrearm_start++;
rxq->rxrearm_nb--;
+ if (rxq->rxrearm_start >= rxq->nb_rx_desc) {
+ rxq->rxrearm_start = 0;
+ rxq->epoch = rxq->epoch == 0 ? 1 : 0;
+ }
} else {
/* Retry allocation on next call. */
diff --git a/drivers/net/bnxt/bnxt_rxtx_vec_common.h b/drivers/net/bnxt/bnxt_rxtx_vec_common.h
index f608b5152e..e185005293 100644
--- a/drivers/net/bnxt/bnxt_rxtx_vec_common.h
+++ b/drivers/net/bnxt/bnxt_rxtx_vec_common.h
@@ -51,4 +51,5 @@ bnxt_rxq_vec_setup_common(struct bnxt_rx_queue *rxq)
rxq->rxrearm_nb = 0;
rxq->rxrearm_start = 0;
+ rxq->epoch = 1;
return 0;
}
@@ -89,11 +90,9 @@ bnxt_rxq_rearm(struct bnxt_rx_queue *rxq, struct bnxt_rx_ring_info *rxr)
rxq->rxrearm_start += nb;
- /*
- * 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)
+ bnxt_db_epoch_write(&rxr->rx_db, rxq->rxrearm_start - 1, rxq->epoch);
+ if (rxq->rxrearm_start >= rxq->nb_rx_desc) {
rxq->rxrearm_start = 0;
+ rxq->epoch = rxq->epoch == 0 ? 1 : 0;
+ }
rxq->rxrearm_nb -= nb;
--
2.48.1
---
Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- - 2025-03-24 16:15:14.917836671 +0000
+++ 0002-net-bnxt-fix-epoch-bit-calculation.patch 2025-03-24 16:15:14.690735255 +0000
@@ -1 +1 @@
-From 12f77a5f69ee35cf8dae5801c1ed8d4ef2423f97 Mon Sep 17 00:00:00 2001
+From 4bbe513ff7134586ed9170c8ad1310db1b4218ff Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 12f77a5f69ee35cf8dae5801c1ed8d4ef2423f97 ]
+
@@ -13 +14,0 @@
-Cc: stable@dpdk.org
@@ -65 +66 @@
-index cd49faf4cf..3385496e70 100644
+index 0b411a941a..2e4dd20a1a 100644
@@ -68 +69 @@
-@@ -31,4 +31,5 @@ struct bnxt_rx_queue {
+@@ -30,4 +30,5 @@ struct bnxt_rx_queue {
next prev parent reply other threads:[~2025-03-24 16:17 UTC|newest]
Thread overview: 32+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-03-24 16:16 patch 'doc: fix year of final LTS release' " Kevin Traynor
2025-03-24 16:16 ` Kevin Traynor [this message]
2025-03-24 16:16 ` patch 'net/iavf: fix mbuf release in Arm multi-process' " Kevin Traynor
2025-03-24 16:16 ` patch 'net/ice: fix flow engines order' " Kevin Traynor
2025-03-24 16:16 ` patch 'net/ice: fix dropped packets when using VRRP' " Kevin Traynor
2025-03-24 16:16 ` patch 'net/iavf: check interrupt registration failure' " Kevin Traynor
2025-03-24 16:16 ` patch 'net/iavf: fix crash on app exit on FreeBSD' " Kevin Traynor
2025-03-24 16:16 ` patch 'net/mlx5: fix hairpin queue release' " Kevin Traynor
2025-03-24 16:16 ` patch 'net/mlx5: fix LACP packet handling in isolated mode' " Kevin Traynor
2025-03-24 16:16 ` patch 'net/mlx5/hws: fix crash using represented port without ID' " Kevin Traynor
2025-03-24 16:16 ` patch 'net/mlx5: fix non-template set VLAN VID' " Kevin Traynor
2025-03-24 16:16 ` patch 'net/mlx5: fix error info in actions construct' " Kevin Traynor
2025-03-24 16:16 ` patch 'net/mlx5/hws: fix GTP flags matching' " Kevin Traynor
2025-03-24 16:16 ` patch 'net/mlx5: fix non-template flow validation' " Kevin Traynor
2025-03-24 16:16 ` patch 'net/mlx5: fix non-template flow validation on create' " Kevin Traynor
2025-03-24 16:16 ` patch 'net/mlx5: fix flow group ID for action translation' " Kevin Traynor
2025-03-24 16:16 ` patch 'net/mlx5: fix flow matching GENEVE options' " Kevin Traynor
2025-03-24 16:16 ` patch 'net/mlx5: fix IPIP tunnel verification' " Kevin Traynor
2025-03-24 16:16 ` patch 'net/mlx5: fix mark action validation in FDB mode' " Kevin Traynor
2025-03-24 16:16 ` patch 'net/mlx5: fix NAT64 register selection' " Kevin Traynor
2025-03-24 16:16 ` patch 'net/mlx5: fix GRE matching on root table' " Kevin Traynor
2025-03-24 16:16 ` patch 'common/mlx5: add device duplication function' " Kevin Traynor
2025-03-24 16:16 ` patch 'net/mlx5: fix GENEVE parser cleanup' " Kevin Traynor
2025-03-24 16:16 ` patch 'baseband/acc: fix queue setup failure clean up' " Kevin Traynor
2025-03-24 16:16 ` patch 'common/qat: fix devargs parsing' " Kevin Traynor
2025-03-24 16:16 ` patch 'dts: fix smoke tests docstring' " Kevin Traynor
2025-03-24 16:16 ` patch 'pdump: clear statistics when enabled' " Kevin Traynor
2025-03-24 16:16 ` patch 'examples/flow_filtering: fix IPv4 matching snippet' " Kevin Traynor
2025-03-24 16:16 ` patch 'examples/ipsec-secgw: fix cryptodev and eventdev IDs' " Kevin Traynor
2025-03-24 16:16 ` patch 'doc: add no-IOMMU mode in devbind tool guide' " Kevin Traynor
2025-03-24 16:16 ` patch 'eal: fix undetected NUMA nodes' " Kevin Traynor
2025-03-24 16:16 ` patch 'net/ixgbe: add checks for E610 VF' " Kevin Traynor
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250324161731.63950-2-ktraynor@redhat.com \
--to=ktraynor@redhat.com \
--cc=ajit.khaparde@broadcom.com \
--cc=damodharam.ammepalli@broadcom.com \
--cc=somnath.kotur@broadcom.com \
--cc=stable@dpdk.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).