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

Function ionic_dev_rx_queue_start

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

* Start Receive Units for specified queue. */

Source from the content-addressed store, hash-verified

675 * Start Receive Units for specified queue.
676 */
677int __rte_cold
678ionic_dev_rx_queue_start(struct rte_eth_dev *eth_dev, uint16_t rx_queue_id)
679{
680 uint8_t *rx_queue_state = eth_dev->data->rx_queue_state;
681 struct ionic_rx_qcq *rxq;
682 struct ionic_queue *q;
683 int err;
684
685 if (rx_queue_state[rx_queue_id] == RTE_ETH_QUEUE_STATE_STARTED) {
686 IONIC_PRINT(DEBUG, "RX queue %u already started",
687 rx_queue_id);
688 return 0;
689 }
690
691 rxq = eth_dev->data->rx_queues[rx_queue_id];
692 q = &rxq->qcq.q;
693
694 rxq->frame_size = rxq->qcq.lif->frame_size - RTE_ETHER_CRC_LEN;
695
696 /* Recalculate segment count based on MTU */
697 q->num_segs = 1 +
698 (rxq->frame_size + RTE_PKTMBUF_HEADROOM - 1) / rxq->seg_size;
699
700 IONIC_PRINT(DEBUG, "Starting RX queue %u, %u descs, size %u segs %u",
701 rx_queue_id, q->num_descs, rxq->frame_size, q->num_segs);
702
703 ionic_rx_init_descriptors(rxq);
704
705 err = ionic_lif_rxq_init(rxq);
706 if (err)
707 return err;
708
709 /* Allocate buffers for descriptor ring */
710 if (rxq->flags & IONIC_QCQ_F_SG)
711 err = ionic_rx_fill_sg(rxq);
712 else
713 err = ionic_rx_fill(rxq);
714 if (err != 0) {
715 IONIC_PRINT(ERR, "Could not fill queue %d", rx_queue_id);
716 return -1;
717 }
718
719 rx_queue_state[rx_queue_id] = RTE_ETH_QUEUE_STATE_STARTED;
720
721 return 0;
722}
723
724/*
725 * Stop Receive Units for specified queue.

Callers 1

ionic_lif_startFunction · 0.85

Calls 4

ionic_lif_rxq_initFunction · 0.85
ionic_rx_fill_sgFunction · 0.85
ionic_rx_fillFunction · 0.85

Tested by

no test coverage detected