* [VF] Start Transmit and Receive Units. */
| 5914 | * [VF] Start Transmit and Receive Units. |
| 5915 | */ |
| 5916 | void __rte_cold |
| 5917 | ixgbevf_dev_rxtx_start(struct rte_eth_dev *dev) |
| 5918 | { |
| 5919 | struct ixgbe_hw *hw; |
| 5920 | struct ixgbe_tx_queue *txq; |
| 5921 | struct ixgbe_rx_queue *rxq; |
| 5922 | uint32_t txdctl; |
| 5923 | uint32_t rxdctl; |
| 5924 | uint16_t i; |
| 5925 | int poll_ms; |
| 5926 | |
| 5927 | PMD_INIT_FUNC_TRACE(); |
| 5928 | hw = IXGBE_DEV_PRIVATE_TO_HW(dev->data->dev_private); |
| 5929 | |
| 5930 | for (i = 0; i < dev->data->nb_tx_queues; i++) { |
| 5931 | txq = dev->data->tx_queues[i]; |
| 5932 | /* Setup Transmit Threshold Registers */ |
| 5933 | txdctl = IXGBE_READ_REG(hw, IXGBE_VFTXDCTL(i)); |
| 5934 | txdctl |= txq->pthresh & 0x7F; |
| 5935 | txdctl |= ((txq->hthresh & 0x7F) << 8); |
| 5936 | txdctl |= ((txq->wthresh & 0x7F) << 16); |
| 5937 | IXGBE_WRITE_REG(hw, IXGBE_VFTXDCTL(i), txdctl); |
| 5938 | } |
| 5939 | |
| 5940 | for (i = 0; i < dev->data->nb_tx_queues; i++) { |
| 5941 | |
| 5942 | txdctl = IXGBE_READ_REG(hw, IXGBE_VFTXDCTL(i)); |
| 5943 | txdctl |= IXGBE_TXDCTL_ENABLE; |
| 5944 | IXGBE_WRITE_REG(hw, IXGBE_VFTXDCTL(i), txdctl); |
| 5945 | |
| 5946 | poll_ms = 10; |
| 5947 | /* Wait until TX Enable ready */ |
| 5948 | do { |
| 5949 | rte_delay_ms(1); |
| 5950 | txdctl = IXGBE_READ_REG(hw, IXGBE_VFTXDCTL(i)); |
| 5951 | } while (--poll_ms && !(txdctl & IXGBE_TXDCTL_ENABLE)); |
| 5952 | if (!poll_ms) |
| 5953 | PMD_INIT_LOG(ERR, "Could not enable Tx Queue %d", i); |
| 5954 | else |
| 5955 | dev->data->tx_queue_state[i] = RTE_ETH_QUEUE_STATE_STARTED; |
| 5956 | } |
| 5957 | for (i = 0; i < dev->data->nb_rx_queues; i++) { |
| 5958 | |
| 5959 | rxq = dev->data->rx_queues[i]; |
| 5960 | |
| 5961 | rxdctl = IXGBE_READ_REG(hw, IXGBE_VFRXDCTL(i)); |
| 5962 | rxdctl |= IXGBE_RXDCTL_ENABLE; |
| 5963 | IXGBE_WRITE_REG(hw, IXGBE_VFRXDCTL(i), rxdctl); |
| 5964 | |
| 5965 | /* Wait until RX Enable ready */ |
| 5966 | poll_ms = 10; |
| 5967 | do { |
| 5968 | rte_delay_ms(1); |
| 5969 | rxdctl = IXGBE_READ_REG(hw, IXGBE_VFRXDCTL(i)); |
| 5970 | } while (--poll_ms && !(rxdctl & IXGBE_RXDCTL_ENABLE)); |
| 5971 | if (!poll_ms) |
| 5972 | PMD_INIT_LOG(ERR, "Could not enable Rx Queue %d", i); |
| 5973 | else |
no test coverage detected