app/testpmd: implement basic support for flow API
[dpdk.git] / app / test-pmd / testpmd.c
index a0332c2..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;