src/dpdk/drivers/net/mlx4/mlx4.c
static int
mlx4_dev_start(struct rte_eth_dev *dev)
{
	struct mlx4_priv *priv = dev->data->dev_private;
	struct rte_flow_error error;
	int ret;

	if (priv->started)
		return 0;
	DEBUG("%p: attaching configured flows to all RX queues", (void *)dev);
	priv->started = 1;
	ret = mlx4_rss_init(priv);
	if (ret) {
		ERROR("%p: cannot initialize RSS resources: %s",
		      (void *)dev, strerror(-ret));
		goto err;
	}
#ifdef RTE_LIBRTE_MLX4_DEBUG
	mlx4_mr_dump_dev(dev);
#endif
	ret = mlx4_rxq_intr_enable(priv);
	if (ret) {
		ERROR("%p: interrupt handler installation failed",
		     (void *)dev);
		goto err;
	}
	ret = mlx4_flow_sync(priv, &error);
	if (ret) {
		ERROR("%p: cannot attach flow rules (code %d, \"%s\"),"
		      " flow error type %d, cause %p, message: %s",
		      (void *)dev,
		      -ret, strerror(-ret), error.type, error.cause,
		      error.message ? error.message : "(unspecified)");
		goto err;
	}
	rte_wmb();
	dev->tx_pkt_burst = mlx4_tx_burst;
	dev->rx_pkt_burst = mlx4_rx_burst;
	/* Enable datapath on secondary process. */
	mlx4_mp_req_start_rxtx(dev);
	return 0;
err:
	mlx4_dev_stop(dev);
	return ret;
}
/**
 * DPDK callback to start the device.
 *
 * Simulate device start by initializing common RSS resources and attaching
 * all configured flows.
 *
 * @param dev
 *   Pointer to Ethernet device structure.
 *
 * @return
 *   0 on success, negative errno value otherwise and rte_errno is set.
 */
DPDK callback to start the device.
Simulate device start by initializing common RSS resources and attaching
all configured flows.

@param dev
Pointer to Ethernet device structure.

@return
0 on success, negative errno value otherwise and rte_errno is set.
DPDK callback to start the device . Simulate device start by initializing common RSS resources and attaching all configured flows . @param dev Pointer to Ethernet device structure . @return 0 on success negative errno value otherwise and rte_errno is set .
static int
mlx4_dev_start(struct rte_eth_dev *dev)
{
	struct mlx4_priv *priv = dev->data->dev_private;
	struct rte_flow_error error;
	int ret;
	if (priv->started)
		return 0;
	DEBUG("%p: attaching configured flows to all RX queues", (void *)dev);
	priv->started = 1;
	ret = mlx4_rss_init(priv);
	if (ret) {
		ERROR("%p: cannot initialize RSS resources: %s",
		      (void *)dev, strerror(-ret));
		goto err;
	}
#ifdef RTE_LIBRTE_MLX4_DEBUG
	mlx4_mr_dump_dev(dev);
#endif
	ret = mlx4_rxq_intr_enable(priv);
	if (ret) {
		ERROR("%p: interrupt handler installation failed",
		     (void *)dev);
		goto err;
	}
	ret = mlx4_flow_sync(priv, &error);
	if (ret) {
		ERROR("%p: cannot attach flow rules (code %d, \"%s\"),"
		      " flow error type %d, cause %p, message: %s",
		      (void *)dev,
		      -ret, strerror(-ret), error.type, error.cause,
		      error.message ? error.message : "(unspecified)");
		goto err;
	}
	rte_wmb();
	dev->tx_pkt_burst = mlx4_tx_burst;
	dev->rx_pkt_burst = mlx4_rx_burst;
	mlx4_mp_req_start_rxtx(dev);
	return 0;
err:
	mlx4_dev_stop(dev);
	return ret;
}
static int mlx4_dev_start ( struct rte_eth_dev * dev ) { struct mlx4_priv * priv = dev -> data -> dev_private ; struct rte_flow_error error ; int ret ; if ( priv -> started ) return 0 ; DEBUG ( " " , ( void * ) dev ) ; priv -> started = 1 ; ret = mlx4_rss_init ( priv ) ; if ( ret ) { ERROR ( " " , ( void * ) dev , strerror ( - ret ) ) ; goto err ; } #ifdef RTE_LIBRTE_MLX4_DEBUG mlx4_mr_dump_dev ( dev ) ; #endif ret = mlx4_rxq_intr_enable ( priv ) ; if ( ret ) { ERROR ( " " , ( void * ) dev ) ; goto err ; } ret = mlx4_flow_sync ( priv , & error ) ; if ( ret ) { ERROR ( " \" \" " " " , ( void * ) dev , - ret , strerror ( - ret ) , error . type , error . cause , error . message ? error . message : " " ) ; goto err ; } rte_wmb ( ) ; dev -> tx_pkt_burst = mlx4_tx_burst ; dev -> rx_pkt_burst = mlx4_rx_burst ; mlx4_mp_req_start_rxtx ( dev ) ; return 0 ; err : mlx4_dev_stop ( dev ) ; return ret ; }
DPDK callback to start the device.
DPDK callback to start the device .
/* Enable datapath on secondary process. */