* Initializes Transmit Unit. */
| 4460 | * Initializes Transmit Unit. |
| 4461 | */ |
| 4462 | void __rte_cold |
| 4463 | txgbe_dev_tx_init(struct rte_eth_dev *dev) |
| 4464 | { |
| 4465 | struct txgbe_hw *hw; |
| 4466 | struct txgbe_tx_queue *txq; |
| 4467 | uint64_t bus_addr; |
| 4468 | uint16_t i; |
| 4469 | |
| 4470 | PMD_INIT_FUNC_TRACE(); |
| 4471 | hw = TXGBE_DEV_HW(dev); |
| 4472 | |
| 4473 | /* Setup the Base and Length of the Tx Descriptor Rings */ |
| 4474 | for (i = 0; i < dev->data->nb_tx_queues; i++) { |
| 4475 | txq = dev->data->tx_queues[i]; |
| 4476 | |
| 4477 | bus_addr = txq->tx_ring_phys_addr; |
| 4478 | wr32(hw, TXGBE_TXBAL(txq->reg_idx), |
| 4479 | (uint32_t)(bus_addr & BIT_MASK32)); |
| 4480 | wr32(hw, TXGBE_TXBAH(txq->reg_idx), |
| 4481 | (uint32_t)(bus_addr >> 32)); |
| 4482 | wr32m(hw, TXGBE_TXCFG(txq->reg_idx), TXGBE_TXCFG_BUFLEN_MASK, |
| 4483 | TXGBE_TXCFG_BUFLEN(txq->nb_tx_desc)); |
| 4484 | /* Setup the HW Tx Head and TX Tail descriptor pointers */ |
| 4485 | wr32(hw, TXGBE_TXRP(txq->reg_idx), 0); |
| 4486 | wr32(hw, TXGBE_TXWP(txq->reg_idx), 0); |
| 4487 | } |
| 4488 | |
| 4489 | /* Device configured with multiple TX queues. */ |
| 4490 | txgbe_dev_mq_tx_configure(dev); |
| 4491 | } |
| 4492 | |
| 4493 | /* |
| 4494 | * Set up link loopback mode Tx->Rx. |
no test coverage detected