From: Ajit Khaparde <ajit.khaparde@broadcom.com>
To: dev@dpdk.org
Cc: stable@dpdk.org
Subject: [PATCH 1/3] net/bnxt: fix vector mode for P7 devices
Date: Thu, 6 Jun 2024 16:31:14 -0700 [thread overview]
Message-ID: <20240606233116.38445-2-ajit.khaparde@broadcom.com> (raw)
In-Reply-To: <20240606233116.38445-1-ajit.khaparde@broadcom.com>
[-- 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 --]
next parent reply other threads:[~2024-06-06 23:31 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20240606233116.38445-1-ajit.khaparde@broadcom.com>
2024-06-06 23:31 ` Ajit Khaparde [this message]
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
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=20240606233116.38445-2-ajit.khaparde@broadcom.com \
--to=ajit.khaparde@broadcom.com \
--cc=dev@dpdk.org \
--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).