src/dpdk/drivers/net/atlantic/atl_ethdev.c
static int
atl_dev_stop(struct rte_eth_dev *dev)
{
	struct rte_eth_link link;
	struct aq_hw_s *hw =
		ATL_DEV_PRIVATE_TO_HW(dev->data->dev_private);
	struct rte_pci_device *pci_dev = RTE_ETH_DEV_TO_PCI(dev);
	struct rte_intr_handle *intr_handle = &pci_dev->intr_handle;

	PMD_INIT_FUNC_TRACE();
	dev->data->dev_started = 0;

	/* disable interrupts */
	atl_disable_intr(hw);

	/* reset the NIC */
	atl_reset_hw(hw);
	hw->adapter_stopped = 1;

	atl_stop_queues(dev);

	/* Clear stored conf */
	dev->data->scattered_rx = 0;
	dev->data->lro = 0;

	/* Clear recorded link status */
	memset(&link, 0, sizeof(link));
	rte_eth_linkstatus_set(dev, &link);

	if (!rte_intr_allow_others(intr_handle))
		/* resume to the default handler */
		rte_intr_callback_register(intr_handle,
					   atl_dev_interrupt_handler,
					   (void *)dev);

	/* Clean datapath event and queue/vec mapping */
	rte_intr_efd_disable(intr_handle);
	if (intr_handle->intr_vec != NULL) {
		rte_free(intr_handle->intr_vec);
		intr_handle->intr_vec = NULL;
	}

	return 0;
}
/*
 * Stop device: disable rx and tx functions to allow for reconfiguring.
 */
Stop device: disable rx and tx functions to allow for reconfiguring.
Stop device : disable rx and tx functions to allow for reconfiguring .
static int
atl_dev_stop(struct rte_eth_dev *dev)
{
	struct rte_eth_link link;
	struct aq_hw_s *hw =
		ATL_DEV_PRIVATE_TO_HW(dev->data->dev_private);
	struct rte_pci_device *pci_dev = RTE_ETH_DEV_TO_PCI(dev);
	struct rte_intr_handle *intr_handle = &pci_dev->intr_handle;
	PMD_INIT_FUNC_TRACE();
	dev->data->dev_started = 0;
	atl_disable_intr(hw);
	atl_reset_hw(hw);
	hw->adapter_stopped = 1;
	atl_stop_queues(dev);
	dev->data->scattered_rx = 0;
	dev->data->lro = 0;
	memset(&link, 0, sizeof(link));
	rte_eth_linkstatus_set(dev, &link);
	if (!rte_intr_allow_others(intr_handle))
		rte_intr_callback_register(intr_handle,
					   atl_dev_interrupt_handler,
					   (void *)dev);
	rte_intr_efd_disable(intr_handle);
	if (intr_handle->intr_vec != NULL) {
		rte_free(intr_handle->intr_vec);
		intr_handle->intr_vec = NULL;
	}
	return 0;
}
static int atl_dev_stop ( struct rte_eth_dev * dev ) { struct rte_eth_link link ; struct aq_hw_s * hw = ATL_DEV_PRIVATE_TO_HW ( dev -> data -> dev_private ) ; struct rte_pci_device * pci_dev = RTE_ETH_DEV_TO_PCI ( dev ) ; struct rte_intr_handle * intr_handle = & pci_dev -> intr_handle ; PMD_INIT_FUNC_TRACE ( ) ; dev -> data -> dev_started = 0 ; atl_disable_intr ( hw ) ; atl_reset_hw ( hw ) ; hw -> adapter_stopped = 1 ; atl_stop_queues ( dev ) ; dev -> data -> scattered_rx = 0 ; dev -> data -> lro = 0 ; memset ( & link , 0 , sizeof ( link ) ) ; rte_eth_linkstatus_set ( dev , & link ) ; if ( ! rte_intr_allow_others ( intr_handle ) ) rte_intr_callback_register ( intr_handle , atl_dev_interrupt_handler , ( void * ) dev ) ; rte_intr_efd_disable ( intr_handle ) ; if ( intr_handle -> intr_vec != NULL ) { rte_free ( intr_handle -> intr_vec ) ; intr_handle -> intr_vec = NULL ; } return 0 ; }
Stop device: disable rx and tx functions to allow for reconfiguring.
Stop device : disable rx and tx functions to allow for reconfiguring .
/* disable interrupts */ /* reset the NIC */ /* Clear stored conf */ /* Clear recorded link status */ /* resume to the default handler */ /* Clean datapath event and queue/vec mapping */