net/bnxt: support WC TCAM management
[dpdk.git] / drivers / net / atlantic / atl_ethdev.c
index d96865d..0ce35eb 100644 (file)
@@ -3,7 +3,7 @@
  */
 
 #include <rte_string_fns.h>
-#include <rte_ethdev_pci.h>
+#include <ethdev_pci.h>
 #include <rte_alarm.h>
 
 #include "atl_ethdev.h"
@@ -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,7 +703,7 @@ 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);
 
@@ -709,7 +714,7 @@ atl_dev_close(struct rte_eth_dev *dev)
 
        pthread_mutex_destroy(&hw->mbox_mutex);
 
-       return 0;
+       return ret;
 }
 
 static int
@@ -1068,7 +1073,7 @@ atl_fw_version_get(struct rte_eth_dev *dev, char *fw_version, size_t fw_size)
 {
        struct aq_hw_s *hw = ATL_DEV_PRIVATE_TO_HW(dev->data->dev_private);
        uint32_t fw_ver = 0;
-       unsigned int ret = 0;
+       int ret = 0;
 
        ret = hw_atl_utils_get_fw_version(hw, &fw_ver);
        if (ret)
@@ -1076,10 +1081,11 @@ atl_fw_version_get(struct rte_eth_dev *dev, char *fw_version, size_t fw_size)
 
        ret = snprintf(fw_version, fw_size, "%u.%u.%u", fw_ver >> 24,
                       (fw_ver >> 16) & 0xFFU, fw_ver & 0xFFFFU);
+       if (ret < 0)
+               return -EINVAL;
 
        ret += 1; /* add string null-terminator */
-
-       if (fw_size < ret)
+       if (fw_size < (size_t)ret)
                return ret;
 
        return 0;
@@ -1909,5 +1915,5 @@ is_atlantic_supported(struct rte_eth_dev *dev)
 RTE_PMD_REGISTER_PCI(net_atlantic, rte_atl_pmd);
 RTE_PMD_REGISTER_PCI_TABLE(net_atlantic, pci_id_atl_map);
 RTE_PMD_REGISTER_KMOD_DEP(net_atlantic, "* igb_uio | uio_pci_generic");
-RTE_LOG_REGISTER(atl_logtype_init, pmd.net.atlantic.init, NOTICE);
-RTE_LOG_REGISTER(atl_logtype_driver, pmd.net.atlantic.driver, NOTICE);
+RTE_LOG_REGISTER_SUFFIX(atl_logtype_init, init, NOTICE);
+RTE_LOG_REGISTER_SUFFIX(atl_logtype_driver, driver, NOTICE);