src/dpdk/drivers/net/pcap/rte_eth_pcap.c
static int
eth_dev_stop(struct rte_eth_dev *dev)
{
	unsigned int i;
	struct pmd_internals *internals = dev->data->dev_private;
	struct pmd_process_private *pp = dev->process_private;

	/* Special iface case. Single pcap is open and shared between tx/rx. */
	if (internals->single_iface) {
		pcap_close(pp->tx_pcap[0]);
		pp->tx_pcap[0] = NULL;
		pp->rx_pcap[0] = NULL;
		goto status_down;
	}

	for (i = 0; i < dev->data->nb_tx_queues; i++) {
		if (pp->tx_dumper[i] != NULL) {
			pcap_dump_close(pp->tx_dumper[i]);
			pp->tx_dumper[i] = NULL;
		}

		if (pp->tx_pcap[i] != NULL) {
			pcap_close(pp->tx_pcap[i]);
			pp->tx_pcap[i] = NULL;
		}
	}

	for (i = 0; i < dev->data->nb_rx_queues; i++) {
		if (pp->rx_pcap[i] != NULL) {
			pcap_close(pp->rx_pcap[i]);
			pp->rx_pcap[i] = NULL;
		}
	}

status_down:
	for (i = 0; i < dev->data->nb_rx_queues; i++)
		dev->data->rx_queue_state[i] = RTE_ETH_QUEUE_STATE_STOPPED;

	for (i = 0; i < dev->data->nb_tx_queues; i++)
		dev->data->tx_queue_state[i] = RTE_ETH_QUEUE_STATE_STOPPED;

	dev->data->dev_link.link_status = ETH_LINK_DOWN;

	return 0;
}
/*
 * This function gets called when the current port gets stopped.
 * Is the only place for us to close all the tx streams dumpers.
 * If not called the dumpers will be flushed within each tx burst.
 */
This function gets called when the current port gets stopped.
Is the only place for us to close all the tx streams dumpers.
If not called the dumpers will be flushed within each tx burst.
This function gets called when the current port gets stopped . Is the only place for us to close all the tx streams dumpers . If not called the dumpers will be flushed within each tx burst .
static int
eth_dev_stop(struct rte_eth_dev *dev)
{
	unsigned int i;
	struct pmd_internals *internals = dev->data->dev_private;
	struct pmd_process_private *pp = dev->process_private;
	if (internals->single_iface) {
		pcap_close(pp->tx_pcap[0]);
		pp->tx_pcap[0] = NULL;
		pp->rx_pcap[0] = NULL;
		goto status_down;
	}
	for (i = 0; i < dev->data->nb_tx_queues; i++) {
		if (pp->tx_dumper[i] != NULL) {
			pcap_dump_close(pp->tx_dumper[i]);
			pp->tx_dumper[i] = NULL;
		}
		if (pp->tx_pcap[i] != NULL) {
			pcap_close(pp->tx_pcap[i]);
			pp->tx_pcap[i] = NULL;
		}
	}
	for (i = 0; i < dev->data->nb_rx_queues; i++) {
		if (pp->rx_pcap[i] != NULL) {
			pcap_close(pp->rx_pcap[i]);
			pp->rx_pcap[i] = NULL;
		}
	}
status_down:
	for (i = 0; i < dev->data->nb_rx_queues; i++)
		dev->data->rx_queue_state[i] = RTE_ETH_QUEUE_STATE_STOPPED;
	for (i = 0; i < dev->data->nb_tx_queues; i++)
		dev->data->tx_queue_state[i] = RTE_ETH_QUEUE_STATE_STOPPED;
	dev->data->dev_link.link_status = ETH_LINK_DOWN;
	return 0;
}
static int eth_dev_stop ( struct rte_eth_dev * dev ) { unsigned int i ; struct pmd_internals * internals = dev -> data -> dev_private ; struct pmd_process_private * pp = dev -> process_private ; if ( internals -> single_iface ) { pcap_close ( pp -> tx_pcap [ 0 ] ) ; pp -> tx_pcap [ 0 ] = NULL ; pp -> rx_pcap [ 0 ] = NULL ; goto status_down ; } for ( i = 0 ; i < dev -> data -> nb_tx_queues ; i ++ ) { if ( pp -> tx_dumper [ i ] != NULL ) { pcap_dump_close ( pp -> tx_dumper [ i ] ) ; pp -> tx_dumper [ i ] = NULL ; } if ( pp -> tx_pcap [ i ] != NULL ) { pcap_close ( pp -> tx_pcap [ i ] ) ; pp -> tx_pcap [ i ] = NULL ; } } for ( i = 0 ; i < dev -> data -> nb_rx_queues ; i ++ ) { if ( pp -> rx_pcap [ i ] != NULL ) { pcap_close ( pp -> rx_pcap [ i ] ) ; pp -> rx_pcap [ i ] = NULL ; } } status_down : for ( i = 0 ; i < dev -> data -> nb_rx_queues ; i ++ ) dev -> data -> rx_queue_state [ i ] = RTE_ETH_QUEUE_STATE_STOPPED ; for ( i = 0 ; i < dev -> data -> nb_tx_queues ; i ++ ) dev -> data -> tx_queue_state [ i ] = RTE_ETH_QUEUE_STATE_STOPPED ; dev -> data -> dev_link . link_status = ETH_LINK_DOWN ; return 0 ; }
This function gets called when the current port gets stopped.
This function gets called when the current port gets stopped .
/* Special iface case. Single pcap is open and shared between tx/rx. */