* [VF] Start Transmit and Receive Units. */
| 4981 | * [VF] Start Transmit and Receive Units. |
| 4982 | */ |
| 4983 | void __rte_cold |
| 4984 | txgbevf_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 |
no test coverage detected