app/testpmd: fix DCB configuration
authorBernard Iremonger <bernard.iremonger@intel.com>
Thu, 3 Nov 2016 17:35:38 +0000 (17:35 +0000)
committerThomas Monjalon <thomas.monjalon@6wind.com>
Mon, 7 Nov 2016 15:55:59 +0000 (16:55 +0100)
Data Centre Bridge (DCB) configuration fails when SRIOV is
enabled if nb_rxq or nb_txq are greater than nb_q_per_pool.

The failure occurs during configuration of the ixgbe PMD when
it is started, in the ixgbe_check_mq_mode function.

Fixes: 2a977b891f99 ("app/testpmd: fix DCB configuration")

Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
Acked-by: Jingjing Wu <jingjing.wu@intel.com>
app/test-pmd/testpmd.c

index 6185be6..a0332c2 100644 (file)
@@ -2002,8 +2002,13 @@ init_port_dcb_config(portid_t pid,
         * and has the same number of rxq and txq in dcb mode
         */
        if (dcb_mode == DCB_VT_ENABLED) {
-               nb_rxq = rte_port->dev_info.max_rx_queues;
-               nb_txq = rte_port->dev_info.max_tx_queues;
+               if (rte_port->dev_info.max_vfs > 0) {
+                       nb_rxq = rte_port->dev_info.nb_rx_queues;
+                       nb_txq = rte_port->dev_info.nb_tx_queues;
+               } else {
+                       nb_rxq = rte_port->dev_info.max_rx_queues;
+                       nb_txq = rte_port->dev_info.max_tx_queues;
+               }
        } else {
                /*if vt is disabled, use all pf queues */
                if (rte_port->dev_info.vmdq_pool_base == 0) {