Skip to content

Commit

Permalink
net/bnxt: fix Rx buffer posting
Browse files Browse the repository at this point in the history
[ upstream commit bb4f70d ]

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.

Fixes: 637e34b ("net/bnxt: optimize Rx processing")
Fixes: 0406784 ("net/bnxt: reduce CQ queue size without aggregation ring")

Signed-off-by: Lance Richardson <lance.richardson@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
  • Loading branch information
Lance Richardson authored and cpaelzer committed May 11, 2021
1 parent 85592e8 commit b3037f1
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 5 deletions.
3 changes: 0 additions & 3 deletions drivers/net/bnxt/bnxt_rxr.c
Expand Up @@ -654,9 +654,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 || 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_prod);
}

cpr->cp_raw_cons = raw_cons;
Expand Down
2 changes: 0 additions & 2 deletions drivers/net/bnxt/bnxt_rxr.h
Expand Up @@ -169,8 +169,6 @@ static inline uint16_t bnxt_tpa_start_agg_id(struct bnxt *bp,
((rxcmp1)->errors_v2 & \
rte_cpu_to_le_32(RX_PKT_CMPL_ERRORS_L4_CS_ERROR))

#define BNXT_RX_POST_THRESH 32

enum pkt_hash_types {
PKT_HASH_TYPE_NONE, /* Undefined type */
PKT_HASH_TYPE_L2, /* Input: src_MAC, dest_MAC */
Expand Down

0 comments on commit b3037f1

Please sign in to comment.