MCPcopy Create free account
hub / github.com/F-Stack/f-stack / ngbe_dev_tx_init

Function ngbe_dev_tx_init

dpdk/drivers/net/ngbe/ngbe_rxtx.c:2978–3007  ·  view source on GitHub ↗

* Initializes Transmit Unit. */

Source from the content-addressed store, hash-verified

2976 * Initializes Transmit Unit.
2977 */
2978void
2979ngbe_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.

Callers 1

ngbe_dev_startFunction · 0.85

Calls 3

ngbe_dev_hwFunction · 0.85
wr32mFunction · 0.50
wr32Function · 0.50

Tested by

no test coverage detected