net/vhost: remove redundant declaration
[dpdk.git] / drivers / net / vhost / rte_eth_vhost.c
index 6705e90..57f382c 100644 (file)
@@ -329,8 +329,8 @@ vhost_count_multicast_broadcast(struct vhost_queue *vq,
        struct vhost_stats *pstats = &vq->stats;
 
        ea = rte_pktmbuf_mtod(mbuf, struct rte_ether_addr *);
-       if (is_multicast_ether_addr(ea)) {
-               if (is_broadcast_ether_addr(ea))
+       if (rte_is_multicast_ether_addr(ea)) {
+               if (rte_is_broadcast_ether_addr(ea))
                        pstats->xstats[VHOST_BROADCAST_PKT]++;
                else
                        pstats->xstats[VHOST_MULTICAST_PKT]++;
@@ -1005,6 +1005,9 @@ eth_dev_close(struct rte_eth_dev *dev)
        rte_free(internal);
 
        dev->data->dev_private = NULL;
+
+       rte_free(vring_states[dev->data->port_id]);
+       vring_states[dev->data->port_id] = NULL;
 }
 
 static int
@@ -1196,8 +1199,6 @@ static const struct eth_dev_ops ops = {
        .rx_queue_intr_disable = eth_rxq_intr_disable,
 };
 
-static struct rte_vdev_driver pmd_vhost_drv;
-
 static int
 eth_dev_vhost_create(struct rte_vdev_device *dev, char *iface_name,
        int16_t queues, const unsigned int numa_node, uint64_t flags)
@@ -1261,7 +1262,7 @@ eth_dev_vhost_create(struct rte_vdev_device *dev, char *iface_name,
        internal->max_queues = queues;
        internal->vid = -1;
        data->dev_link = pmd_link;
-       data->dev_flags = RTE_ETH_DEV_INTR_LSC;
+       data->dev_flags = RTE_ETH_DEV_INTR_LSC | RTE_ETH_DEV_CLOSE_REMOVE;
 
        eth_dev->dev_ops = &ops;
 
@@ -1442,16 +1443,13 @@ rte_pmd_vhost_remove(struct rte_vdev_device *dev)
        /* find an ethdev entry */
        eth_dev = rte_eth_dev_allocated(name);
        if (eth_dev == NULL)
-               return -ENODEV;
+               return 0;
 
        if (rte_eal_process_type() != RTE_PROC_PRIMARY)
                return rte_eth_dev_release_port(eth_dev);
 
        eth_dev_close(eth_dev);
 
-       rte_free(vring_states[eth_dev->data->port_id]);
-       vring_states[eth_dev->data->port_id] = NULL;
-
        rte_eth_dev_release_port(eth_dev);
 
        return 0;