[dpdk-dev] app/testpmd: distribute queues to cores

Message ID 20180526151520.8579-1-xuemingl@mellanox.com (mailing list archive)
State Accepted, archived
Delegated to: Thomas Monjalon
Headers

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation success Compilation OK

Commit Message

Xueming Li May 26, 2018, 3:15 p.m. UTC
  Current topology distribute forwarding streams to lcores by port, this
make unbalanced loading when port number larger than 2:
	lcore 0: P0Q0->P1Q0, P0Q1->P1Q1
	locre 1: P1Q0->P0Q0, P1Q1->P0Q1
If only one port has traffic, only one locre get fully loaded and the
other one get no forwarding. Performance is bad as only one core doing
forwarding in such case.

This patch distributes forwarding streams by queue, try to get streams
of each port handled by different lcore:
	lcore 0: P0Q0->P1Q0, P1Q0->P1Q0
	locre 1: P0Q1->P0Q1, P1Q1->P0Q1

Signed-off-by: Xueming Li <xuemingl@mellanox.com>
---
 app/test-pmd/config.c | 12 ++++--------
 1 file changed, 4 insertions(+), 8 deletions(-)
  

Comments

Bruce Richardson June 14, 2018, 10:51 a.m. UTC | #1
On Sat, May 26, 2018 at 11:15:20PM +0800, Xueming Li wrote:
> Current topology distribute forwarding streams to lcores by port, this
> make unbalanced loading when port number larger than 2:
> 	lcore 0: P0Q0->P1Q0, P0Q1->P1Q1
> 	locre 1: P1Q0->P0Q0, P1Q1->P0Q1
> If only one port has traffic, only one locre get fully loaded and the
> other one get no forwarding. Performance is bad as only one core doing
> forwarding in such case.
> 
> This patch distributes forwarding streams by queue, try to get streams
> of each port handled by different lcore:
> 	lcore 0: P0Q0->P1Q0, P1Q0->P1Q0
> 	locre 1: P0Q1->P0Q1, P1Q1->P0Q1
> 
> Signed-off-by: Xueming Li <xuemingl@mellanox.com>
> ---
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
  
Thomas Monjalon July 12, 2018, 9:09 p.m. UTC | #2
14/06/2018 12:51, Bruce Richardson:
> On Sat, May 26, 2018 at 11:15:20PM +0800, Xueming Li wrote:
> > Current topology distribute forwarding streams to lcores by port, this
> > make unbalanced loading when port number larger than 2:
> > 	lcore 0: P0Q0->P1Q0, P0Q1->P1Q1
> > 	locre 1: P1Q0->P0Q0, P1Q1->P0Q1
> > If only one port has traffic, only one locre get fully loaded and the
> > other one get no forwarding. Performance is bad as only one core doing
> > forwarding in such case.
> > 
> > This patch distributes forwarding streams by queue, try to get streams
> > of each port handled by different lcore:
> > 	lcore 0: P0Q0->P1Q0, P1Q0->P1Q0
> > 	locre 1: P0Q1->P0Q1, P1Q1->P0Q1
> > 
> > Signed-off-by: Xueming Li <xuemingl@mellanox.com>
> > ---
> Acked-by: Bruce Richardson <bruce.richardson@intel.com>

Applied, thanks
  

Patch

diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c
index 97020fb3d..45b4d4f45 100644
--- a/app/test-pmd/config.c
+++ b/app/test-pmd/config.c
@@ -2177,15 +2177,11 @@  rss_fwd_config_setup(void)
 		fs->tx_queue = rxq;
 		fs->peer_addr = fs->tx_port;
 		fs->retry_enabled = retry_enabled;
-		rxq = (queueid_t) (rxq + 1);
-		if (rxq < nb_q)
-			continue;
-		/*
-		 * rxq == nb_q
-		 * Restart from RX queue 0 on next RX port
-		 */
-		rxq = 0;
 		rxp++;
+		if (rxp < nb_fwd_ports)
+			continue;
+		rxp = 0;
+		rxq++;
 	}
 }