bus/fslmc: fix export of unknown symbol
[dpdk.git] / app / test-pmd / testpmd.c
index 017cc61..35cf266 100644 (file)
@@ -1689,7 +1689,7 @@ start_port(portid_t pid)
                                        }
 
                                        diag = rte_eth_rx_queue_setup(pi, qi,
-                                            port->nb_rx_desc[pi],
+                                            port->nb_rx_desc[qi],
                                             rxring_numa[pi],
                                             &(port->rx_conf[qi]),
                                             mp);
@@ -1704,7 +1704,7 @@ start_port(portid_t pid)
                                                return -1;
                                        }
                                        diag = rte_eth_rx_queue_setup(pi, qi,
-                                            port->nb_rx_desc[pi],
+                                            port->nb_rx_desc[qi],
                                             port->socket_id,
                                             &(port->rx_conf[qi]),
                                             mp);
@@ -2014,6 +2014,7 @@ detach_port(portid_t port_id)
 void
 pmd_test_exit(void)
 {
+       struct rte_device *device;
        portid_t pt_id;
        int ret;
 
@@ -2027,6 +2028,18 @@ pmd_test_exit(void)
                        fflush(stdout);
                        stop_port(pt_id);
                        close_port(pt_id);
+
+                       /*
+                        * This is a workaround to fix a virtio-user issue that
+                        * requires to call clean-up routine to remove existing
+                        * socket.
+                        * This workaround valid only for testpmd, needs a fix
+                        * valid for all applications.
+                        * TODO: Implement proper resource cleanup
+                        */
+                       device = rte_eth_devices[pt_id].device;
+                       if (device && !strcmp(device->driver->name, "net_virtio_user"))
+                               detach_port(pt_id);
                }
        }