* [PATCH] app/testpmd: enable warnings for possibly invalid config
@ 2025-09-12 16:02 Bruce Richardson
0 siblings, 0 replies; only message in thread
From: Bruce Richardson @ 2025-09-12 16:02 UTC (permalink / raw)
To: dev; +Cc: Bruce Richardson
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
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2025-09-12 16:02 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-09-12 16:02 [PATCH] app/testpmd: enable warnings for possibly invalid config Bruce Richardson
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).