* Start Transmit and Receive Units. */
| 5398 | * Start Transmit and Receive Units. |
| 5399 | */ |
| 5400 | int __rte_cold |
| 5401 | ixgbe_dev_rxtx_start(struct rte_eth_dev *dev) |
| 5402 | { |
| 5403 | struct ixgbe_hw *hw; |
| 5404 | struct ixgbe_tx_queue *txq; |
| 5405 | struct ixgbe_rx_queue *rxq; |
| 5406 | uint32_t txdctl; |
| 5407 | uint32_t dmatxctl; |
| 5408 | uint32_t rxctrl; |
| 5409 | uint16_t i; |
| 5410 | int ret = 0; |
| 5411 | |
| 5412 | PMD_INIT_FUNC_TRACE(); |
| 5413 | hw = IXGBE_DEV_PRIVATE_TO_HW(dev->data->dev_private); |
| 5414 | |
| 5415 | for (i = 0; i < dev->data->nb_tx_queues; i++) { |
| 5416 | txq = dev->data->tx_queues[i]; |
| 5417 | /* Setup Transmit Threshold Registers */ |
| 5418 | txdctl = IXGBE_READ_REG(hw, IXGBE_TXDCTL(txq->reg_idx)); |
| 5419 | txdctl |= txq->pthresh & 0x7F; |
| 5420 | txdctl |= ((txq->hthresh & 0x7F) << 8); |
| 5421 | txdctl |= ((txq->wthresh & 0x7F) << 16); |
| 5422 | IXGBE_WRITE_REG(hw, IXGBE_TXDCTL(txq->reg_idx), txdctl); |
| 5423 | } |
| 5424 | |
| 5425 | if (hw->mac.type != ixgbe_mac_82598EB) { |
| 5426 | dmatxctl = IXGBE_READ_REG(hw, IXGBE_DMATXCTL); |
| 5427 | dmatxctl |= IXGBE_DMATXCTL_TE; |
| 5428 | IXGBE_WRITE_REG(hw, IXGBE_DMATXCTL, dmatxctl); |
| 5429 | } |
| 5430 | |
| 5431 | for (i = 0; i < dev->data->nb_tx_queues; i++) { |
| 5432 | txq = dev->data->tx_queues[i]; |
| 5433 | if (!txq->tx_deferred_start) { |
| 5434 | ret = ixgbe_dev_tx_queue_start(dev, i); |
| 5435 | if (ret < 0) |
| 5436 | return ret; |
| 5437 | } |
| 5438 | } |
| 5439 | |
| 5440 | for (i = 0; i < dev->data->nb_rx_queues; i++) { |
| 5441 | rxq = dev->data->rx_queues[i]; |
| 5442 | if (!rxq->rx_deferred_start) { |
| 5443 | ret = ixgbe_dev_rx_queue_start(dev, i); |
| 5444 | if (ret < 0) |
| 5445 | return ret; |
| 5446 | } |
| 5447 | } |
| 5448 | |
| 5449 | /* Enable Receive engine */ |
| 5450 | rxctrl = IXGBE_READ_REG(hw, IXGBE_RXCTRL); |
| 5451 | if (hw->mac.type == ixgbe_mac_82598EB) |
| 5452 | rxctrl |= IXGBE_RXCTRL_DMBYPS; |
| 5453 | rxctrl |= IXGBE_RXCTRL_RXEN; |
| 5454 | hw->mac.ops.enable_rx_dma(hw, rxctrl); |
| 5455 | |
| 5456 | /* If loopback mode is enabled, set up the link accordingly */ |
| 5457 | if (dev->data->dev_conf.lpbk_mode != 0) { |
no test coverage detected