DPDK patches and discussions
 help / color / mirror / Atom feed
From: Matan Azrad <matan@mellanox.com>
To: Wenzhuo Lu <wenzhuo.lu@intel.com>
Cc: dev@dpdk.org, stable@dpdk.org
Subject: [dpdk-dev] [PATCH v2 1/3] app/testpmd: fix port index in RSS fwd config
Date: Mon,  5 Feb 2018 14:09:21 +0000	[thread overview]
Message-ID: <1517839763-24122-2-git-send-email-matan@mellanox.com> (raw)
In-Reply-To: <1517839763-24122-1-git-send-email-matan@mellanox.com>

When multi-queue ports are configured by the user, the testpmd streams
are created by rss_fwd_config_setup() function.

This function may configure to the streams either invalid Rx ports or
invalid Tx ports.

An invalid Tx port is configured when the number of ports is odd.
In this case, the last Tx port will be always invalid.

An invalid Rx port is configured when NUMA support is configured by the
user and the number of forward ports is much smaller than the number of
all ports. In this case, also the Tx port is invalid.

Change calculations to get valid ports.

Fixes: af75078 ("first public release")
Cc: stable@dpdk.org

Signed-off-by: Matan Azrad <matan@mellanox.com>
---
 app/test-pmd/config.c | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)

diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c
index 7f2afa2..3053b56 100644
--- a/app/test-pmd/config.c
+++ b/app/test-pmd/config.c
@@ -1989,7 +1989,8 @@ struct igb_ring_desc_16_bytes {
 		 * if we are in loopback, simply send stuff out through the
 		 * ingress port
 		 */
-		if (port_topology == PORT_TOPOLOGY_LOOP)
+		if (port_topology == PORT_TOPOLOGY_LOOP ||
+		    txp >= cur_fwd_config.nb_fwd_ports)
 			txp = rxp;
 
 		fs->rx_port = fwd_ports_ids[rxp];
@@ -2006,11 +2007,7 @@ struct igb_ring_desc_16_bytes {
 		 * Restart from RX queue 0 on next RX port
 		 */
 		rxq = 0;
-		if (numa_support && (nb_fwd_ports <= (nb_ports >> 1)))
-			rxp = (portid_t)
-				(rxp + ((nb_ports >> 1) / nb_fwd_ports));
-		else
-			rxp = (portid_t) (rxp + 1);
+		rxp++;
 	}
 }
 
-- 
1.8.3.1

  reply	other threads:[~2018-02-05 14:10 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-04 17:27 [dpdk-dev] [PATCH 1/2] app/testpmd: fix RSS stream invalid Tx port set Matan Azrad
2018-02-04 17:27 ` [dpdk-dev] [PATCH 2/2] app/testpmd: use dedicated function to get Tx port Matan Azrad
2018-02-05 14:09 ` [dpdk-dev] [PATCH v2 0/3] testpmd: fix rss forward config Matan Azrad
2018-02-05 14:09   ` Matan Azrad [this message]
2018-02-05 14:09   ` [dpdk-dev] [PATCH v2 2/3] app/testpmd: fix port topology in RSS fwd config Matan Azrad
2018-02-05 14:09   ` [dpdk-dev] [PATCH v2 3/3] app/testpmd: use dedicated function to get Tx port Matan Azrad
2018-02-06 17:20   ` [dpdk-dev] [PATCH v2 0/3] testpmd: fix rss forward config Thomas Monjalon

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=1517839763-24122-2-git-send-email-matan@mellanox.com \
    --to=matan@mellanox.com \
    --cc=dev@dpdk.org \
    --cc=stable@dpdk.org \
    --cc=wenzhuo.lu@intel.com \
    /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;
as well as URLs for NNTP newsgroup(s).