From: Matan Azrad Date: Mon, 5 Feb 2018 14:09:21 +0000 (+0000) Subject: app/testpmd: fix port index in RSS forward config X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=13cb6fae7991e2213cf8ce39fe3caa1c804511e1;p=dpdk.git app/testpmd: fix port index in RSS forward config 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 --- diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c index 7f2afa2f6a..3053b56574 100644 --- a/app/test-pmd/config.c +++ b/app/test-pmd/config.c @@ -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++; } }