]> git.droids-corp.org - dpdk.git/commitdiff
app/testpmd: fix port index in RSS forward config
authorMatan Azrad <matan@mellanox.com>
Mon, 5 Feb 2018 14:09:21 +0000 (14:09 +0000)
committerThomas Monjalon <thomas@monjalon.net>
Tue, 6 Feb 2018 17:04:51 +0000 (18:04 +0100)
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

index 7f2afa2f6aff3db535b25e2e28291dffa18a729d..3053b565742f92847739d668ecd6c62090a28009 100644 (file)
@@ -1989,7 +1989,8 @@ rss_fwd_config_setup(void)
                 * 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 @@ rss_fwd_config_setup(void)
                 * 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++;
        }
 }