public inbox for dev@dpdk.org
 help / color / mirror / Atom feed
* [PATCH] app/testpmd: reduce txonly multi-flow src_port range
@ 2026-02-26 19:16 Long Li
  2026-02-26 21:35 ` Stephen Hemminger
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Long Li @ 2026-02-26 19:16 UTC (permalink / raw)
  To: dev; +Cc: aman.deep.singh, stephen, longli

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


^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2026-03-02 20:00 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-02-26 19:16 [PATCH] app/testpmd: reduce txonly multi-flow src_port range Long Li
2026-02-26 21:35 ` 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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox