X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;f=drivers%2Fnet%2Fnetvsc%2Fhn_ethdev.c;h=4a01f1d464b88f9b79c403784cfb7a9c4fd5cf45;hb=a3babbdd0fd64eda10f3967011a410faab8080a1;hp=5ae2d469c8954350a25d1c6068838d045f68e06e;hpb=30410493759f4bae3f65497737661e27b93c2d0e;p=dpdk.git diff --git a/drivers/net/netvsc/hn_ethdev.c b/drivers/net/netvsc/hn_ethdev.c index 5ae2d469c8..4a01f1d464 100644 --- a/drivers/net/netvsc/hn_ethdev.c +++ b/drivers/net/netvsc/hn_ethdev.c @@ -827,28 +827,31 @@ hn_dev_start(struct rte_eth_dev *dev) return error; } -static void +static int hn_dev_stop(struct rte_eth_dev *dev) { struct hn_data *hv = dev->data->dev_private; PMD_INIT_FUNC_TRACE(); + dev->data->dev_started = 0; hn_rndis_set_rxfilter(hv, 0); - hn_vf_stop(dev); + return hn_vf_stop(dev); } static int hn_dev_close(struct rte_eth_dev *dev) { + int ret; + PMD_INIT_FUNC_TRACE(); if (rte_eal_process_type() != RTE_PROC_PRIMARY) return 0; - hn_vf_close(dev); + ret = hn_vf_close(dev); hn_dev_free_queues(dev); - return 0; + return ret; } static const struct eth_dev_ops hn_eth_dev_ops = { @@ -947,6 +950,8 @@ eth_hn_dev_init(struct rte_eth_dev *eth_dev) if (rte_eal_process_type() != RTE_PROC_PRIMARY) return 0; + eth_dev->data->dev_flags |= RTE_ETH_DEV_AUTOFILL_QUEUE_XSTATS; + /* Since Hyper-V only supports one MAC address */ eth_dev->data->mac_addrs = rte_calloc("hv_mac", HN_MAX_MAC_ADDRS, sizeof(struct rte_ether_addr), 0); @@ -1039,20 +1044,16 @@ static int eth_hn_dev_uninit(struct rte_eth_dev *eth_dev) { struct hn_data *hv = eth_dev->data->dev_private; - int ret; + int ret, ret_stop; PMD_INIT_FUNC_TRACE(); if (rte_eal_process_type() != RTE_PROC_PRIMARY) return 0; - hn_dev_stop(eth_dev); + ret_stop = hn_dev_stop(eth_dev); hn_dev_close(eth_dev); - eth_dev->dev_ops = NULL; - eth_dev->tx_pkt_burst = NULL; - eth_dev->rx_pkt_burst = NULL; - hn_detach(hv); hn_chim_uninit(eth_dev); rte_vmbus_chan_close(hv->primary->chan); @@ -1061,7 +1062,7 @@ eth_hn_dev_uninit(struct rte_eth_dev *eth_dev) if (ret != 0) return ret; - return 0; + return ret_stop; } static int eth_hn_probe(struct rte_vmbus_driver *drv __rte_unused,