* Perform one-time initialization of descriptor fields * which will not change for the life of the queue. */
| 644 | * which will not change for the life of the queue. |
| 645 | */ |
| 646 | static void __rte_cold |
| 647 | ionic_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. |
no outgoing calls
no test coverage detected