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