src/dpdk/drivers/net/nfb/nfb_ethdev.c
static int
nfb_eth_dev_close(struct rte_eth_dev *dev)
{
	struct pmd_internals *internals = dev->data->dev_private;
	uint16_t i;
	uint16_t nb_rx = dev->data->nb_rx_queues;
	uint16_t nb_tx = dev->data->nb_tx_queues;
	int ret;

	if (rte_eal_process_type() != RTE_PROC_PRIMARY)
		return 0;

	ret = nfb_eth_dev_stop(dev);

	nfb_nc_rxmac_deinit(internals->rxmac, internals->max_rxmac);
	nfb_nc_txmac_deinit(internals->txmac, internals->max_txmac);

	for (i = 0; i < nb_rx; i++) {
		nfb_eth_rx_queue_release(dev->data->rx_queues[i]);
		dev->data->rx_queues[i] = NULL;
	}
	dev->data->nb_rx_queues = 0;
	for (i = 0; i < nb_tx; i++) {
		nfb_eth_tx_queue_release(dev->data->tx_queues[i]);
		dev->data->tx_queues[i] = NULL;
	}
	dev->data->nb_tx_queues = 0;

	return ret;
}
/**
 * DPDK callback to close the device.
 *
 * Destroy all queues and objects, free memory.
 *
 * @param dev
 *   Pointer to Ethernet device structure.
 */
DPDK callback to close the device.
Destroy all queues and objects, free memory.

@param dev
Pointer to Ethernet device structure.
DPDK callback to close the device . Destroy all queues and objects free memory . @param dev Pointer to Ethernet device structure .
static int
nfb_eth_dev_close(struct rte_eth_dev *dev)
{
	struct pmd_internals *internals = dev->data->dev_private;
	uint16_t i;
	uint16_t nb_rx = dev->data->nb_rx_queues;
	uint16_t nb_tx = dev->data->nb_tx_queues;
	int ret;
	if (rte_eal_process_type() != RTE_PROC_PRIMARY)
		return 0;
	ret = nfb_eth_dev_stop(dev);
	nfb_nc_rxmac_deinit(internals->rxmac, internals->max_rxmac);
	nfb_nc_txmac_deinit(internals->txmac, internals->max_txmac);
	for (i = 0; i < nb_rx; i++) {
		nfb_eth_rx_queue_release(dev->data->rx_queues[i]);
		dev->data->rx_queues[i] = NULL;
	}
	dev->data->nb_rx_queues = 0;
	for (i = 0; i < nb_tx; i++) {
		nfb_eth_tx_queue_release(dev->data->tx_queues[i]);
		dev->data->tx_queues[i] = NULL;
	}
	dev->data->nb_tx_queues = 0;
	return ret;
}
static int nfb_eth_dev_close ( struct rte_eth_dev * dev ) { struct pmd_internals * internals = dev -> data -> dev_private ; uint16_t i ; uint16_t nb_rx = dev -> data -> nb_rx_queues ; uint16_t nb_tx = dev -> data -> nb_tx_queues ; int ret ; if ( rte_eal_process_type ( ) != RTE_PROC_PRIMARY ) return 0 ; ret = nfb_eth_dev_stop ( dev ) ; nfb_nc_rxmac_deinit ( internals -> rxmac , internals -> max_rxmac ) ; nfb_nc_txmac_deinit ( internals -> txmac , internals -> max_txmac ) ; for ( i = 0 ; i < nb_rx ; i ++ ) { nfb_eth_rx_queue_release ( dev -> data -> rx_queues [ i ] ) ; dev -> data -> rx_queues [ i ] = NULL ; } dev -> data -> nb_rx_queues = 0 ; for ( i = 0 ; i < nb_tx ; i ++ ) { nfb_eth_tx_queue_release ( dev -> data -> tx_queues [ i ] ) ; dev -> data -> tx_queues [ i ] = NULL ; } dev -> data -> nb_tx_queues = 0 ; return ret ; }
DPDK callback to close the device.
DPDK callback to close the device .