net/bnxt: fix Rx buffer posting
PATCH 1/1 net/bnxt: fix Rx buffer posting
Remove early buffer posting logic from burst receive loop to address several issues:
- Posting receive descriptors without first posting completion entries risks overflowing the completion queue.
- Posting receive descriptors without updating rx_raw_prod creates the possibility that the receive descriptor doorbell can be written twice with the same value.
- Having this logic in the inner descriptor processing loop can impact performance.
--- drivers/net/bnxt/bnxt_rxr.c | 3 --- drivers/net/bnxt/bnxt_rxr.h | 2 -- 2 files changed, 5 deletions(-)
drivers/net/bnxt/bnxt_rxr.c +0 -3
@@ -1018,9 +1018,6 @@ uint16_t bnxt_recv_pkts(void *rx_queue, struct rte_mbuf **rx_pkts, raw_cons =NEXT_RAW_CMP (raw_cons);if (nb_rx_pkts == nb_pkts || nb_rep_rx_pkts == nb_pkts || evt)break ; -/* Post some Rx buf early in case of larger burst processing */ -if (nb_rx_pkts ==BNXT_RX_POST_THRESH ) -bnxt_db_write (&rxr->rx_db, rxr->rx_raw_prod); } cpr->cp_raw_cons = raw_cons;
drivers/net/bnxt/bnxt_rxr.h +0 -2
@@ -41,8 +41,6 @@ static inline uint16_t bnxt_tpa_start_agg_id(struct bnxt *bp, (((cmp)->agg_bufs_v1 &RX_PKT_CMPL_AGG_BUFS_MASK ) >> \RX_PKT_CMPL_AGG_BUFS_SFT ) -#define BNXT_RX_POST_THRESH 32 - /* Number of descriptors to process per inner loop in vector mode. */#define RTE_BNXT_DESCS_PER_LOOP 4U
Signature · 1 line
2.25.1
Quoted 11 lines · Lance Richardson
Remove early buffer posting logic from burst receive loop to address several issues:
- Posting receive descriptors without first posting completion entries risks overflowing the completion queue.
- Posting receive descriptors without updatingrx_raw_prodcreates the possibility that the receive descriptor doorbell can be written twice with the same value.
- Having this logic in the inner descriptor processing loop can impact performance.
Quoted 6 lines
Fixes 637e34befd9c ("net/bnxt: optimize Rx processing")Fixes 04067844a3e9 ("net/bnxt: reduce CQ queue size without aggregation ring")Signed-off-by Lance Richardson <[email protected]>Reviewed-by Ajit Kumar Khaparde <[email protected]>
Patch applied to dpdk-next-net-brcm.
Quoted 35 lines
--- drivers/net/bnxt/bnxt_rxr.c | 3 --- drivers/net/bnxt/bnxt_rxr.h | 2 -- 2 files changed, 5 deletions(-)drivers/net/bnxt/bnxt_rxr.c +0
-3@@ -1018,9 +1018,6 @@ uint16_t bnxt_recv_pkts(void *rx_queue, struct rte_mbuf **rx_pkts, raw_cons =NEXT_RAW_CMP (raw_cons);if (nb_rx_pkts == nb_pkts || nb_rep_rx_pkts == nb_pkts || evt)break ; -/* Post some Rx buf early in case of larger burst processing */ -if (nb_rx_pkts ==BNXT_RX_POST_THRESH ) -bnxt_db_write (&rxr->rx_db, rxr->rx_raw_prod); } cpr->cp_raw_cons = raw_cons;drivers/net/bnxt/bnxt_rxr.h +0
-3@@ -41,8 +41,6 @@ static inline uint16_t bnxt_tpa_start_agg_id(struct bnxt *bp, (((cmp)->agg_bufs_v1 &RX_PKT_CMPL_AGG_BUFS_MASK ) >> \RX_PKT_CMPL_AGG_BUFS_SFT ) -#define BNXT_RX_POST_THRESH 32 - /* Number of descriptors to process per inner loop in vector mode. */#define RTE_BNXT_DESCS_PER_LOOP 4U --2.25.1