* Initializes Transmit Unit. */
| 2976 | * Initializes Transmit Unit. |
| 2977 | */ |
| 2978 | void |
| 2979 | ngbe_dev_tx_init(struct rte_eth_dev *dev) |
| 2980 | { |
| 2981 | struct ngbe_hw *hw; |
| 2982 | struct ngbe_tx_queue *txq; |
| 2983 | uint64_t bus_addr; |
| 2984 | uint16_t i; |
| 2985 | |
| 2986 | PMD_INIT_FUNC_TRACE(); |
| 2987 | hw = ngbe_dev_hw(dev); |
| 2988 | |
| 2989 | wr32m(hw, NGBE_SECTXCTL, NGBE_SECTXCTL_ODSA, NGBE_SECTXCTL_ODSA); |
| 2990 | wr32m(hw, NGBE_SECTXCTL, NGBE_SECTXCTL_XDSA, 0); |
| 2991 | |
| 2992 | /* Setup the Base and Length of the Tx Descriptor Rings */ |
| 2993 | for (i = 0; i < dev->data->nb_tx_queues; i++) { |
| 2994 | txq = dev->data->tx_queues[i]; |
| 2995 | |
| 2996 | bus_addr = txq->tx_ring_phys_addr; |
| 2997 | wr32(hw, NGBE_TXBAL(txq->reg_idx), |
| 2998 | (uint32_t)(bus_addr & BIT_MASK32)); |
| 2999 | wr32(hw, NGBE_TXBAH(txq->reg_idx), |
| 3000 | (uint32_t)(bus_addr >> 32)); |
| 3001 | wr32m(hw, NGBE_TXCFG(txq->reg_idx), NGBE_TXCFG_BUFLEN_MASK, |
| 3002 | NGBE_TXCFG_BUFLEN(txq->nb_tx_desc)); |
| 3003 | /* Setup the HW Tx Head and TX Tail descriptor pointers */ |
| 3004 | wr32(hw, NGBE_TXRP(txq->reg_idx), 0); |
| 3005 | wr32(hw, NGBE_TXWP(txq->reg_idx), 0); |
| 3006 | } |
| 3007 | } |
| 3008 | |
| 3009 | /* |
| 3010 | * Set up link loopback mode Tx->Rx. |
no test coverage detected