app/testpmd: support unequal number of RXQ and TXQ

Message ID 20210928110850.21184-1-nipun.gupta@nxp.com (mailing list archive)
State Rejected, archived
Delegated to: Ferruh Yigit
Headers
Series app/testpmd: support unequal number of RXQ and TXQ |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/github-robot: build success github build: passed
ci/iol-broadcom-Functional success Functional Testing PASS
ci/iol-aarch64-compile-testing success Testing PASS
ci/iol-broadcom-Performance success Performance Testing PASS
ci/iol-intel-Functional success Functional Testing PASS
ci/iol-intel-Performance success Performance Testing PASS
ci/iol-mellanox-Performance success Performance Testing PASS
ci/iol-x86_64-compile-testing fail Testing issues
ci/iol-x86_64-unit-testing fail Testing issues
ci/Intel-compilation fail Compilation issues
ci/intel-Testing success Testing PASS

Commit Message

Nipun Gupta Sept. 28, 2021, 11:08 a.m. UTC
  From: Jun Yang <jun.yang@nxp.com>

The existing forwarding mode configures the total number of
queues as the minimum of rxq and txq, so eventually the number
of txq are same as rxq.
However in some scenarios, specially for flow control the
number of rxq and txq can be different.
This patch makes the txq and function of rxq for all such
scenario instead of keeping 1:1 relationship between the two.

Signed-off-by: Jun Yang <jun.yang@nxp.com>
---
 app/test-pmd/config.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)
  

Comments

Ferruh Yigit Sept. 30, 2021, 1:45 p.m. UTC | #1
On 9/28/2021 12:08 PM, nipun.gupta@nxp.com wrote:
> From: Jun Yang <jun.yang@nxp.com>
> 
> The existing forwarding mode configures the total number of
> queues as the minimum of rxq and txq, so eventually the number
> of txq are same as rxq.
> However in some scenarios, specially for flow control the
> number of rxq and txq can be different.
> This patch makes the txq and function of rxq for all such
> scenario instead of keeping 1:1 relationship between the two.
> 

Hi Nipun,

I expect more code exists that assumes Rx queue number and Tx queue number is
equal, did you able to test unequal queue numbers with below change?

And can you please describe your usecase more, is the device has uneven Rx/Tx
queues?

> Signed-off-by: Jun Yang <jun.yang@nxp.com>
> ---
>  app/test-pmd/config.c | 6 ++----
>  1 file changed, 2 insertions(+), 4 deletions(-)
> 
> diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c
> index f5765b34f7..7e17f233ba 100644
> --- a/app/test-pmd/config.c
> +++ b/app/test-pmd/config.c
> @@ -3000,8 +3000,6 @@ rss_fwd_config_setup(void)
>  	int end;
>  
>  	nb_q = nb_rxq;
> -	if (nb_q > nb_txq)
> -		nb_q = nb_txq;
>  	cur_fwd_config.nb_fwd_lcores = (lcoreid_t) nb_fwd_lcores;
>  	cur_fwd_config.nb_fwd_ports = nb_fwd_ports;
>  	cur_fwd_config.nb_fwd_streams =
> @@ -3038,7 +3036,7 @@ rss_fwd_config_setup(void)
>  		fs->rx_port = fwd_ports_ids[rxp];
>  		fs->rx_queue = rxq;
>  		fs->tx_port = fwd_ports_ids[txp];
> -		fs->tx_queue = rxq;
> +		fs->tx_queue = (rxq % nb_txq);

Is this assumes number of Rx queue is always more than number of Tx queue?

>  		fs->peer_addr = fs->tx_port;
>  		fs->retry_enabled = retry_enabled;
>  		rxp++;
> @@ -3253,7 +3251,7 @@ fwd_config_setup(void)
>  		return;
>  	}
>  
> -	if ((nb_rxq > 1) && (nb_txq > 1)){
> +	if ((nb_rxq > 1) && (nb_txq > 1)) {
>  		if (dcb_config) {
>  			for (i = 0; i < nb_fwd_ports; i++) {
>  				pt_id = fwd_ports_ids[i];
>
  
Nipun Gupta Oct. 1, 2021, 7:22 a.m. UTC | #2
> -----Original Message-----
> From: Ferruh Yigit <ferruh.yigit@intel.com>
> Sent: Thursday, September 30, 2021 7:16 PM
> To: Nipun Gupta <nipun.gupta@nxp.com>; dev@dpdk.org
> Cc: xiaoyun.li@intel.com; orika@nvidia.com; thomas@monjalon.net; Hemant
> Agrawal <hemant.agrawal@nxp.com>; Jun Yang <jun.yang@nxp.com>
> Subject: Re: [PATCH] app/testpmd: support unequal number of RXQ and TXQ
> 
> On 9/28/2021 12:08 PM, nipun.gupta@nxp.com wrote:
> > From: Jun Yang <jun.yang@nxp.com>
> >
> > The existing forwarding mode configures the total number of
> > queues as the minimum of rxq and txq, so eventually the number
> > of txq are same as rxq.
> > However in some scenarios, specially for flow control the
> > number of rxq and txq can be different.
> > This patch makes the txq and function of rxq for all such
> > scenario instead of keeping 1:1 relationship between the two.
> >
> 
> Hi Nipun,
> 
> I expect more code exists that assumes Rx queue number and Tx queue number
> is
> equal, did you able to test unequal queue numbers with below change?

Hi Ferruh,

Yes, this works with flow, but I will double check on latest code without using
flow too. Also, we will check for any other code which shall need change w.r.t.
this functionality.

> 
> And can you please describe your usecase more, is the device has uneven Rx/Tx
> queues?

Yes, you are correct. In our case, Rx queues which we can use can be much higher
than Tx queues, when rte flow is being used.

> 
> > Signed-off-by: Jun Yang <jun.yang@nxp.com>
> > ---
> >  app/test-pmd/config.c | 6 ++----
> >  1 file changed, 2 insertions(+), 4 deletions(-)
> >
> > diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c
> > index f5765b34f7..7e17f233ba 100644
> > --- a/app/test-pmd/config.c
> > +++ b/app/test-pmd/config.c
> > @@ -3000,8 +3000,6 @@ rss_fwd_config_setup(void)
> >  	int end;
> >
> >  	nb_q = nb_rxq;
> > -	if (nb_q > nb_txq)
> > -		nb_q = nb_txq;
> >  	cur_fwd_config.nb_fwd_lcores = (lcoreid_t) nb_fwd_lcores;
> >  	cur_fwd_config.nb_fwd_ports = nb_fwd_ports;
> >  	cur_fwd_config.nb_fwd_streams =
> > @@ -3038,7 +3036,7 @@ rss_fwd_config_setup(void)
> >  		fs->rx_port = fwd_ports_ids[rxp];
> >  		fs->rx_queue = rxq;
> >  		fs->tx_port = fwd_ports_ids[txp];
> > -		fs->tx_queue = rxq;
> > +		fs->tx_queue = (rxq % nb_txq);
> 
> Is this assumes number of Rx queue is always more than number of Tx queue?

Yes, but on re-thought as per your comment, we shall need to revisit this logic.
I will have a relook on this part too.

Thanks,
Nipun

> 
> >  		fs->peer_addr = fs->tx_port;
> >  		fs->retry_enabled = retry_enabled;
> >  		rxp++;
> > @@ -3253,7 +3251,7 @@ fwd_config_setup(void)
> >  		return;
> >  	}
> >
> > -	if ((nb_rxq > 1) && (nb_txq > 1)){
> > +	if ((nb_rxq > 1) && (nb_txq > 1)) {
> >  		if (dcb_config) {
> >  			for (i = 0; i < nb_fwd_ports; i++) {
> >  				pt_id = fwd_ports_ids[i];
> >
  

Patch

diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c
index f5765b34f7..7e17f233ba 100644
--- a/app/test-pmd/config.c
+++ b/app/test-pmd/config.c
@@ -3000,8 +3000,6 @@  rss_fwd_config_setup(void)
 	int end;
 
 	nb_q = nb_rxq;
-	if (nb_q > nb_txq)
-		nb_q = nb_txq;
 	cur_fwd_config.nb_fwd_lcores = (lcoreid_t) nb_fwd_lcores;
 	cur_fwd_config.nb_fwd_ports = nb_fwd_ports;
 	cur_fwd_config.nb_fwd_streams =
@@ -3038,7 +3036,7 @@  rss_fwd_config_setup(void)
 		fs->rx_port = fwd_ports_ids[rxp];
 		fs->rx_queue = rxq;
 		fs->tx_port = fwd_ports_ids[txp];
-		fs->tx_queue = rxq;
+		fs->tx_queue = (rxq % nb_txq);
 		fs->peer_addr = fs->tx_port;
 		fs->retry_enabled = retry_enabled;
 		rxp++;
@@ -3253,7 +3251,7 @@  fwd_config_setup(void)
 		return;
 	}
 
-	if ((nb_rxq > 1) && (nb_txq > 1)){
+	if ((nb_rxq > 1) && (nb_txq > 1)) {
 		if (dcb_config) {
 			for (i = 0; i < nb_fwd_ports; i++) {
 				pt_id = fwd_ports_ids[i];