fix PMD wording
[dpdk.git] / drivers / net / nfp / nfp_ethdev.c
index 8b6e641..8e81cc4 100644 (file)
@@ -22,6 +22,7 @@
 #include <rte_memzone.h>
 #include <rte_mempool.h>
 #include <rte_service_component.h>
+#include <rte_alarm.h>
 #include "eal_firmware.h"
 
 #include "nfpcore/nfp_cpp.h"
 #include "nfpcore/nfp_rtsym.h"
 #include "nfpcore/nfp_nsp.h"
 
-#include "nfp_net_pmd.h"
+#include "nfp_common.h"
 #include "nfp_rxtx.h"
-#include "nfp_net_logs.h"
-#include "nfp_net_ctrl.h"
+#include "nfp_logs.h"
+#include "nfp_ctrl.h"
 #include "nfp_cpp_bridge.h"
 
 
@@ -81,7 +82,7 @@ static int
 nfp_net_start(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 rte_intr_handle *intr_handle = pci_dev->intr_handle;
        uint32_t new_ctrl, update = 0;
        struct nfp_net_hw *hw;
        struct nfp_pf_dev *pf_dev;
@@ -108,12 +109,13 @@ nfp_net_start(struct rte_eth_dev *dev)
                                          "with NFP multiport PF");
                                return -EINVAL;
                }
-               if (intr_handle->type == RTE_INTR_HANDLE_UIO) {
+               if (rte_intr_type_get(intr_handle) ==
+                                               RTE_INTR_HANDLE_UIO) {
                        /*
                         * Better not to share LSC with RX interrupts.
                         * Unregistering LSC interrupt handler
                         */
-                       rte_intr_callback_unregister(&pci_dev->intr_handle,
+                       rte_intr_callback_unregister(pci_dev->intr_handle,
                                nfp_net_dev_interrupt_handler, (void *)dev);
 
                        if (dev->data->nb_rx_queues > 1) {
@@ -140,7 +142,7 @@ nfp_net_start(struct rte_eth_dev *dev)
        dev_conf = &dev->data->dev_conf;
        rxmode = &dev_conf->rxmode;
 
-       if (rxmode->mq_mode & ETH_MQ_RX_RSS) {
+       if (rxmode->mq_mode & RTE_ETH_MQ_RX_RSS) {
                nfp_net_rss_config_default(dev);
                update |= NFP_NET_CFG_UPDATE_RSS;
                new_ctrl |= NFP_NET_CFG_CTRL_RSS;
@@ -307,6 +309,10 @@ nfp_net_close(struct rte_eth_dev *dev)
                nfp_net_reset_rx_queue(this_rx_q);
        }
 
+       /* Cancel possible impending LSC work here before releasing the port*/
+       rte_eal_alarm_cancel(nfp_net_dev_interrupt_delayed_handler,
+                            (void *)dev);
+
        /* Only free PF resources after all physical ports have been closed */
        /* Mark this port as unused and free device priv resources*/
        nn_cfg_writeb(hw, NFP_NET_CFG_LSC, 0xff);
@@ -328,15 +334,15 @@ nfp_net_close(struct rte_eth_dev *dev)
        nfp_cpp_free(pf_dev->cpp);
        rte_free(pf_dev);
 
-       rte_intr_disable(&pci_dev->intr_handle);
+       rte_intr_disable(pci_dev->intr_handle);
 
        /* unregister callback func from eal lib */
-       rte_intr_callback_unregister(&pci_dev->intr_handle,
+       rte_intr_callback_unregister(pci_dev->intr_handle,
                                     nfp_net_dev_interrupt_handler,
                                     (void *)dev);
 
        /*
-        * The ixgbe PMD driver disables the pcie master on the
+        * The ixgbe PMD disables the pcie master on the
         * device. The i40e does not...
         */
 
@@ -566,7 +572,7 @@ nfp_net_init(struct rte_eth_dev *eth_dev)
        eth_dev->data->dev_flags |= RTE_ETH_DEV_AUTOFILL_QUEUE_XSTATS;
 
        PMD_INIT_LOG(INFO, "port %d VendorID=0x%x DeviceID=0x%x "
-                    "mac=%02x:%02x:%02x:%02x:%02x:%02x",
+                    "mac=" RTE_ETHER_ADDR_PRT_FMT,
                     eth_dev->data->port_id, pci_dev->id.vendor_id,
                     pci_dev->id.device_id,
                     hw->mac_addr[0], hw->mac_addr[1], hw->mac_addr[2],
@@ -574,7 +580,7 @@ nfp_net_init(struct rte_eth_dev *eth_dev)
 
        if (rte_eal_process_type() == RTE_PROC_PRIMARY) {
                /* Registering LSC interrupt handler */
-               rte_intr_callback_register(&pci_dev->intr_handle,
+               rte_intr_callback_register(pci_dev->intr_handle,
                                           nfp_net_dev_interrupt_handler,
                                           (void *)eth_dev);
                /* Telling the firmware about the LSC interrupt entry */