From: Bruce Richardson <bruce.richardson@intel.com>
To: dev@dpdk.org
Cc: Bruce Richardson <bruce.richardson@intel.com>
Subject: [PATCH] app/testpmd: enable warnings for possibly invalid config
Date: Fri, 12 Sep 2025 17:02:10 +0100 [thread overview]
Message-ID: <20250912160210.388290-1-bruce.richardson@intel.com> (raw)
When dealing with multi-segment packets, there are separate offload
flags which should be enabled on Rx (scattered flag) and on Tx
(multi-segment flag). Print warnings on testpmd startup if we detect a
situation where we suspect the user is missing these flags, e.g. we
allow scattered packets on Rx, but not on Tx.
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
---
app/test-pmd/parameters.c | 21 +++++++++++++++++++++
1 file changed, 21 insertions(+)
diff --git a/app/test-pmd/parameters.c b/app/test-pmd/parameters.c
index f7601df0bf..058e3c6826 100644
--- a/app/test-pmd/parameters.c
+++ b/app/test-pmd/parameters.c
@@ -1770,6 +1770,27 @@ launch_args_parse(int argc, char** argv)
TESTPMD_OPT_PROC_ID, proc_id,
TESTPMD_OPT_NUM_PROCS, num_procs);
+ /* check for multiple segments without scattered flag enabled */
+ if (mbuf_data_size_n > 1 && (rx_offloads & RTE_ETH_RX_OFFLOAD_SCATTER) == 0)
+ TESTPMD_LOG(WARNING, "Warning: multiple mbuf sizes specified but scattered Rx not enabled\n");
+
+ /* check for max packet size greater than mbuf size, without scatter or multi-seg flags */
+ if (max_rx_pkt_len > mbuf_data_size[0]) {
+ if ((rx_offloads & RTE_ETH_RX_OFFLOAD_SCATTER) == 0)
+ TESTPMD_LOG(WARNING, "Warning: max-pkt-len (%u) is greater than mbuf size (%u) without scattered Rx enabled\n",
+ max_rx_pkt_len, mbuf_data_size[0]);
+ if ((tx_offloads & RTE_ETH_TX_OFFLOAD_MULTI_SEGS) == 0)
+ TESTPMD_LOG(WARNING, "Warning: max-pkt-len (%u) is greater than mbuf size (%u) without multi-segment Tx enabled\n",
+ max_rx_pkt_len, mbuf_data_size[0]);
+ }
+
+ /* check for scattered Rx enabled without also having multi-segment Tx */
+ if ((rx_offloads & RTE_ETH_RX_OFFLOAD_SCATTER) != 0 &&
+ (tx_offloads & RTE_ETH_TX_OFFLOAD_MULTI_SEGS) == 0) {
+ TESTPMD_LOG(WARNING, "Warning: Scattered RX offload enabled, but TX multi-segment support not enabled.\n");
+ TESTPMD_LOG(WARNING, " Multi-segment packets can be received but not transmitted.\n");
+ }
+
/* Set offload configuration from command line parameters. */
rx_mode.offloads = rx_offloads;
tx_mode.offloads = tx_offloads;
--
2.48.1
reply other threads:[~2025-09-12 16:02 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20250912160210.388290-1-bruce.richardson@intel.com \
--to=bruce.richardson@intel.com \
--cc=dev@dpdk.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).