net/i40e: flush tunnel filters
[dpdk.git] / app / test-pmd / testpmd.c
index 6185be6..bfb2f8e 100644 (file)
@@ -78,6 +78,7 @@
 #ifdef RTE_LIBRTE_PDUMP
 #include <rte_pdump.h>
 #endif
+#include <rte_flow.h>
 
 #include "testpmd.h"
 
@@ -1545,6 +1546,8 @@ close_port(portid_t pid)
                        continue;
                }
 
+               if (port->flow_list)
+                       port_flow_flush(pi);
                rte_eth_dev_close(pi);
 
                if (rte_atomic16_cmpset(&(port->port_status),
@@ -1599,6 +1602,9 @@ detach_port(uint8_t port_id)
                return;
        }
 
+       if (ports[port_id].flow_list)
+               port_flow_flush(port_id);
+
        if (rte_eth_dev_detach(port_id, name))
                return;
 
@@ -2002,8 +2008,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) {