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

Function ionic_lif_txq_init

dpdk/drivers/net/ionic/ionic_lif.c:1568–1621  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1566}
1567
1568int
1569ionic_lif_txq_init(struct ionic_tx_qcq *txq)
1570{
1571 struct ionic_qcq *qcq = &txq->qcq;
1572 struct ionic_queue *q = &qcq->q;
1573 struct ionic_lif *lif = qcq->lif;
1574 struct ionic_cq *cq = &qcq->cq;
1575 struct ionic_admin_ctx ctx = {
1576 .pending_work = true,
1577 .cmd.q_init = {
1578 .opcode = IONIC_CMD_Q_INIT,
1579 .type = q->type,
1580 .ver = lif->qtype_info[q->type].version,
1581 .index = rte_cpu_to_le_32(q->index),
1582 .flags = rte_cpu_to_le_16(IONIC_QINIT_F_ENA),
1583 .intr_index = rte_cpu_to_le_16(IONIC_INTR_NONE),
1584 .ring_size = rte_log2_u32(q->num_descs),
1585 .ring_base = rte_cpu_to_le_64(q->base_pa),
1586 .cq_ring_base = rte_cpu_to_le_64(cq->base_pa),
1587 .sg_ring_base = rte_cpu_to_le_64(q->sg_base_pa),
1588 },
1589 };
1590 int err;
1591
1592 if (txq->flags & IONIC_QCQ_F_SG)
1593 ctx.cmd.q_init.flags |= rte_cpu_to_le_16(IONIC_QINIT_F_SG);
1594 if (txq->flags & IONIC_QCQ_F_CMB)
1595 ctx.cmd.q_init.flags |= rte_cpu_to_le_16(IONIC_QINIT_F_CMB);
1596
1597 IONIC_PRINT(DEBUG, "txq_init.index %d", q->index);
1598 IONIC_PRINT(DEBUG, "txq_init.ring_base 0x%" PRIx64 "", q->base_pa);
1599 IONIC_PRINT(DEBUG, "txq_init.ring_size %d",
1600 ctx.cmd.q_init.ring_size);
1601 IONIC_PRINT(DEBUG, "txq_init.ver %u", ctx.cmd.q_init.ver);
1602
1603 ionic_q_reset(q);
1604 ionic_cq_reset(cq);
1605
1606 err = ionic_adminq_post_wait(lif, &ctx);
1607 if (err)
1608 return err;
1609
1610 q->hw_type = ctx.comp.q_init.hw_type;
1611 q->hw_index = rte_le_to_cpu_32(ctx.comp.q_init.hw_index);
1612 q->db = ionic_db_map(lif, q);
1613
1614 IONIC_PRINT(DEBUG, "txq->hw_type %d", q->hw_type);
1615 IONIC_PRINT(DEBUG, "txq->hw_index %d", q->hw_index);
1616 IONIC_PRINT(DEBUG, "txq->db %p", q->db);
1617
1618 txq->flags |= IONIC_QCQ_F_INITED;
1619
1620 return 0;
1621}
1622
1623int
1624ionic_lif_rxq_init(struct ionic_rx_qcq *rxq)

Callers 1

ionic_dev_tx_queue_startFunction · 0.85

Calls 5

ionic_q_resetFunction · 0.85
ionic_cq_resetFunction · 0.85
ionic_adminq_post_waitFunction · 0.85
ionic_db_mapFunction · 0.85
rte_log2_u32Function · 0.50

Tested by

no test coverage detected