From: Prashant Gupta <prashant.gupta_3@nxp.com>
To: dev@dpdk.org, stephen@networkplumber.org, david.marchand@redhat.com
Cc: Hemant Agrawal <hemant.agrawal@nxp.com>
Subject: [PATCH 12/15] net/dpaa2: add devargs to drop parse packets in HW
Date: Tue, 14 Oct 2025 12:10:32 +0530 [thread overview]
Message-ID: <20251014064035.1312896-13-prashant.gupta_3@nxp.com> (raw)
In-Reply-To: <20251014064035.1312896-1-prashant.gupta_3@nxp.com>
From: Hemant Agrawal <hemant.agrawal@nxp.com>
This patch add support to allow to drop HW parser error
pkts in DPAA2 hardware
Signed-off-by: Hemant Agrawal <hemant.agrawal@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
next prev parent reply other threads:[~2025-10-14 7:23 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-10-14 6:40 [PATCH 00/15] dpaa2: Fixes and enhancements for DPMAC, stats, and parser Prashant Gupta
2025-10-14 6:40 ` [PATCH 01/15] net/dpaa2: fix uninitialized variable issue Prashant Gupta
2025-10-14 6:40 ` [PATCH 02/15] net/dpaa2: fix to free buffers from error queue Prashant Gupta
2025-10-14 6:40 ` [PATCH 03/15] net/dpaa2: fix L3/L4 csum results in packet parse Prashant Gupta
2025-10-14 6:40 ` [PATCH 04/15] net/dpaa2: fix to recv packets with additional parse errors Prashant Gupta
2025-10-14 6:40 ` [PATCH 05/15] net/dpaa2: fix error frame dump issue Prashant Gupta
2025-10-14 6:40 ` [PATCH 06/15] net/dpaa2: fix flow rule's resizing issue Prashant Gupta
2025-10-14 6:40 ` [PATCH 07/15] net/dpaa2: add dpmac MC header file Prashant Gupta
2025-10-14 6:40 ` [PATCH 08/15] net/dpaa2: support dpmac counters in stats Prashant Gupta
2025-10-14 6:40 ` [PATCH 09/15] net/dpaa2: setup the speed cap based on the actual MAC Prashant Gupta
2025-10-14 6:40 ` [PATCH 10/15] drivers: dpaa2 upgrade fslmc base FW to 10.39.0 Prashant Gupta
2025-10-14 6:40 ` [PATCH 11/15] net/dpaa2: replace global variable to driver flag Prashant Gupta
2025-10-14 6:40 ` Prashant Gupta [this message]
2025-10-14 6:40 ` [PATCH 13/15] net/dpaa2: optimize to prefetch next parser result Prashant Gupta
2025-10-14 6:40 ` [PATCH 14/15] net/dpaa2: add eCPRI header and message dump Prashant Gupta
2025-10-14 6:40 ` [PATCH 15/15] net/dpaa2: add Policer stats for each TC Prashant Gupta
-- strict thread matches above, loose matches on Subject: below --
2025-10-14 6:00 [PATCH 00/15] dpaa2: Fixes and enhancements for DPMAC, stats, and parser Prashant Gupta
2025-10-14 6:00 ` [PATCH 12/15] net/dpaa2: add devargs to drop parse packets in HW Prashant Gupta
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=20251014064035.1312896-13-prashant.gupta_3@nxp.com \
--to=prashant.gupta_3@nxp.com \
--cc=david.marchand@redhat.com \
--cc=dev@dpdk.org \
--cc=hemant.agrawal@nxp.com \
--cc=stephen@networkplumber.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).