net/ice: refine debug build option
[dpdk.git] / drivers / net / nfb / nfb_ethdev.c
index c3c3d00..7e91d59 100644 (file)
@@ -9,7 +9,7 @@
 #include <netcope/rxmac.h>
 #include <netcope/txmac.h>
 
-#include <rte_ethdev_pci.h>
+#include <ethdev_pci.h>
 #include <rte_kvargs.h>
 
 #include "nfb_stats.h"
@@ -151,18 +151,22 @@ err_rx:
  * @param dev
  *   Pointer to Ethernet device structure.
  */
-static void
+static int
 nfb_eth_dev_stop(struct rte_eth_dev *dev)
 {
        uint16_t i;
        uint16_t nb_rx = dev->data->nb_rx_queues;
        uint16_t nb_tx = dev->data->nb_tx_queues;
 
+       dev->data->dev_started = 0;
+
        for (i = 0; i < nb_tx; i++)
                nfb_eth_tx_queue_stop(dev, i);
 
        for (i = 0; i < nb_rx; i++)
                nfb_eth_rx_queue_stop(dev, i);
+
+       return 0;
 }
 
 /**
@@ -216,8 +220,12 @@ nfb_eth_dev_close(struct rte_eth_dev *dev)
        uint16_t i;
        uint16_t nb_rx = dev->data->nb_rx_queues;
        uint16_t nb_tx = dev->data->nb_tx_queues;
+       int ret;
 
-       nfb_eth_dev_stop(dev);
+       if (rte_eal_process_type() != RTE_PROC_PRIMARY)
+               return 0;
+
+       ret = nfb_eth_dev_stop(dev);
 
        nfb_nc_rxmac_deinit(internals->rxmac, internals->max_rxmac);
        nfb_nc_txmac_deinit(internals->txmac, internals->max_txmac);
@@ -233,10 +241,7 @@ nfb_eth_dev_close(struct rte_eth_dev *dev)
        }
        dev->data->nb_tx_queues = 0;
 
-       rte_free(dev->data->mac_addrs);
-       dev->data->mac_addrs = NULL;
-
-       return 0;
+       return ret;
 }
 
 /**
@@ -457,9 +462,6 @@ nfb_eth_dev_init(struct rte_eth_dev *dev)
                rte_kvargs_free(kvlist);
        }
 
-       /* Let rte_eth_dev_close() release the port resources */
-       dev->data->dev_flags |= RTE_ETH_DEV_CLOSE_REMOVE;
-
        /*
         * Get number of available DMA RX and TX queues, which is maximum
         * number of queues that can be created and store it in private device
@@ -514,6 +516,8 @@ nfb_eth_dev_init(struct rte_eth_dev *dev)
        data->all_multicast = nfb_eth_allmulticast_get(dev);
        internals->rx_filter_original = data->promiscuous;
 
+       dev->data->dev_flags |= RTE_ETH_DEV_AUTOFILL_QUEUE_XSTATS;
+
        RTE_LOG(INFO, PMD, "NFB device ("
                PCI_PRI_FMT ") successfully initialized\n",
                pci_addr->domain, pci_addr->bus, pci_addr->devid,