[PATCH v3 03/17] net/dpaa2: warn on Rx descriptor limit in high perf mode
Hemant Agrawal
hemant.agrawal at oss.nxp.com
Thu Mar 12 10:27:28 CET 2026
On 06-03-2026 19:00, Maxime Leroy wrote:
> The Rx descriptor count warning fires unconditionally when the total
> exceeds 11264, but this limit only applies when the DPNI is created
> with the high performance buffer option (0x80000000). When using normal
> buffers, there is no such limit and the warning is
> misleading noise.
>
> Check the DPNI options to only warn when the high performance buffer
> mode is active.
>
> Fixes: 35dc25d12792 ("net/dpaa2: warn on high Rx descriptor number")
> Cc: stable at dpdk.org
>
> Signed-off-by: Maxime Leroy <maxime at leroys.fr>
> Acked-by: Hemant Agrawal <hemant.agrawal at nxp.com>
> ---
> drivers/net/dpaa2/dpaa2_ethdev.c | 18 +++++++++++-------
> drivers/net/dpaa2/mc/fsl_dpni.h | 6 ++++++
> 2 files changed, 17 insertions(+), 7 deletions(-)
>
> diff --git a/drivers/net/dpaa2/dpaa2_ethdev.c b/drivers/net/dpaa2/dpaa2_ethdev.c
> index eb8333458e..61dcfafff6 100644
> --- a/drivers/net/dpaa2/dpaa2_ethdev.c
> +++ b/drivers/net/dpaa2/dpaa2_ethdev.c
> @@ -74,8 +74,9 @@ int dpaa2_timestamp_dynfield_offset = -1;
>
> bool dpaa2_print_parser_result;
>
> +/* Rx descriptor limit when DPNI uses high performance buffers */
> #define MAX_NB_RX_DESC 11264
> -int total_nb_rx_desc;
> +static int total_nb_rx_desc;
>
> int dpaa2_valid_dev;
> struct rte_mempool *dpaa2_tx_sg_pool;
> @@ -904,11 +905,13 @@ 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",
> - MAX_NB_RX_DESC);
> - DPAA2_PMD_WARN("To use Normal buffers, run 'export DPNI_NORMAL_BUF=1' before running dynamic_dpl.sh script");
> + if (priv->options & DPNI_OPT_HIGH_PERF_BUFFER) {
> + 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",
> + MAX_NB_RX_DESC);
> + DPAA2_PMD_WARN("To use Normal buffers, run 'export DPNI_NORMAL_BUF=1' before running dynamic_dpl.sh script");
> + }
> }
>
how about not changing the calculation, but only the warning.
total_nb_rx_desc += nb_rx_desc;
if (total_nb_rx_desc > MAX_NB_RX_DESC_IN_PEB &&
(priv->options & DPNI_OPT_V1_PFDR_IN_PEB)) {
DPAA2_PMD_WARN("RX descriptor exceeds limit(%d) to load PFDR in
PEB",
MAX_NB_RX_DESC_IN_PEB);
DPAA2_PMD_WARN("Suggest removing 0x%08x from DPNI creating
options(0x%08x)",
DPNI_OPT_V1_PFDR_IN_PEB, priv->options);
DPAA2_PMD_WARN("Or reduce RX descriptor number(%d) per queue",
nb_rx_desc);
}
> if (!priv->bp_list || priv->bp_list->mp != mb_pool) {
> @@ -1213,7 +1216,8 @@ 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;
> + if (priv->options & DPNI_OPT_HIGH_PERF_BUFFER)
> + total_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/mc/fsl_dpni.h b/drivers/net/dpaa2/mc/fsl_dpni.h
> index fcc6d4726e..82d6830acc 100644
> --- a/drivers/net/dpaa2/mc/fsl_dpni.h
> +++ b/drivers/net/dpaa2/mc/fsl_dpni.h
> @@ -121,6 +121,12 @@ struct fsl_mc_io;
> * The stashing is enabled by default.
> */
> #define DPNI_OPT_STASHING_DIS 0x002000
> +/*
> + * High performance buffer mode.
> + * The total number of Rx descriptors is limited to 11264 in this mode.
> + * When not set, the DPNI uses normal buffers and has no such limit.
> + */
> +#define DPNI_OPT_HIGH_PERF_BUFFER 0x80000000
Or use: #define DPNI_OPT_V1_PFDR_IN_PEB
> /**
> * Software sequence maximum layout size
> */
More information about the dev
mailing list