net/bnxt: switch CFA code to dynamic mbuf field
[dpdk.git] / drivers / net / iavf / iavf_ethdev.c
index 8bd2c04..0ef023c 100644 (file)
@@ -31,7 +31,7 @@
 
 static int iavf_dev_configure(struct rte_eth_dev *dev);
 static int iavf_dev_start(struct rte_eth_dev *dev);
-static void iavf_dev_stop(struct rte_eth_dev *dev);
+static int iavf_dev_stop(struct rte_eth_dev *dev);
 static int iavf_dev_close(struct rte_eth_dev *dev);
 static int iavf_dev_reset(struct rte_eth_dev *dev);
 static int iavf_dev_info_get(struct rte_eth_dev *dev,
@@ -531,7 +531,7 @@ err_queue:
        return -1;
 }
 
-static void
+static int
 iavf_dev_stop(struct rte_eth_dev *dev)
 {
        struct iavf_info *vf = IAVF_DEV_PRIVATE_TO_VF(dev->data->dev_private);
@@ -542,7 +542,7 @@ iavf_dev_stop(struct rte_eth_dev *dev)
        PMD_INIT_FUNC_TRACE();
 
        if (adapter->stopped == 1)
-               return;
+               return 0;
 
        iavf_stop_queues(dev);
 
@@ -563,6 +563,8 @@ iavf_dev_stop(struct rte_eth_dev *dev)
 
        adapter->stopped = 1;
        dev->data->dev_started = 0;
+
+       return 0;
 }
 
 static int
@@ -1432,6 +1434,7 @@ iavf_dev_init(struct rte_eth_dev *eth_dev)
                return 0;
        }
        rte_eth_copy_pci_info(eth_dev, pci_dev);
+       eth_dev->data->dev_flags |= RTE_ETH_DEV_AUTOFILL_QUEUE_XSTATS;
 
        hw->vendor_id = pci_dev->id.vendor_id;
        hw->device_id = pci_dev->id.device_id;
@@ -1500,11 +1503,13 @@ iavf_dev_close(struct rte_eth_dev *dev)
        struct iavf_adapter *adapter =
                IAVF_DEV_PRIVATE_TO_ADAPTER(dev->data->dev_private);
        struct iavf_info *vf = IAVF_DEV_PRIVATE_TO_VF(dev->data->dev_private);
+       int ret;
 
        if (rte_eal_process_type() != RTE_PROC_PRIMARY)
                return 0;
 
-       iavf_dev_stop(dev);
+       ret = iavf_dev_stop(dev);
+
        iavf_flow_flush(dev, NULL);
        iavf_flow_uninit(adapter);
 
@@ -1525,10 +1530,6 @@ iavf_dev_close(struct rte_eth_dev *dev)
                                     iavf_dev_interrupt_handler, dev);
        iavf_disable_irq0(hw);
 
-       dev->dev_ops = NULL;
-       dev->rx_pkt_burst = NULL;
-       dev->tx_pkt_burst = NULL;
-
        if (vf->vf_res->vf_cap_flags & VIRTCHNL_VF_OFFLOAD_RSS_PF) {
                if (vf->rss_lut) {
                        rte_free(vf->rss_lut);
@@ -1549,7 +1550,7 @@ iavf_dev_close(struct rte_eth_dev *dev)
 
        vf->vf_reset = false;
 
-       return 0;
+       return ret;
 }
 
 static int