MCPcopy Create free account
hub / github.com/F-Stack/f-stack / mlx4_dev_stop

Function mlx4_dev_stop

dpdk/drivers/net/mlx4/mlx4.c:351–376  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

349 * Pointer to Ethernet device structure.
350 */
351static int
352mlx4_dev_stop(struct rte_eth_dev *dev)
353{
354 struct mlx4_priv *priv = dev->data->dev_private;
355 uint16_t i;
356
357 if (!priv->started)
358 return 0;
359 DEBUG("%p: detaching flows from all RX queues", (void *)dev);
360 priv->started = 0;
361 dev->tx_pkt_burst = rte_eth_pkt_burst_dummy;
362 dev->rx_pkt_burst = rte_eth_pkt_burst_dummy;
363 rte_wmb();
364 /* Disable datapath on secondary process. */
365 mlx4_mp_req_stop_rxtx(dev);
366 mlx4_flow_sync(priv, NULL);
367 mlx4_rxq_intr_disable(priv);
368 mlx4_rss_deinit(priv);
369
370 for (i = 0; i < dev->data->nb_rx_queues; i++)
371 dev->data->rx_queue_state[i] = RTE_ETH_QUEUE_STATE_STOPPED;
372 for (i = 0; i < dev->data->nb_tx_queues; i++)
373 dev->data->tx_queue_state[i] = RTE_ETH_QUEUE_STATE_STOPPED;
374
375 return 0;
376}
377
378/**
379 * DPDK callback to close the device.

Callers 1

mlx4_dev_startFunction · 0.85

Calls 4

mlx4_mp_req_stop_rxtxFunction · 0.85
mlx4_flow_syncFunction · 0.85
mlx4_rxq_intr_disableFunction · 0.85
mlx4_rss_deinitFunction · 0.85

Tested by

no test coverage detected