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

Function ionic_lif_rxq_init

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

Source from the content-addressed store, hash-verified

1621}
1622
1623int
1624ionic_lif_rxq_init(struct ionic_rx_qcq *rxq)
1625{
1626 struct ionic_qcq *qcq = &rxq->qcq;
1627 struct ionic_queue *q = &qcq->q;
1628 struct ionic_lif *lif = qcq->lif;
1629 struct ionic_cq *cq = &qcq->cq;
1630 struct ionic_admin_ctx ctx = {
1631 .pending_work = true,
1632 .cmd.q_init = {
1633 .opcode = IONIC_CMD_Q_INIT,
1634 .type = q->type,
1635 .ver = lif->qtype_info[q->type].version,
1636 .index = rte_cpu_to_le_32(q->index),
1637 .flags = rte_cpu_to_le_16(IONIC_QINIT_F_ENA),
1638 .intr_index = rte_cpu_to_le_16(IONIC_INTR_NONE),
1639 .ring_size = rte_log2_u32(q->num_descs),
1640 .ring_base = rte_cpu_to_le_64(q->base_pa),
1641 .cq_ring_base = rte_cpu_to_le_64(cq->base_pa),
1642 .sg_ring_base = rte_cpu_to_le_64(q->sg_base_pa),
1643 },
1644 };
1645 int err;
1646
1647 if (rxq->flags & IONIC_QCQ_F_SG)
1648 ctx.cmd.q_init.flags |= rte_cpu_to_le_16(IONIC_QINIT_F_SG);
1649 if (rxq->flags & IONIC_QCQ_F_CMB)
1650 ctx.cmd.q_init.flags |= rte_cpu_to_le_16(IONIC_QINIT_F_CMB);
1651
1652 IONIC_PRINT(DEBUG, "rxq_init.index %d", q->index);
1653 IONIC_PRINT(DEBUG, "rxq_init.ring_base 0x%" PRIx64 "", q->base_pa);
1654 IONIC_PRINT(DEBUG, "rxq_init.ring_size %d",
1655 ctx.cmd.q_init.ring_size);
1656 IONIC_PRINT(DEBUG, "rxq_init.ver %u", ctx.cmd.q_init.ver);
1657
1658 ionic_q_reset(q);
1659 ionic_cq_reset(cq);
1660
1661 err = ionic_adminq_post_wait(lif, &ctx);
1662 if (err)
1663 return err;
1664
1665 q->hw_type = ctx.comp.q_init.hw_type;
1666 q->hw_index = rte_le_to_cpu_32(ctx.comp.q_init.hw_index);
1667 q->db = ionic_db_map(lif, q);
1668
1669 rxq->flags |= IONIC_QCQ_F_INITED;
1670
1671 IONIC_PRINT(DEBUG, "rxq->hw_type %d", q->hw_type);
1672 IONIC_PRINT(DEBUG, "rxq->hw_index %d", q->hw_index);
1673 IONIC_PRINT(DEBUG, "rxq->db %p", q->db);
1674
1675 return 0;
1676}
1677
1678static int
1679ionic_station_set(struct ionic_lif *lif)

Callers 1

ionic_dev_rx_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