patches for DPDK stable branches
 help / color / mirror / Atom feed
* [dpdk-stable] [PATCH 1/1] net/bnxt: fix Rx buffer posting
@ 2021-03-18 19:52 Lance Richardson
  2021-03-19  3:50 ` Ajit Khaparde
  0 siblings, 1 reply; 2+ messages in thread
From: Lance Richardson @ 2021-03-18 19:52 UTC (permalink / raw)
  To: Ajit Khaparde, Somnath Kotur; +Cc: dev, stable

[-- Attachment #1: Type: text/plain, Size: 1941 bytes --]

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: 637e34befd9c ("net/bnxt: optimize Rx processing")
Fixes: 04067844a3e9 ("net/bnxt: reduce CQ queue size without aggregation ring")
Cc: stable@dpdk.org

Signed-off-by: Lance Richardson <lance.richardson@broadcom.com>
Reviewed-by: Ajit Kumar Khaparde <ajit.khaparde@broadcom.com>
---
 drivers/net/bnxt/bnxt_rxr.c | 3 ---
 drivers/net/bnxt/bnxt_rxr.h | 2 --
 2 files changed, 5 deletions(-)

diff --git a/drivers/net/bnxt/bnxt_rxr.c b/drivers/net/bnxt/bnxt_rxr.c
index c72545ada7..7179c6cb30 100644
--- a/drivers/net/bnxt/bnxt_rxr.c
+++ b/drivers/net/bnxt/bnxt_rxr.c
@@ -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;
diff --git a/drivers/net/bnxt/bnxt_rxr.h b/drivers/net/bnxt/bnxt_rxr.h
index a6fdd7767a..b43256e03e 100644
--- a/drivers/net/bnxt/bnxt_rxr.h
+++ b/drivers/net/bnxt/bnxt_rxr.h
@@ -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


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [dpdk-stable] [PATCH 1/1] net/bnxt: fix Rx buffer posting
  2021-03-18 19:52 [dpdk-stable] [PATCH 1/1] net/bnxt: fix Rx buffer posting Lance Richardson
@ 2021-03-19  3:50 ` Ajit Khaparde
  0 siblings, 0 replies; 2+ messages in thread
From: Ajit Khaparde @ 2021-03-19  3:50 UTC (permalink / raw)
  To: Lance Richardson; +Cc: Somnath Kotur, dpdk-dev, dpdk stable

[-- Attachment #1: Type: text/plain, Size: 2301 bytes --]

On Thu, Mar 18, 2021 at 12:52 PM Lance Richardson
<lance.richardson@broadcom.com> wrote:
>
> 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: 637e34befd9c ("net/bnxt: optimize Rx processing")
> Fixes: 04067844a3e9 ("net/bnxt: reduce CQ queue size without aggregation ring")
> Cc: stable@dpdk.org
>
> Signed-off-by: Lance Richardson <lance.richardson@broadcom.com>
> Reviewed-by: Ajit Kumar Khaparde <ajit.khaparde@broadcom.com>
Patch applied to dpdk-next-net-brcm.

> ---
>  drivers/net/bnxt/bnxt_rxr.c | 3 ---
>  drivers/net/bnxt/bnxt_rxr.h | 2 --
>  2 files changed, 5 deletions(-)
>
> diff --git a/drivers/net/bnxt/bnxt_rxr.c b/drivers/net/bnxt/bnxt_rxr.c
> index c72545ada7..7179c6cb30 100644
> --- a/drivers/net/bnxt/bnxt_rxr.c
> +++ b/drivers/net/bnxt/bnxt_rxr.c
> @@ -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;
> diff --git a/drivers/net/bnxt/bnxt_rxr.h b/drivers/net/bnxt/bnxt_rxr.h
> index a6fdd7767a..b43256e03e 100644
> --- a/drivers/net/bnxt/bnxt_rxr.h
> +++ b/drivers/net/bnxt/bnxt_rxr.h
> @@ -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
>

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-03-19  3:51 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-18 19:52 [dpdk-stable] [PATCH 1/1] net/bnxt: fix Rx buffer posting Lance Richardson
2021-03-19  3:50 ` Ajit Khaparde

patches for DPDK stable branches

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://inbox.dpdk.org/stable/0 stable/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 stable stable/ https://inbox.dpdk.org/stable \
		stable@dpdk.org
	public-inbox-index stable

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://inbox.dpdk.org/inbox.dpdk.stable


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git