ethdev: remove detachable device flag
[dpdk.git] / drivers / net / virtio / virtio_user_ethdev.c
index 280406c..0cfa27b 100644 (file)
@@ -35,7 +35,6 @@
 #include <sys/types.h>
 #include <unistd.h>
 #include <fcntl.h>
-#include <sys/types.h>
 #include <sys/socket.h>
 
 #include <rte_malloc.h>
@@ -87,7 +86,11 @@ virtio_user_read_dev_config(struct virtio_hw *hw, size_t offset,
                        int flags;
 
                        flags = fcntl(dev->vhostfd, F_GETFL);
-                       fcntl(dev->vhostfd, F_SETFL, flags | O_NONBLOCK);
+                       if (fcntl(dev->vhostfd, F_SETFL,
+                                       flags | O_NONBLOCK) == -1) {
+                               PMD_DRV_LOG(ERR, "error setting O_NONBLOCK flag");
+                               return;
+                       }
                        r = recv(dev->vhostfd, buf, 128, MSG_PEEK);
                        if (r == 0 || (r < 0 && errno != EAGAIN)) {
                                dev->status &= (~VIRTIO_NET_S_LINK_UP);
@@ -370,9 +373,9 @@ virtio_user_eth_dev_alloc(struct rte_vdev_device *vdev)
         */
        hw->use_msix = 1;
        hw->modern   = 0;
-       hw->use_simple_rxtx = 0;
+       hw->use_simple_rx = 0;
+       hw->use_simple_tx = 0;
        hw->virtio_user_dev = dev;
-       data->dev_flags = RTE_ETH_DEV_DETACHABLE;
        return eth_dev;
 }
 
@@ -388,7 +391,7 @@ virtio_user_eth_dev_free(struct rte_eth_dev *eth_dev)
 }
 
 /* Dev initialization routine. Invoked once for each virtio vdev at
- * EAL init time, see rte_eal_dev_init().
+ * EAL init time, see rte_bus_probe().
  * Returns 0 on success.
  */
 static int
@@ -556,7 +559,6 @@ virtio_user_pmd_remove(struct rte_vdev_device *vdev)
        virtio_user_dev_uninit(dev);
 
        rte_free(eth_dev->data->dev_private);
-       rte_free(eth_dev->data);
        rte_eth_dev_release_port(eth_dev);
 
        return 0;