examples/ipsec-secgw: fix session mempool initialisation
[dpdk.git] / drivers / net / atlantic / atl_ethdev.c
index f2e48e1..b071677 100644 (file)
@@ -17,7 +17,7 @@
 static int eth_atl_dev_init(struct rte_eth_dev *eth_dev);
 static int  atl_dev_configure(struct rte_eth_dev *dev);
 static int  atl_dev_start(struct rte_eth_dev *dev);
-static void atl_dev_stop(struct rte_eth_dev *dev);
+static int atl_dev_stop(struct rte_eth_dev *dev);
 static int  atl_dev_set_link_up(struct rte_eth_dev *dev);
 static int  atl_dev_set_link_down(struct rte_eth_dev *dev);
 static int  atl_dev_close(struct rte_eth_dev *dev);
@@ -380,6 +380,8 @@ eth_atl_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;
+
        /* Vendor and Device ID need to be set before init of shared code */
        hw->device_id = pci_dev->id.device_id;
        hw->vendor_id = pci_dev->id.vendor_id;
@@ -599,7 +601,7 @@ error:
 /*
  * Stop device: disable rx and tx functions to allow for reconfiguring.
  */
-static void
+static int
 atl_dev_stop(struct rte_eth_dev *dev)
 {
        struct rte_eth_link link;
@@ -640,6 +642,8 @@ atl_dev_stop(struct rte_eth_dev *dev)
                rte_free(intr_handle->intr_vec);
                intr_handle->intr_vec = NULL;
        }
+
+       return 0;
 }
 
 /*
@@ -690,6 +694,7 @@ atl_dev_close(struct rte_eth_dev *dev)
        struct rte_pci_device *pci_dev = RTE_ETH_DEV_TO_PCI(dev);
        struct rte_intr_handle *intr_handle = &pci_dev->intr_handle;
        struct aq_hw_s *hw;
+       int ret;
 
        PMD_INIT_FUNC_TRACE();
 
@@ -698,14 +703,10 @@ atl_dev_close(struct rte_eth_dev *dev)
 
        hw = ATL_DEV_PRIVATE_TO_HW(dev->data->dev_private);
 
-       atl_dev_stop(dev);
+       ret = atl_dev_stop(dev);
 
        atl_free_queues(dev);
 
-       dev->dev_ops = NULL;
-       dev->rx_pkt_burst = NULL;
-       dev->tx_pkt_burst = NULL;
-
        /* disable uio intr before callback unregister */
        rte_intr_disable(intr_handle);
        rte_intr_callback_unregister(intr_handle,
@@ -713,7 +714,7 @@ atl_dev_close(struct rte_eth_dev *dev)
 
        pthread_mutex_destroy(&hw->mbox_mutex);
 
-       return 0;
+       return ret;
 }
 
 static int