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")
Signed-off-by: Maxime Leroy <[email protected]>
---
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 b75b934b17..088a07eba5 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;
@@ -902,11 +903,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");
+ }
}
if (!priv->bp_list || priv->bp_list->mp != mb_pool) {
@@ -1211,7 +1214,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
/**
* Software sequence maximum layout size
*/
--
2.43.0