src/dpdk/drivers/net/mlx5/mlx5_trigger.c
int
mlx5_dev_stop(struct rte_eth_dev *dev)
{
	struct mlx5_priv *priv = dev->data->dev_private;

	dev->data->dev_started = 0;
	/* Prevent crashes when queues are still in use. */
	dev->rx_pkt_burst = removed_rx_burst;
	dev->tx_pkt_burst = removed_tx_burst;
	rte_wmb();
	/* Disable datapath on secondary process. */
	mlx5_mp_os_req_stop_rxtx(dev);
	rte_delay_us_sleep(1000 * priv->rxqs_n);
	DRV_LOG(DEBUG, "port %u stopping device", dev->data->port_id);
	mlx5_flow_stop_default(dev);
	/* Control flows for default traffic can be removed firstly. */
	mlx5_traffic_disable(dev);
	/* All RX queue flags will be cleared in the flush interface. */
	mlx5_flow_list_flush(dev, &priv->flows, true);
	mlx5_rx_intr_vec_disable(dev);
	priv->sh->port[priv->dev_port - 1].ih_port_id = RTE_MAX_ETHPORTS;
	priv->sh->port[priv->dev_port - 1].devx_ih_port_id = RTE_MAX_ETHPORTS;
	mlx5_txq_stop(dev);
	mlx5_rxq_stop(dev);
	mlx5_txpp_stop(dev);

	return 0;
}
/**
 * DPDK callback to stop the device.
 *
 * Simulate device stop by detaching all configured flows.
 *
 * @param dev
 *   Pointer to Ethernet device structure.
 */
DPDK callback to stop the device.
Simulate device stop by detaching all configured flows.

@param dev
Pointer to Ethernet device structure.
DPDK callback to stop the device . Simulate device stop by detaching all configured flows . @param dev Pointer to Ethernet device structure .
int
mlx5_dev_stop(struct rte_eth_dev *dev)
{
	struct mlx5_priv *priv = dev->data->dev_private;
	dev->data->dev_started = 0;
	dev->rx_pkt_burst = removed_rx_burst;
	dev->tx_pkt_burst = removed_tx_burst;
	rte_wmb();
	mlx5_mp_os_req_stop_rxtx(dev);
	rte_delay_us_sleep(1000 * priv->rxqs_n);
	DRV_LOG(DEBUG, "port %u stopping device", dev->data->port_id);
	mlx5_flow_stop_default(dev);
	mlx5_traffic_disable(dev);
	mlx5_flow_list_flush(dev, &priv->flows, true);
	mlx5_rx_intr_vec_disable(dev);
	priv->sh->port[priv->dev_port - 1].ih_port_id = RTE_MAX_ETHPORTS;
	priv->sh->port[priv->dev_port - 1].devx_ih_port_id = RTE_MAX_ETHPORTS;
	mlx5_txq_stop(dev);
	mlx5_rxq_stop(dev);
	mlx5_txpp_stop(dev);
	return 0;
}
int mlx5_dev_stop ( struct rte_eth_dev * dev ) { struct mlx5_priv * priv = dev -> data -> dev_private ; dev -> data -> dev_started = 0 ; dev -> rx_pkt_burst = removed_rx_burst ; dev -> tx_pkt_burst = removed_tx_burst ; rte_wmb ( ) ; mlx5_mp_os_req_stop_rxtx ( dev ) ; rte_delay_us_sleep ( 1000 * priv -> rxqs_n ) ; DRV_LOG ( DEBUG , " " , dev -> data -> port_id ) ; mlx5_flow_stop_default ( dev ) ; mlx5_traffic_disable ( dev ) ; mlx5_flow_list_flush ( dev , & priv -> flows , true ) ; mlx5_rx_intr_vec_disable ( dev ) ; priv -> sh -> port [ priv -> dev_port - 1 ] . ih_port_id = RTE_MAX_ETHPORTS ; priv -> sh -> port [ priv -> dev_port - 1 ] . devx_ih_port_id = RTE_MAX_ETHPORTS ; mlx5_txq_stop ( dev ) ; mlx5_rxq_stop ( dev ) ; mlx5_txpp_stop ( dev ) ; return 0 ; }
DPDK callback to stop the device.
DPDK callback to stop the device .
/* Prevent crashes when queues are still in use. */ /* Disable datapath on secondary process. */ /* Control flows for default traffic can be removed firstly. */ /* All RX queue flags will be cleared in the flush interface. */