* Start Receive Units for specified queue. */
| 4618 | * Start Receive Units for specified queue. |
| 4619 | */ |
| 4620 | int __rte_cold |
| 4621 | txgbe_dev_rx_queue_start(struct rte_eth_dev *dev, uint16_t rx_queue_id) |
| 4622 | { |
| 4623 | struct txgbe_hw *hw = TXGBE_DEV_HW(dev); |
| 4624 | struct txgbe_rx_queue *rxq; |
| 4625 | uint32_t rxdctl; |
| 4626 | int poll_ms; |
| 4627 | |
| 4628 | PMD_INIT_FUNC_TRACE(); |
| 4629 | |
| 4630 | rxq = dev->data->rx_queues[rx_queue_id]; |
| 4631 | |
| 4632 | /* Allocate buffers for descriptor rings */ |
| 4633 | if (txgbe_alloc_rx_queue_mbufs(rxq) != 0) { |
| 4634 | PMD_INIT_LOG(ERR, "Could not alloc mbuf for queue:%d", |
| 4635 | rx_queue_id); |
| 4636 | return -1; |
| 4637 | } |
| 4638 | rxdctl = rd32(hw, TXGBE_RXCFG(rxq->reg_idx)); |
| 4639 | rxdctl |= TXGBE_RXCFG_ENA; |
| 4640 | wr32(hw, TXGBE_RXCFG(rxq->reg_idx), rxdctl); |
| 4641 | |
| 4642 | /* Wait until RX Enable ready */ |
| 4643 | poll_ms = RTE_TXGBE_REGISTER_POLL_WAIT_10_MS; |
| 4644 | do { |
| 4645 | rte_delay_ms(1); |
| 4646 | rxdctl = rd32(hw, TXGBE_RXCFG(rxq->reg_idx)); |
| 4647 | } while (--poll_ms && !(rxdctl & TXGBE_RXCFG_ENA)); |
| 4648 | if (!poll_ms) |
| 4649 | PMD_INIT_LOG(ERR, "Could not enable Rx Queue %d", rx_queue_id); |
| 4650 | rte_wmb(); |
| 4651 | wr32(hw, TXGBE_RXRP(rxq->reg_idx), 0); |
| 4652 | wr32(hw, TXGBE_RXWP(rxq->reg_idx), rxq->nb_rx_desc - 1); |
| 4653 | dev->data->rx_queue_state[rx_queue_id] = RTE_ETH_QUEUE_STATE_STARTED; |
| 4654 | |
| 4655 | return 0; |
| 4656 | } |
| 4657 | |
| 4658 | /* |
| 4659 | * Stop Receive Units for specified queue. |
no test coverage detected