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

Function txgbe_dev_tx_init

dpdk/drivers/net/txgbe/txgbe_rxtx.c:4462–4491  ·  view source on GitHub ↗

* Initializes Transmit Unit. */

Source from the content-addressed store, hash-verified

4460 * Initializes Transmit Unit.
4461 */
4462void __rte_cold
4463txgbe_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.

Callers 1

txgbe_dev_startFunction · 0.85

Calls 3

wr32Function · 0.50
wr32mFunction · 0.50

Tested by

no test coverage detected