* [PATCH] app/testpmd: add flag to enable RSS for single-queue
@ 2025-07-15 12:53 Bruce Richardson
0 siblings, 0 replies; only message in thread
From: Bruce Richardson @ 2025-07-15 12:53 UTC (permalink / raw)
To: dev; +Cc: Bruce Richardson
For testing purposes it can be desirable to enable RSS even when only a
single queue per port is in use. Add an "enable-rss" flag to testpmd to
match the existing "disable-rss" flag.
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
---
app/test-pmd/parameters.c | 13 +++++++++++++
app/test-pmd/testpmd.c | 3 ++-
app/test-pmd/testpmd.h | 1 +
3 files changed, 16 insertions(+), 1 deletion(-)
diff --git a/app/test-pmd/parameters.c b/app/test-pmd/parameters.c
index 1132972913..80c6ecae54 100644
--- a/app/test-pmd/parameters.c
+++ b/app/test-pmd/parameters.c
@@ -121,6 +121,8 @@ enum {
TESTPMD_OPT_ENABLE_DROP_EN_NUM,
#define TESTPMD_OPT_DISABLE_RSS "disable-rss"
TESTPMD_OPT_DISABLE_RSS_NUM,
+#define TESTPMD_OPT_ENABLE_RSS "enable-rss"
+ TESTPMD_OPT_ENABLE_RSS_NUM,
#define TESTPMD_OPT_PORT_TOPOLOGY "port-topology"
TESTPMD_OPT_PORT_TOPOLOGY_NUM,
#define TESTPMD_OPT_FORWARD_MODE "forward-mode"
@@ -310,6 +312,7 @@ static const struct option long_options[] = {
NO_ARG(TESTPMD_OPT_ENABLE_HW_QINQ_STRIP),
NO_ARG(TESTPMD_OPT_ENABLE_DROP_EN),
NO_ARG(TESTPMD_OPT_DISABLE_RSS),
+ NO_ARG(TESTPMD_OPT_ENABLE_RSS),
REQUIRED_ARG(TESTPMD_OPT_PORT_TOPOLOGY),
REQUIRED_ARG(TESTPMD_OPT_FORWARD_MODE),
NO_ARG(TESTPMD_OPT_RSS_IP),
@@ -454,6 +457,7 @@ usage(char* progname)
printf(" --enable-hw-qinq-strip: enable hardware qinq strip.\n");
printf(" --enable-drop-en: enable per queue packet drop.\n");
printf(" --disable-rss: disable rss.\n");
+ printf(" --enable-rss: Force rss even for single-queue operation.\n");
printf(" --port-topology=<paired|chained|loop>: set port topology (paired "
"is default).\n");
printf(" --forward-mode=N: set forwarding mode (N: %s).\n",
@@ -1244,8 +1248,17 @@ launch_args_parse(int argc, char** argv)
rx_drop_en = 1;
break;
case TESTPMD_OPT_DISABLE_RSS_NUM:
+ if (force_rss)
+ rte_exit(EXIT_FAILURE, "Invalid option combination, %s and %s\n",
+ TESTPMD_OPT_DISABLE_RSS, TESTPMD_OPT_ENABLE_RSS);
rss_hf = 0;
break;
+ case TESTPMD_OPT_ENABLE_RSS_NUM:
+ if (rss_hf == 0)
+ rte_exit(EXIT_FAILURE, "Invalid option combination, %s and %s\n",
+ TESTPMD_OPT_DISABLE_RSS, TESTPMD_OPT_ENABLE_RSS);
+ force_rss = true;
+ break;
case TESTPMD_OPT_PORT_TOPOLOGY_NUM:
if (!strcmp(optarg, "paired"))
port_topology = PORT_TOPOLOGY_PAIRED;
diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c
index bb88555328..8bb4b1c762 100644
--- a/app/test-pmd/testpmd.c
+++ b/app/test-pmd/testpmd.c
@@ -382,6 +382,7 @@ uint64_t noisy_lkup_num_reads_writes;
* Receive Side Scaling (RSS) configuration.
*/
uint64_t rss_hf = RTE_ETH_RSS_IP; /* RSS IP by default. */
+bool force_rss; /* false == for single queue don't force rss */
/*
* Port topology configuration
@@ -4007,7 +4008,7 @@ init_port_config(void)
if (ret != 0)
return;
- if (nb_rxq > 1) {
+ if (nb_rxq > 1 || force_rss) {
port->dev_conf.rx_adv_conf.rss_conf.rss_key = NULL;
port->dev_conf.rx_adv_conf.rss_conf.rss_hf =
rss_hf & port->dev_info.flow_type_rss_offloads;
diff --git a/app/test-pmd/testpmd.h b/app/test-pmd/testpmd.h
index e629edaa02..96ac88a29c 100644
--- a/app/test-pmd/testpmd.h
+++ b/app/test-pmd/testpmd.h
@@ -576,6 +576,7 @@ extern struct rte_eth_rxmode rx_mode;
extern struct rte_eth_txmode tx_mode;
extern uint64_t rss_hf;
+extern bool force_rss;
extern queueid_t nb_hairpinq;
extern queueid_t nb_rxq;
--
2.48.1
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2025-07-15 12:54 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-07-15 12:53 [PATCH] app/testpmd: add flag to enable RSS for single-queue 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).