DPDK patches and discussions
 help / color / mirror / Atom feed
From: Hemant Agrawal <hemant.agrawal@oss.nxp.com>
To: dev@dpdk.org
Subject: Re: [RFT 3/3] net/dpaa2: make total rx descriptors per device
Date: Thu, 16 Oct 2025 10:48:34 +0530	[thread overview]
Message-ID: <7f81d9f8-812d-4af7-a9bf-973f3d1ac148@oss.nxp.com> (raw)
In-Reply-To: <20251015230933.875860-4-stephen@networkplumber.org>

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


On 16-10-2025 04:37, Stephen Hemminger wrote:
> The limit on number of receive descriptors should be per-device.
> Discovered while looking at globally exported symbols.
>
> Fixes: 35dc25d12792 ("net/dpaa2: warn on high Rx descriptor number")
> Cc:rohit.raj@nxp.com
>
> Signed-off-by: Stephen Hemminger<stephen@networkplumber.org>
> ---
>   drivers/net/dpaa2/dpaa2_ethdev.c | 9 ++++-----
>   drivers/net/dpaa2/dpaa2_ethdev.h | 1 +
>   2 files changed, 5 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/net/dpaa2/dpaa2_ethdev.c b/drivers/net/dpaa2/dpaa2_ethdev.c
> index 41678ce09b..32edff0554 100644
> --- a/drivers/net/dpaa2/dpaa2_ethdev.c
> +++ b/drivers/net/dpaa2/dpaa2_ethdev.c
> @@ -79,7 +79,6 @@ bool dpaa2_enable_err_queue;
>   bool dpaa2_print_parser_result;
>   
>   #define MAX_NB_RX_DESC		11264
> -int total_nb_rx_desc;

NACK,  However, we can change it to static variable.

DPAA2 supports two methods for allocating the RX descriptors.

1. Fast memory - low-latency PEB memory - The size is limited, so we 
globally track the number of buffers across devices.

2. Normal memory - no limit as they are from DDR.

This variable help in tracking that overall rx descriptor across devices 
are not crossing the memory limit of MAX_NB_RX_DESC

>   
>   int dpaa2_valid_dev;
>   struct rte_mempool *dpaa2_tx_sg_pool;
> @@ -720,9 +719,9 @@ dpaa2_dev_rx_queue_setup(struct rte_eth_dev *dev,
>   	DPAA2_PMD_DEBUG("dev =%p, queue =%d, pool = %p, conf =%p",
>   			dev, rx_queue_id, mb_pool, rx_conf);
>   
> -	total_nb_rx_desc += nb_rx_desc;
> -	if (total_nb_rx_desc > MAX_NB_RX_DESC) {
> -		DPAA2_PMD_WARN("Total nb_rx_desc exceeds %d limit. Please use Normal buffers",
> +	priv->nb_rx_desc += nb_rx_desc;
> +	if (priv->nb_rx_desc > MAX_NB_RX_DESC) {
> +		DPAA2_PMD_WARN("Total nb_rx_desc exceeds %u limit. Please use Normal buffers",
>   			       MAX_NB_RX_DESC);
>   		DPAA2_PMD_WARN("To use Normal buffers, run 'export DPNI_NORMAL_BUF=1' before running dynamic_dpl.sh script");
>   	}
> @@ -1029,7 +1028,7 @@ dpaa2_dev_rx_queue_release(struct rte_eth_dev *dev, uint16_t rx_queue_id)
>   	memset(&cfg, 0, sizeof(struct dpni_queue));
>   	PMD_INIT_FUNC_TRACE();
>   
> -	total_nb_rx_desc -= dpaa2_q->nb_desc;
> +	priv->nb_rx_desc -= dpaa2_q->nb_desc;
>   
>   	if (dpaa2_q->cgid != DPAA2_INVALID_CGID) {
>   		options = DPNI_QUEUE_OPT_CLEAR_CGID;
> diff --git a/drivers/net/dpaa2/dpaa2_ethdev.h b/drivers/net/dpaa2/dpaa2_ethdev.h
> index ffc9ebadb8..aa3fcb9af0 100644
> --- a/drivers/net/dpaa2/dpaa2_ethdev.h
> +++ b/drivers/net/dpaa2/dpaa2_ethdev.h
> @@ -385,6 +385,7 @@ struct dpaa2_dev_priv {
>   	uint8_t num_tx_tc;
>   	uint16_t qos_entries;
>   	uint16_t fs_entries;
> +	uint16_t nb_rx_desc;
>   	uint8_t dist_queues;
>   	uint8_t num_channels;
>   	uint8_t en_ordered;

[-- Attachment #2: Type: text/html, Size: 3530 bytes --]

      reply	other threads:[~2025-10-16  5:18 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-10-15 23:07 [RFT 0/3] net/dpaa2: global symbol fixes Stephen Hemminger
2025-10-15 23:07 ` [RFT 1/3] net/dpaa2: remove unused frame array Stephen Hemminger
2025-10-16  5:19   ` Hemant Agrawal
2025-10-15 23:07 ` [RFT 2/3] net/dpaa2: make local array static Stephen Hemminger
2025-10-16  5:14   ` Hemant Agrawal
2025-10-15 23:07 ` [RFT 3/3] net/dpaa2: make total rx descriptors per device Stephen Hemminger
2025-10-16  5:18   ` Hemant Agrawal [this message]

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=7f81d9f8-812d-4af7-a9bf-973f3d1ac148@oss.nxp.com \
    --to=hemant.agrawal@oss.nxp.com \
    --cc=dev@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).