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

Function ionic_rx_init_descriptors

dpdk/drivers/net/ionic/ionic_rxtx.c:646–672  ·  view source on GitHub ↗

* Perform one-time initialization of descriptor fields * which will not change for the life of the queue. */

Source from the content-addressed store, hash-verified

644 * which will not change for the life of the queue.
645 */
646static void __rte_cold
647ionic_rx_init_descriptors(struct ionic_rx_qcq *rxq)
648{
649 struct ionic_queue *q = &rxq->qcq.q;
650 struct ionic_rxq_desc *desc, *desc_base = q->base;
651 struct ionic_rxq_sg_desc *sg_desc, *sg_desc_base = q->sg_base;
652 uint32_t i, j;
653 uint8_t opcode;
654
655 opcode = (q->num_segs > 1) ?
656 IONIC_RXQ_DESC_OPCODE_SG : IONIC_RXQ_DESC_OPCODE_SIMPLE;
657
658 /*
659 * NB: Only the first segment needs to leave headroom (hdr_seg_size).
660 * Later segments (seg_size) do not.
661 */
662 for (i = 0; i < q->num_descs; i++) {
663 desc = &desc_base[i];
664 desc->len = rte_cpu_to_le_16(rxq->hdr_seg_size);
665 desc->opcode = opcode;
666
667 sg_desc = &sg_desc_base[i];
668 for (j = 0; j < q->num_segs - 1u; j++)
669 sg_desc->elems[j].len =
670 rte_cpu_to_le_16(rxq->seg_size);
671 }
672}
673
674/*
675 * Start Receive Units for specified queue.

Callers 1

ionic_dev_rx_queue_startFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected