From: Long Li <longli@microsoft.com>
To: dev@dpdk.org
Cc: aman.deep.singh@intel.com, stephen@networkplumber.org,
longli@microsoft.com
Subject: [PATCH] app/testpmd: reduce txonly multi-flow src_port range
Date: Thu, 26 Feb 2026 11:16:25 -0800 [thread overview]
Message-ID: <20260226191625.1049670-1-longli@microsoft.com> (raw)
Reduce the UDP source port OR-mask from 0xC0 to 0xF0, lowering
unique high-byte values from 64 to 16 (16 unique ports per lcore).
Modern SmartNICs rarely need more than 16 queues to saturate RX,
and excessive unique ports can exhaust hardware flow caching,
degrading performance.
Unique source ports by lcore count:
1: 16, 2: 32, 4: 64, 8: 128, 16: 256
Signed-off-by: Long Li <longli@microsoft.com>
---
app/test-pmd/txonly.c | 9 ++++-----
1 file changed, 4 insertions(+), 5 deletions(-)
diff --git a/app/test-pmd/txonly.c b/app/test-pmd/txonly.c
index bdcf6ea660..bb97a81402 100644
--- a/app/test-pmd/txonly.c
+++ b/app/test-pmd/txonly.c
@@ -229,12 +229,11 @@ pkt_burst_prepare(struct rte_mbuf *pkt, struct rte_mempool *mbp,
* packet generator for developer's quick performance
* regression test.
*
- * Only ports in the range 49152 (0xC000) and 65535 (0xFFFF)
- * will be used, with the least significant byte representing
- * the lcore ID. As such, the most significant byte will cycle
- * through 0xC0 and 0xFF.
+ * Generate ports in the IANA ephemeral range (49152+).
+ * The OR-mask (0xF0) produces 16 unique port values
+ * per lcore for good RSS distribution.
*/
- src_port = ((src_var++ | 0xC0) << 8) + rte_lcore_id();
+ src_port = ((src_var++ | 0xF0) << 8) + rte_lcore_id();
udp_hdr->src_port = rte_cpu_to_be_16(src_port);
RTE_PER_LCORE(_src_port_var) = src_var;
}
--
2.43.0
next reply other threads:[~2026-02-26 19:16 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-02-26 19:16 Long Li [this message]
2026-02-26 21:35 ` [PATCH] app/testpmd: reduce txonly multi-flow src_port range Stephen Hemminger
2026-02-26 23:21 ` [RFC] app/testpmd: add configurable flow count for txonly multi-flow Stephen Hemminger
2026-02-26 23:51 ` [EXTERNAL] " Long Li
2026-02-27 22:43 ` [PATCH v2] " Stephen Hemminger
2026-03-02 20:00 ` Stephen Hemminger
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=20260226191625.1049670-1-longli@microsoft.com \
--to=longli@microsoft.com \
--cc=aman.deep.singh@intel.com \
--cc=dev@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