[PATCH v2 12/15] net/dpaa2: add devargs to drop parse packets in HW
Prashant Gupta
prashant.gupta_3 at nxp.com
Thu Oct 16 12:28:02 CEST 2025
From: Hemant Agrawal <hemant.agrawal at nxp.com>
This patch add support to allow to drop HW parser error
pkts in DPAA2 hardware
Signed-off-by: Hemant Agrawal <hemant.agrawal at nxp.com>
---
doc/guides/nics/dpaa2.rst | 4 ++++
drivers/net/dpaa2/dpaa2_ethdev.c | 11 ++++++++++-
drivers/net/dpaa2/dpaa2_ethdev.h | 3 +++
3 files changed, 17 insertions(+), 1 deletion(-)
diff --git a/doc/guides/nics/dpaa2.rst b/doc/guides/nics/dpaa2.rst
index 94bf1907df..782220b4cd 100644
--- a/doc/guides/nics/dpaa2.rst
+++ b/doc/guides/nics/dpaa2.rst
@@ -482,6 +482,10 @@ for details.
In this mode tx conf queues need to be polled to free the buffers.
e.g. ``fslmc:dpni.1,drv_tx_conf=1``
+* Use dev arg option ``drv_rx_parse_drop=1`` to configure the system to start
+ dropping the error packets in hardware (parse errors).
+ e.g. ``fslmc:dpni.1,drv_rx_parse_drop=1``
+
* Use dev arg option ``drv_error_queue=1`` to enable Packets in Error queue.
DPAA2 hardware drops the error packet in hardware. This option enables the
hardware to not drop the error packet and let the driver dump the error
diff --git a/drivers/net/dpaa2/dpaa2_ethdev.c b/drivers/net/dpaa2/dpaa2_ethdev.c
index 56c23e4717..5b72243346 100644
--- a/drivers/net/dpaa2/dpaa2_ethdev.c
+++ b/drivers/net/dpaa2/dpaa2_ethdev.c
@@ -34,6 +34,7 @@
#define DRIVER_LOOPBACK_MODE "drv_loopback"
#define DRIVER_NO_PREFETCH_MODE "drv_no_prefetch"
#define DRIVER_TX_CONF "drv_tx_conf"
+#define DRIVER_RX_PARSE_ERR_DROP "drv_rx_parse_drop"
#define DRIVER_ERROR_QUEUE "drv_err_queue"
#define CHECK_INTERVAL 100 /* 100ms */
#define MAX_REPEAT_TIME 90 /* 9s (90 * 100ms) in total */
@@ -1349,7 +1350,8 @@ dpaa2_dev_start(struct rte_eth_dev *dev)
err_cfg.errors = DPNI_ERROR_L3CE | DPNI_ERROR_L4CE;
/* if packet with parse error are not to be dropped */
- err_cfg.errors |= DPNI_ERROR_PHE | DPNI_ERROR_BLE;
+ if (!(priv->flags & DPAA2_PARSE_ERR_DROP))
+ err_cfg.errors |= DPNI_ERROR_PHE | DPNI_ERROR_BLE;
err_cfg.error_action = DPNI_ERROR_ACTION_CONTINUE;
}
@@ -2909,6 +2911,12 @@ dpaa2_dev_init(struct rte_eth_dev *eth_dev)
DPAA2_PMD_INFO("Enable error queue");
}
+ /* Packets with parse error to be dropped in hw */
+ if (dpaa2_get_devargs(dev->devargs, DRIVER_RX_PARSE_ERR_DROP)) {
+ priv->flags |= DPAA2_PARSE_ERR_DROP;
+ DPAA2_PMD_INFO("Drop parse error packets in hw");
+ }
+
if (getenv("DPAA2_PRINT_RX_PARSER_RESULT"))
dpaa2_print_parser_result = 1;
@@ -3278,5 +3286,6 @@ RTE_PMD_REGISTER_PARAM_STRING(NET_DPAA2_PMD_DRIVER_NAME,
DRIVER_LOOPBACK_MODE "=<int> "
DRIVER_NO_PREFETCH_MODE "=<int>"
DRIVER_TX_CONF "=<int>"
+ DRIVER_RX_PARSE_ERR_DROP "=<int>"
DRIVER_ERROR_QUEUE "=<int>");
RTE_LOG_REGISTER_DEFAULT(dpaa2_logtype_pmd, NOTICE);
diff --git a/drivers/net/dpaa2/dpaa2_ethdev.h b/drivers/net/dpaa2/dpaa2_ethdev.h
index f4adb76bb6..b2ab3d539b 100644
--- a/drivers/net/dpaa2/dpaa2_ethdev.h
+++ b/drivers/net/dpaa2/dpaa2_ethdev.h
@@ -70,6 +70,9 @@
*/
#define DPAA2_TX_CGR_OFF RTE_BIT32(0)
+/* Drop packets with parsing error in hw */
+#define DPAA2_PARSE_ERR_DROP RTE_BIT32(1)
+
/* Disable RX tail drop, default is enable */
#define DPAA2_RX_TAILDROP_OFF RTE_BIT32(2)
--
2.43.0
More information about the dev
mailing list