From: Bruce Richardson <bruce.richardson@intel.com>
To: dev@dpdk.org
Cc: Bruce Richardson <bruce.richardson@intel.com>
Subject: [PATCH] app/testpmd: add flag to enable RSS for single-queue
Date: Tue, 15 Jul 2025 12:53:30 +0000 [thread overview]
Message-ID: <20250715125330.2127309-1-bruce.richardson@intel.com> (raw)
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
reply other threads:[~2025-07-15 12:54 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=20250715125330.2127309-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).