src/dpdk/drivers/net/cxgbe/cxgbe_ethdev.c
int cxgbe_dev_start(struct rte_eth_dev *eth_dev)
{
	struct port_info *pi = eth_dev->data->dev_private;
	struct rte_eth_rxmode *rx_conf = &eth_dev->data->dev_conf.rxmode;
	struct adapter *adapter = pi->adapter;
	int err = 0, i;

	CXGBE_FUNC_TRACE();

	/*
	 * If we don't have a connection to the firmware there's nothing we
	 * can do.
	 */
	if (!(adapter->flags & FW_OK)) {
		err = -ENXIO;
		goto out;
	}

	if (!(adapter->flags & FULL_INIT_DONE)) {
		err = cxgbe_up(adapter);
		if (err < 0)
			goto out;
	}

	if (rx_conf->offloads & DEV_RX_OFFLOAD_SCATTER)
		eth_dev->data->scattered_rx = 1;
	else
		eth_dev->data->scattered_rx = 0;

	cxgbe_enable_rx_queues(pi);

	err = cxgbe_setup_rss(pi);
	if (err)
		goto out;

	for (i = 0; i < pi->n_tx_qsets; i++) {
		err = cxgbe_dev_tx_queue_start(eth_dev, i);
		if (err)
			goto out;
	}

	for (i = 0; i < pi->n_rx_qsets; i++) {
		err = cxgbe_dev_rx_queue_start(eth_dev, i);
		if (err)
			goto out;
	}

	err = cxgbe_link_start(pi);
	if (err)
		goto out;

out:
	return err;
}
/* Start the device.
 * It returns 0 on success.
 */
Start the device.
It returns 0 on success.
Start the device . It returns 0 on success .
int cxgbe_dev_start(struct rte_eth_dev *eth_dev)
{
	struct port_info *pi = eth_dev->data->dev_private;
	struct rte_eth_rxmode *rx_conf = &eth_dev->data->dev_conf.rxmode;
	struct adapter *adapter = pi->adapter;
	int err = 0, i;
	CXGBE_FUNC_TRACE();
	if (!(adapter->flags & FW_OK)) {
		err = -ENXIO;
		goto out;
	}
	if (!(adapter->flags & FULL_INIT_DONE)) {
		err = cxgbe_up(adapter);
		if (err < 0)
			goto out;
	}
	if (rx_conf->offloads & DEV_RX_OFFLOAD_SCATTER)
		eth_dev->data->scattered_rx = 1;
	else
		eth_dev->data->scattered_rx = 0;
	cxgbe_enable_rx_queues(pi);
	err = cxgbe_setup_rss(pi);
	if (err)
		goto out;
	for (i = 0; i < pi->n_tx_qsets; i++) {
		err = cxgbe_dev_tx_queue_start(eth_dev, i);
		if (err)
			goto out;
	}
	for (i = 0; i < pi->n_rx_qsets; i++) {
		err = cxgbe_dev_rx_queue_start(eth_dev, i);
		if (err)
			goto out;
	}
	err = cxgbe_link_start(pi);
	if (err)
		goto out;
out:
	return err;
}
int cxgbe_dev_start ( struct rte_eth_dev * eth_dev ) { struct port_info * pi = eth_dev -> data -> dev_private ; struct rte_eth_rxmode * rx_conf = & eth_dev -> data -> dev_conf . rxmode ; struct adapter * adapter = pi -> adapter ; int err = 0 , i ; CXGBE_FUNC_TRACE ( ) ; if ( ! ( adapter -> flags & FW_OK ) ) { err = - ENXIO ; goto out ; } if ( ! ( adapter -> flags & FULL_INIT_DONE ) ) { err = cxgbe_up ( adapter ) ; if ( err < 0 ) goto out ; } if ( rx_conf -> offloads & DEV_RX_OFFLOAD_SCATTER ) eth_dev -> data -> scattered_rx = 1 ; else eth_dev -> data -> scattered_rx = 0 ; cxgbe_enable_rx_queues ( pi ) ; err = cxgbe_setup_rss ( pi ) ; if ( err ) goto out ; for ( i = 0 ; i < pi -> n_tx_qsets ; i ++ ) { err = cxgbe_dev_tx_queue_start ( eth_dev , i ) ; if ( err ) goto out ; } for ( i = 0 ; i < pi -> n_rx_qsets ; i ++ ) { err = cxgbe_dev_rx_queue_start ( eth_dev , i ) ; if ( err ) goto out ; } err = cxgbe_link_start ( pi ) ; if ( err ) goto out ; out : return err ; }
Start the device.
Start the device .
/*
	 * If we don't have a connection to the firmware there's nothing we
	 * can do.
	 */