src/dpdk/drivers/net/vmxnet3/vmxnet3_ethdev.c
static int
vmxnet3_dev_stop(struct rte_eth_dev *dev)
{
	struct rte_eth_link link;
	struct vmxnet3_hw *hw = dev->data->dev_private;

	PMD_INIT_FUNC_TRACE();

	if (hw->adapter_stopped == 1) {
		PMD_INIT_LOG(DEBUG, "Device already stopped.");
		return 0;
	}

	/* disable interrupts */
	vmxnet3_disable_intr(hw);

	if (dev->data->dev_conf.intr_conf.lsc) {
		struct rte_pci_device *pci_dev = RTE_DEV_TO_PCI(dev->device);

		rte_intr_disable(&pci_dev->intr_handle);

		rte_intr_callback_unregister(&pci_dev->intr_handle,
					     vmxnet3_interrupt_handler, dev);
	}

	/* quiesce the device first */
	VMXNET3_WRITE_BAR1_REG(hw, VMXNET3_REG_CMD, VMXNET3_CMD_QUIESCE_DEV);
	VMXNET3_WRITE_BAR1_REG(hw, VMXNET3_REG_DSAL, 0);
	VMXNET3_WRITE_BAR1_REG(hw, VMXNET3_REG_DSAH, 0);

	/* reset the device */
	VMXNET3_WRITE_BAR1_REG(hw, VMXNET3_REG_CMD, VMXNET3_CMD_RESET_DEV);
	PMD_INIT_LOG(DEBUG, "Device reset.");

	vmxnet3_dev_clear_queues(dev);

	/* Clear recorded link status */
	memset(&link, 0, sizeof(link));
	link.link_duplex = ETH_LINK_FULL_DUPLEX;
	link.link_speed = ETH_SPEED_NUM_10G;
	link.link_autoneg = ETH_LINK_FIXED;
	rte_eth_linkstatus_set(dev, &link);

	hw->adapter_stopped = 1;
	dev->data->dev_started = 0;

	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
vmxnet3_dev_stop(struct rte_eth_dev *dev)
{
	struct rte_eth_link link;
	struct vmxnet3_hw *hw = dev->data->dev_private;
	PMD_INIT_FUNC_TRACE();
	if (hw->adapter_stopped == 1) {
		PMD_INIT_LOG(DEBUG, "Device already stopped.");
		return 0;
	}
	vmxnet3_disable_intr(hw);
	if (dev->data->dev_conf.intr_conf.lsc) {
		struct rte_pci_device *pci_dev = RTE_DEV_TO_PCI(dev->device);
		rte_intr_disable(&pci_dev->intr_handle);
		rte_intr_callback_unregister(&pci_dev->intr_handle,
					     vmxnet3_interrupt_handler, dev);
	}
	VMXNET3_WRITE_BAR1_REG(hw, VMXNET3_REG_CMD, VMXNET3_CMD_QUIESCE_DEV);
	VMXNET3_WRITE_BAR1_REG(hw, VMXNET3_REG_DSAL, 0);
	VMXNET3_WRITE_BAR1_REG(hw, VMXNET3_REG_DSAH, 0);
	VMXNET3_WRITE_BAR1_REG(hw, VMXNET3_REG_CMD, VMXNET3_CMD_RESET_DEV);
	PMD_INIT_LOG(DEBUG, "Device reset.");
	vmxnet3_dev_clear_queues(dev);
	memset(&link, 0, sizeof(link));
	link.link_duplex = ETH_LINK_FULL_DUPLEX;
	link.link_speed = ETH_SPEED_NUM_10G;
	link.link_autoneg = ETH_LINK_FIXED;
	rte_eth_linkstatus_set(dev, &link);
	hw->adapter_stopped = 1;
	dev->data->dev_started = 0;
	return 0;
}
static int vmxnet3_dev_stop ( struct rte_eth_dev * dev ) { struct rte_eth_link link ; struct vmxnet3_hw * hw = dev -> data -> dev_private ; PMD_INIT_FUNC_TRACE ( ) ; if ( hw -> adapter_stopped == 1 ) { PMD_INIT_LOG ( DEBUG , " " ) ; return 0 ; } vmxnet3_disable_intr ( hw ) ; if ( dev -> data -> dev_conf . intr_conf . lsc ) { struct rte_pci_device * pci_dev = RTE_DEV_TO_PCI ( dev -> device ) ; rte_intr_disable ( & pci_dev -> intr_handle ) ; rte_intr_callback_unregister ( & pci_dev -> intr_handle , vmxnet3_interrupt_handler , dev ) ; } VMXNET3_WRITE_BAR1_REG ( hw , VMXNET3_REG_CMD , VMXNET3_CMD_QUIESCE_DEV ) ; VMXNET3_WRITE_BAR1_REG ( hw , VMXNET3_REG_DSAL , 0 ) ; VMXNET3_WRITE_BAR1_REG ( hw , VMXNET3_REG_DSAH , 0 ) ; VMXNET3_WRITE_BAR1_REG ( hw , VMXNET3_REG_CMD , VMXNET3_CMD_RESET_DEV ) ; PMD_INIT_LOG ( DEBUG , " " ) ; vmxnet3_dev_clear_queues ( dev ) ; memset ( & link , 0 , sizeof ( link ) ) ; link . link_duplex = ETH_LINK_FULL_DUPLEX ; link . link_speed = ETH_SPEED_NUM_10G ; link . link_autoneg = ETH_LINK_FIXED ; rte_eth_linkstatus_set ( dev , & link ) ; hw -> adapter_stopped = 1 ; dev -> data -> dev_started = 0 ; 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 */ /* quiesce the device first */ /* reset the device */ /* Clear recorded link status */