#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"
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;
"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) {
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;
for (i = 0; i < dev->data->nb_tx_queues; i++) {
this_tx_q = (struct nfp_net_txq *)dev->data->tx_queues[i];
nfp_net_reset_tx_queue(this_tx_q);
+ nfp_net_tx_queue_release(dev, i);
}
for (i = 0; i < dev->data->nb_rx_queues; i++) {
this_rx_q = (struct nfp_net_rxq *)dev->data->rx_queues[i];
nfp_net_reset_rx_queue(this_rx_q);
+ nfp_net_rx_queue_release(dev, i);
}
+ /* 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);
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...
*/
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],
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 */