Skip to contentSkip to conversation

app/testpmd: support unequal number of RXQ and TXQ

PATCH In review Hemant Agrawal 4 participants 5 messages Dec 11, 2019 – Aug 20, 2023

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 app/testpmd: support unequal number of RXQ and TXQ

From: Jun Yang <[email protected]>

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

Now packets from all RXQs can be forwarded to TXQs

---
 app/test-pmd/config.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
app/test-pmd/config.c +1 -3
index d59968278..efa409453 100644
@@ -2130,8 +2130,6 @@ rss_fwd_config_setup(void)
 	streamid_t  sm_id;
 
 	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 =
@@ -2154,7 +2152,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++;
Signature · 1 line
2.17.1
#1 lore raw
Quoted 40 lines

-----Original Message-----
From: dev <[email protected]> On Behalf Of Hemant Agrawal
Sent: Wednesday, December 11, 2019 5:30 AM
To: [email protected]
Cc: Jun Yang <[email protected]>
Subject: [dpdk-dev] [PATCH] app/testpmd: support unequal number of RXQ and TXQ

From: Jun Yang <[email protected]>

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

Now packets from all RXQs can be forwarded to TXQs

---
 app/test-pmd/config.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
app/test-pmd/config.c +0 -2
index d59968278..efa409453 100644
@@ -2130,8 +2130,6 @@ rss_fwd_config_setup(void)
 	streamid_t  sm_id;
 
 	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 =

app/test-pmd/config.c rss_fwd_config_setup(void) · line 2155

Quoted 5 lines
app/test-pmd/config.c +1 -1
@@ -2154,7 +2152,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);

But does it mean that now 2 lcores cah use the same TX queue? If so, then how it supposed to work?

Quoted 5 lines
app/test-pmd/config.c +0 -1
 		fs->peer_addr = fs->tx_port;
 		fs->retry_enabled = retry_enabled;
 		rxp++;
--

2.17.1

#2 lore raw
Quoted 20 lines · Konstantin
Quoted 20 lines

-----Original Message-----
From: dev <[email protected]> On Behalf Of Hemant Agrawal
Sent: Wednesday, December 11, 2019 5:30 AM
To: [email protected]
Cc: Jun Yang <[email protected]>
Subject: [dpdk-dev] [PATCH] app/testpmd: support unequal number of RXQ and TXQ

From: Jun Yang <[email protected]>

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

Quoted 1 line
Quoted 1 line

Now packets from all RXQs can be forwarded to TXQs

Allow this feature only for DEV_TX_OFFLOAD_MT_LOCKFREE devices. Please probe DEV_TX_OFFLOAD_MT_LOCKFREE() capability first to avoid breaking contract on the other devices.

Quoted 13 lines
Quoted 13 lines
---
 app/test-pmd/config.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
app/test-pmd/config.c +0 -0
index d59968278..efa409453 100644
@@ -2130,8 +2130,6 @@ rss_fwd_config_setup(void)
      streamid_t  sm_id;
 
Quoted 15 lines

app/test-pmd/config.c rss_fwd_config_setup(void) · line 2155

Quoted 12 lines
app/test-pmd/config.c +1 -3
      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 =
@@ -2154,7 +2152,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);

But does it mean that now 2 lcores cah use the same TX queue? If so, then how it supposed to work?

See above.

Quoted 7 lines
Quoted 6 lines
app/test-pmd/config.c +0 -1
              fs->peer_addr = fs->tx_port;
              fs->retry_enabled = retry_enabled;
              rxp++;
--

2.17.1

#3 lore raw
Quoted 28 lines

-----Original Message-----
From: Jerin Jacob <[email protected]>

Quoted 21 lines · Konstantin
Quoted 21 lines

-----Original Message-----
From: dev <[email protected]> On Behalf Of Hemant Agrawal
Sent: Wednesday, December 11, 2019 5:30 AM
To: [email protected]
Cc: Jun Yang <[email protected]>
Subject: [dpdk-dev] [PATCH] app/testpmd: support unequal number of RXQ and TXQ

From: Jun Yang <[email protected]>

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

Quoted 5 lines
Quoted 1 line
Quoted 1 line

Now packets from all RXQs can be forwarded to TXQs

Allow this feature only for DEV_TX_OFFLOAD_MT_LOCKFREE devices. Please probe DEV_TX_OFFLOAD_MT_LOCKFREE() capability first to avoid breaking contract on the other devices.

[Hemant] Agree with the suggestion.

Quoted 40 lines
Quoted 14 lines
Quoted 14 lines
---
 app/test-pmd/config.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
app/test-pmd/config.c index renamed from app/test-pmd/config.c +0 -0

d59968278..efa409453 100644

app/test-pmd/config.c +0 -0
@@ -2130,8 +2130,6 @@ rss_fwd_config_setup(void)
      streamid_t  sm_id;
 
Quoted 15 lines

app/test-pmd/config.c rss_fwd_config_setup(void) · line 2155

Quoted 12 lines
app/test-pmd/config.c +0 -2
      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 = @@ -2154,7 +2152,7 @@

rss_fwd_config_setup(void)

              fs->rx_port = fwd_ports_ids[rxp];
              fs->rx_queue = rxq;
              fs->tx_port = fwd_ports_ids[txp];
app/test-pmd/config.c +1 -1
-             fs->tx_queue = rxq;
+             fs->tx_queue = (rxq % nb_txq);

But does it mean that now 2 lcores cah use the same TX queue? If so, then how it supposed to work?

See above.

Quoted 7 lines
Quoted 6 lines
              fs->peer_addr = fs->tx_port;
              fs->retry_enabled = retry_enabled;
              rxp++;

--
2.17.1

#4 lore raw
In reply to Jerin Jacob
Quoted 18 lines · On Wed, 11 Dec 2019 15:56:17 +0530 Jerin Jacob <[email protected]> wrote:
Quoted 18 lines
Quoted 18 lines

-----Original Message-----
From: dev <[email protected]> On Behalf Of Hemant Agrawal
Sent: Wednesday, December 11, 2019 5:30 AM
To: [email protected]
Cc: Jun Yang <[email protected]>
Subject: [dpdk-dev] [PATCH] app/testpmd: support unequal number of RXQ and TXQ

From: Jun Yang <[email protected]>

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

Quoted 7 lines
Quoted 1 line
Quoted 1 line

Now packets from all RXQs can be forwarded to TXQs

Allow this feature only for DEV_TX_OFFLOAD_MT_LOCKFREE devices. Please probe DEV_TX_OFFLOAD_MT_LOCKFREE() capability first to avoid breaking contract on the other devices.

Quoted 1 line
Quoted 1 line

Dropping this version of the patch. Please resubmit a new version with the lock free check.