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

Function txgbevf_dev_rxtx_start

dpdk/drivers/net/txgbe/txgbe_rxtx.c:4983–5039  ·  view source on GitHub ↗

* [VF] Start Transmit and Receive Units. */

Source from the content-addressed store, hash-verified

4981 * [VF] Start Transmit and Receive Units.
4982 */
4983void __rte_cold
4984txgbevf_dev_rxtx_start(struct rte_eth_dev *dev)
4985{
4986 struct txgbe_hw *hw;
4987 struct txgbe_tx_queue *txq;
4988 struct txgbe_rx_queue *rxq;
4989 uint32_t txdctl;
4990 uint32_t rxdctl;
4991 uint16_t i;
4992 int poll_ms;
4993
4994 PMD_INIT_FUNC_TRACE();
4995 hw = TXGBE_DEV_HW(dev);
4996
4997 for (i = 0; i < dev->data->nb_tx_queues; i++) {
4998 txq = dev->data->tx_queues[i];
4999 /* Setup Transmit Threshold Registers */
5000 wr32m(hw, TXGBE_TXCFG(txq->reg_idx),
5001 TXGBE_TXCFG_HTHRESH_MASK |
5002 TXGBE_TXCFG_WTHRESH_MASK,
5003 TXGBE_TXCFG_HTHRESH(txq->hthresh) |
5004 TXGBE_TXCFG_WTHRESH(txq->wthresh));
5005 }
5006
5007 for (i = 0; i < dev->data->nb_tx_queues; i++) {
5008 wr32m(hw, TXGBE_TXCFG(i), TXGBE_TXCFG_ENA, TXGBE_TXCFG_ENA);
5009
5010 poll_ms = 10;
5011 /* Wait until TX Enable ready */
5012 do {
5013 rte_delay_ms(1);
5014 txdctl = rd32(hw, TXGBE_TXCFG(i));
5015 } while (--poll_ms && !(txdctl & TXGBE_TXCFG_ENA));
5016 if (!poll_ms)
5017 PMD_INIT_LOG(ERR, "Could not enable Tx Queue %d", i);
5018 else
5019 dev->data->tx_queue_state[i] = RTE_ETH_QUEUE_STATE_STARTED;
5020 }
5021 for (i = 0; i < dev->data->nb_rx_queues; i++) {
5022 rxq = dev->data->rx_queues[i];
5023
5024 wr32m(hw, TXGBE_RXCFG(i), TXGBE_RXCFG_ENA, TXGBE_RXCFG_ENA);
5025
5026 /* Wait until RX Enable ready */
5027 poll_ms = 10;
5028 do {
5029 rte_delay_ms(1);
5030 rxdctl = rd32(hw, TXGBE_RXCFG(i));
5031 } while (--poll_ms && !(rxdctl & TXGBE_RXCFG_ENA));
5032 if (!poll_ms)
5033 PMD_INIT_LOG(ERR, "Could not enable Rx Queue %d", i);
5034 else
5035 dev->data->rx_queue_state[i] = RTE_ETH_QUEUE_STATE_STARTED;
5036 rte_wmb();
5037 wr32(hw, TXGBE_RXWP(i), rxq->nb_rx_desc - 1);
5038 }
5039}
5040

Callers 1

txgbevf_dev_startFunction · 0.85

Calls 4

rte_delay_msFunction · 0.85
wr32mFunction · 0.50
rd32Function · 0.50
wr32Function · 0.50

Tested by

no test coverage detected