public inbox for dev@dpdk.org
 help / color / mirror / Atom feed
From: Maxime Leroy <maxime@leroys.fr>
To: dev@dpdk.org
Cc: hemant.agrawal@nxp.com, stephen@networkplumber.org,
	david.marchand@redhat.com, Maxime Leroy <maxime@leroys.fr>,
	stable@dpdk.org
Subject: [PATCH v2 12/17] net/dpaa2: fix burst mode info to report active burst function
Date: Thu, 26 Feb 2026 15:33:36 +0100	[thread overview]
Message-ID: <20260226143341.282188-13-maxime@leroys.fr> (raw)
In-Reply-To: <20260218160453.142311-1-maxime@leroys.fr>

The burst_mode_get functions were incorrectly listing configured
offload flags instead of reporting the active burst function, unlike
every other PMD (i40e, mlx5, ixgbe, hns3) which match on the burst
function pointer. On top of that, snprintf + break meant only the
first matching offload was ever shown.

Rewrite both functions to match on the actual rx_pkt_burst/tx_pkt_burst
function pointer, consistent with the rest of the codebase.

Not tested, found by code review.

Fixes: ddbc2b6658d0 ("net/dpaa2: add Tx/Rx burst mode info")
Cc: stable@dpdk.org

Reported-by: Stephen Hemminger <stephen@networkplumber.org>
Signed-off-by: Maxime Leroy <maxime@leroys.fr>
---
 drivers/net/dpaa2/dpaa2_ethdev.c | 76 +++++++++-----------------------
 1 file changed, 22 insertions(+), 54 deletions(-)

diff --git a/drivers/net/dpaa2/dpaa2_ethdev.c b/drivers/net/dpaa2/dpaa2_ethdev.c
index e58b93c564..3875164794 100644
--- a/drivers/net/dpaa2/dpaa2_ethdev.c
+++ b/drivers/net/dpaa2/dpaa2_ethdev.c
@@ -443,34 +443,18 @@ dpaa2_dev_rx_burst_mode_get(struct rte_eth_dev *dev,
 	__rte_unused uint16_t queue_id,
 	struct rte_eth_burst_mode *mode)
 {
-	struct rte_eth_conf *eth_conf = &dev->data->dev_conf;
-	int ret = -EINVAL;
-	unsigned int i;
-	const struct burst_info {
-		uint64_t flags;
-		const char *output;
-	} rx_offload_map[] = {
-			{RTE_ETH_RX_OFFLOAD_CHECKSUM, " Checksum,"},
-			{RTE_ETH_RX_OFFLOAD_SCTP_CKSUM, " SCTP csum,"},
-			{RTE_ETH_RX_OFFLOAD_OUTER_IPV4_CKSUM, " Outer IPV4 csum,"},
-			{RTE_ETH_RX_OFFLOAD_OUTER_UDP_CKSUM, " Outer UDP csum,"},
-			{RTE_ETH_RX_OFFLOAD_VLAN_STRIP, " VLAN strip,"},
-			{RTE_ETH_RX_OFFLOAD_VLAN_FILTER, " VLAN filter,"},
-			{RTE_ETH_RX_OFFLOAD_TIMESTAMP, " Timestamp,"},
-			{RTE_ETH_RX_OFFLOAD_RSS_HASH, " RSS,"},
-			{RTE_ETH_RX_OFFLOAD_SCATTER, " Scattered,"}
-	};
+	eth_rx_burst_t pkt_burst = dev->rx_pkt_burst;
+
+	if (pkt_burst == dpaa2_dev_prefetch_rx)
+		snprintf(mode->info, sizeof(mode->info), "%s", "Scalar Prefetch");
+	else if (pkt_burst == dpaa2_dev_rx)
+		snprintf(mode->info, sizeof(mode->info), "%s", "Scalar");
+	else if (pkt_burst == dpaa2_dev_loopback_rx)
+		snprintf(mode->info, sizeof(mode->info), "%s", "Loopback");
+	else
+		return -EINVAL;
 
-	/* Update Rx offload info */
-	for (i = 0; i < RTE_DIM(rx_offload_map); i++) {
-		if (eth_conf->rxmode.offloads & rx_offload_map[i].flags) {
-			snprintf(mode->info, sizeof(mode->info), "%s",
-				rx_offload_map[i].output);
-			ret = 0;
-			break;
-		}
-	}
-	return ret;
+	return 0;
 }
 
 static int
@@ -478,34 +462,18 @@ dpaa2_dev_tx_burst_mode_get(struct rte_eth_dev *dev,
 			__rte_unused uint16_t queue_id,
 			struct rte_eth_burst_mode *mode)
 {
-	struct rte_eth_conf *eth_conf = &dev->data->dev_conf;
-	int ret = -EINVAL;
-	unsigned int i;
-	const struct burst_info {
-		uint64_t flags;
-		const char *output;
-	} tx_offload_map[] = {
-			{RTE_ETH_TX_OFFLOAD_VLAN_INSERT, " VLAN Insert,"},
-			{RTE_ETH_TX_OFFLOAD_IPV4_CKSUM, " IPV4 csum,"},
-			{RTE_ETH_TX_OFFLOAD_UDP_CKSUM, " UDP csum,"},
-			{RTE_ETH_TX_OFFLOAD_TCP_CKSUM, " TCP csum,"},
-			{RTE_ETH_TX_OFFLOAD_SCTP_CKSUM, " SCTP csum,"},
-			{RTE_ETH_TX_OFFLOAD_OUTER_IPV4_CKSUM, " Outer IPV4 csum,"},
-			{RTE_ETH_TX_OFFLOAD_MT_LOCKFREE, " MT lockfree,"},
-			{RTE_ETH_TX_OFFLOAD_MBUF_FAST_FREE, " MBUF free disable,"},
-			{RTE_ETH_TX_OFFLOAD_MULTI_SEGS, " Scattered,"}
-	};
+	eth_tx_burst_t pkt_burst = dev->tx_pkt_burst;
+
+	if (pkt_burst == dpaa2_dev_tx)
+		snprintf(mode->info, sizeof(mode->info), "%s", "Scalar");
+	else if (pkt_burst == dpaa2_dev_tx_ordered)
+		snprintf(mode->info, sizeof(mode->info), "%s", "Ordered");
+	else if (pkt_burst == rte_eth_pkt_burst_dummy)
+		snprintf(mode->info, sizeof(mode->info), "%s", "Dummy");
+	else
+		return -EINVAL;
 
-	/* Update Tx offload info */
-	for (i = 0; i < RTE_DIM(tx_offload_map); i++) {
-		if (eth_conf->txmode.offloads & tx_offload_map[i].flags) {
-			snprintf(mode->info, sizeof(mode->info), "%s",
-				tx_offload_map[i].output);
-			ret = 0;
-			break;
-		}
-	}
-	return ret;
+	return 0;
 }
 
 static int
-- 
2.43.0


  parent reply	other threads:[~2026-02-26 14:35 UTC|newest]

Thread overview: 98+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-02-18 16:04 [PATCH 00/11] net/dpaa2: fixes and improvements Maxime Leroy
2026-02-18 16:04 ` [PATCH 01/11] net/dpaa2: fix queue block memory leak on port close Maxime Leroy
2026-02-18 16:04 ` [PATCH 02/11] net/dpaa2: fix rx error queue " Maxime Leroy
2026-02-19 10:56   ` Hemant Agrawal
2026-02-19 11:01     ` Hemant Agrawal
2026-02-18 16:04 ` [PATCH 03/11] net/dpaa2: warn on rx descriptor limit only in high perf buffer mode Maxime Leroy
2026-02-19 10:58   ` Hemant Agrawal
2026-02-18 16:04 ` [PATCH 04/11] net/dpaa2: fix rx error queue leak in alloc error path Maxime Leroy
2026-02-18 16:04 ` [PATCH 05/11] net/dpaa2: fix resource leak on softparser failure Maxime Leroy
2026-02-18 16:04 ` [PATCH 06/11] net/dpaa2: add devargs to disable Rx taildrop Maxime Leroy
2026-02-19 13:41   ` Hemant Agrawal
2026-02-18 16:04 ` [PATCH 07/11] net/dpaa2: replace data stashing getenv with devargs Maxime Leroy
2026-02-19 13:44   ` Hemant Agrawal
2026-02-18 16:04 ` [PATCH 08/11] net/dpaa2: fix link not up after port stop/start Maxime Leroy
2026-02-19 13:45   ` Hemant Agrawal
2026-02-18 16:04 ` [PATCH 09/11] net/dpaa2: use CHECK_INTERVAL macro in set_link_down Maxime Leroy
2026-02-19 13:46   ` Hemant Agrawal
2026-02-18 16:04 ` [PATCH 10/11] bus/fslmc: fix devargs not propagated on hotplug Maxime Leroy
2026-02-18 16:45   ` David Marchand
2026-02-19  9:05     ` Maxime Leroy
2026-02-19 16:52       ` David Marchand
2026-02-18 16:04 ` [PATCH 11/11] bus/fslmc: remove dead blocklist check in plug path Maxime Leroy
2026-02-18 17:01   ` David Marchand
2026-02-18 17:07 ` [PATCH 00/11] net/dpaa2: fixes and improvements Stephen Hemminger
2026-02-19  9:12   ` Maxime Leroy
2026-02-18 17:21 ` Stephen Hemminger
2026-02-26 14:33 ` [PATCH v2 00/17] " Maxime Leroy
2026-02-26 19:25   ` Stephen Hemminger
2026-03-05 16:55     ` David Marchand
2026-03-05 17:57       ` Stephen Hemminger
2026-03-06  8:09         ` Maxime Leroy
2026-03-06 13:30   ` [PATCH v3 " Maxime Leroy
2026-03-06 18:51     ` Stephen Hemminger
2026-03-09  9:45       ` Maxime Leroy
2026-03-09 10:29         ` Hemant Agrawal
2026-03-24  5:19           ` Hemant Agrawal
2026-03-25 20:45     ` [PATCH v4 " Maxime Leroy
2026-03-25 20:45       ` [PATCH v4 01/17] net/dpaa2: fix queue block memory leak on port close Maxime Leroy
2026-03-25 20:45       ` [PATCH v4 02/17] net/dpaa2: fix Rx error queue memory leaks Maxime Leroy
2026-03-25 20:45       ` [PATCH v4 03/17] net/dpaa2: warn on Rx descriptor limit in high perf mode Maxime Leroy
2026-03-25 20:45       ` [PATCH v4 04/17] net/dpaa2: fix resource leak on softparser failure Maxime Leroy
2026-03-25 20:45       ` [PATCH v4 05/17] net/dpaa2: fix link not up after port stop/start Maxime Leroy
2026-03-25 20:45       ` [PATCH v4 06/17] bus/fslmc: fix devargs not propagated on hotplug Maxime Leroy
2026-03-25 20:45       ` [PATCH v4 07/17] net/dpaa2: fix spurious VLAN insertion on non-VLAN packets Maxime Leroy
2026-03-25 20:45       ` [PATCH v4 08/17] net/dpaa2: fix error packet dump crash and memory leak Maxime Leroy
2026-03-25 20:45       ` [PATCH v4 09/17] net/dpaa2: fix L4 packet type in slow parse path Maxime Leroy
2026-03-25 20:45       ` [PATCH v4 10/17] net/dpaa2: fix L3/L4 checksum offload flags Maxime Leroy
2026-03-25 20:45       ` [PATCH v4 11/17] net/dpaa2: fix software taildrop buffer access Maxime Leroy
2026-03-25 20:45       ` [PATCH v4 12/17] net/dpaa2: fix burst mode info report Maxime Leroy
2026-03-25 20:45       ` [PATCH v4 13/17] net/dpaa2: add SG table walk upper bound in Rx path Maxime Leroy
2026-03-25 20:45       ` [PATCH v4 14/17] net/dpaa2: fix MAC stats DMA alloc per xstats call Maxime Leroy
2026-03-25 20:45       ` [PATCH v4 15/17] net/dpaa2: use check interval macro in link down path Maxime Leroy
2026-03-25 20:45       ` [PATCH v4 16/17] net/dpaa2: add devargs to disable Rx taildrop Maxime Leroy
2026-03-25 20:45       ` [PATCH v4 17/17] net/dpaa2: add devargs alternative for data stashing getenv Maxime Leroy
2026-03-26 22:42       ` [PATCH v4 00/17] net/dpaa2: fixes and improvements Stephen Hemminger
2026-03-06 13:30   ` [PATCH v3 01/17] net/dpaa2: fix queue block memory leak on port close Maxime Leroy
2026-03-06 13:30   ` [PATCH v3 02/17] net/dpaa2: fix Rx error queue memory leaks Maxime Leroy
2026-03-06 13:30   ` [PATCH v3 03/17] net/dpaa2: warn on Rx descriptor limit in high perf mode Maxime Leroy
2026-03-12  9:27     ` Hemant Agrawal
2026-03-18 15:17       ` Maxime Leroy
2026-03-06 13:30   ` [PATCH v3 04/17] net/dpaa2: fix resource leak on softparser failure Maxime Leroy
2026-03-06 13:30   ` [PATCH v3 05/17] net/dpaa2: fix link not up after port stop/start Maxime Leroy
2026-03-06 13:30   ` [PATCH v3 06/17] bus/fslmc: fix devargs not propagated on hotplug Maxime Leroy
2026-03-06 13:30   ` [PATCH v3 07/17] net/dpaa2: fix spurious VLAN insertion on non-VLAN packets Maxime Leroy
2026-03-06 13:30   ` [PATCH v3 08/17] net/dpaa2: fix error packet dump crash and memory leak Maxime Leroy
2026-03-06 13:30   ` [PATCH v3 09/17] net/dpaa2: fix L4 packet type in slow parse path Maxime Leroy
2026-03-06 13:30   ` [PATCH v3 10/17] net/dpaa2: fix L3/L4 checksum offload flags Maxime Leroy
2026-03-06 13:30   ` [PATCH v3 11/17] net/dpaa2: fix software taildrop buffer access Maxime Leroy
2026-03-06 13:30   ` [PATCH v3 12/17] net/dpaa2: fix burst mode info report Maxime Leroy
2026-03-06 13:30   ` [PATCH v3 13/17] net/dpaa2: add SG table walk upper bound in Rx path Maxime Leroy
2026-03-06 13:30   ` [PATCH v3 14/17] net/dpaa2: fix MAC stats DMA alloc per xstats call Maxime Leroy
2026-03-06 13:30   ` [PATCH v3 15/17] net/dpaa2: use check interval macro in link down path Maxime Leroy
2026-03-06 13:30   ` [PATCH v3 16/17] net/dpaa2: add devargs to disable Rx taildrop Maxime Leroy
2026-03-06 13:30   ` [PATCH v3 17/17] net/dpaa2: add devargs alternative for data stashing getenv Maxime Leroy
2026-03-06 17:48     ` Stephen Hemminger
2026-02-26 14:33 ` [PATCH v2 01/17] net/dpaa2: fix queue block memory leak on port close Maxime Leroy
2026-02-26 14:33 ` [PATCH v2 02/17] net/dpaa2: fix rx error queue memory leaks Maxime Leroy
2026-02-26 14:33 ` [PATCH v2 03/17] net/dpaa2: warn on rx descriptor limit only in high perf buffer mode Maxime Leroy
2026-02-26 19:24   ` Stephen Hemminger
2026-02-26 14:33 ` [PATCH v2 04/17] net/dpaa2: fix resource leak on softparser failure Maxime Leroy
2026-02-26 14:33 ` [PATCH v2 05/17] net/dpaa2: fix link not up after port stop/start Maxime Leroy
2026-02-26 14:33 ` [PATCH v2 06/17] bus/fslmc: fix devargs not propagated on hotplug Maxime Leroy
2026-02-26 14:33 ` [PATCH v2 07/17] net/dpaa2: fix spurious VLAN insertion on non-VLAN packets Maxime Leroy
2026-02-26 14:33 ` [PATCH v2 08/17] net/dpaa2: fix error packet dump crash and memory leak Maxime Leroy
2026-02-26 19:23   ` Stephen Hemminger
2026-02-26 14:33 ` [PATCH v2 09/17] net/dpaa2: fix L4 packet type classification in slow parse path Maxime Leroy
2026-02-26 14:33 ` [PATCH v2 10/17] net/dpaa2: fix L3/L4 checksum offload flags Maxime Leroy
2026-02-26 14:33 ` [PATCH v2 11/17] net/dpaa2: fix software taildrop buffer access Maxime Leroy
2026-02-26 19:21   ` Stephen Hemminger
2026-02-27  9:23     ` David Marchand
2026-02-27 21:29       ` Morten Brørup
2026-03-06 17:35         ` Stephen Hemminger
2026-02-26 14:33 ` Maxime Leroy [this message]
2026-02-26 14:33 ` [PATCH v2 13/17] net/dpaa2: add SG table walk upper bound in Rx path Maxime Leroy
2026-02-26 14:33 ` [PATCH v2 14/17] net/dpaa2: fix MAC stats DMA buffer allocation per xstats call Maxime Leroy
2026-02-26 14:33 ` [PATCH v2 15/17] net/dpaa2: use CHECK_INTERVAL macro in set_link_down Maxime Leroy
2026-02-26 14:33 ` [PATCH v2 16/17] net/dpaa2: add devargs to disable Rx taildrop Maxime Leroy
2026-02-26 14:33 ` [PATCH v2 17/17] net/dpaa2: add devargs alternative for data stashing getenv Maxime Leroy

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=20260226143341.282188-13-maxime@leroys.fr \
    --to=maxime@leroys.fr \
    --cc=david.marchand@redhat.com \
    --cc=dev@dpdk.org \
    --cc=hemant.agrawal@nxp.com \
    --cc=stable@dpdk.org \
    --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