app/testpmd: limit number of forwarding cores
authorPablo de Lara <pablo.de.lara.guarch@intel.com>
Mon, 27 Jun 2016 22:35:19 +0000 (23:35 +0100)
committerThomas Monjalon <thomas.monjalon@6wind.com>
Thu, 30 Jun 2016 17:34:15 +0000 (19:34 +0200)
Number of forwarding cores must be equal or less than
number of forwarding streams, otherwise two cores
would try to use a same queue on a port, which is not allowed.

Fixes: f2bb7ae1d204 ("app/testpmd: handle all Rx queues in RSS setup")

Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Tested-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
Acked-by: John McNamara <john.mcnamara@intel.com>
app/test-pmd/config.c

index 9ccabf9..de60284 100644 (file)
@@ -1236,6 +1236,10 @@ rss_fwd_config_setup(void)
        cur_fwd_config.nb_fwd_streams =
                (streamid_t) (nb_q * cur_fwd_config.nb_fwd_ports);
 
+       if (cur_fwd_config.nb_fwd_streams < cur_fwd_config.nb_fwd_lcores)
+               cur_fwd_config.nb_fwd_lcores =
+                       (lcoreid_t)cur_fwd_config.nb_fwd_streams;
+
        /* reinitialize forwarding streams */
        init_fwd_streams();