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

Function bnxt_init_all_rings

dpdk/drivers/net/bnxt/bnxt_ring.c:681–715  ·  view source on GitHub ↗

Initialise all rings to -1, its used to free rings later if allocation * of few rings fails. */

Source from the content-addressed store, hash-verified

679 * of few rings fails.
680 */
681static void bnxt_init_all_rings(struct bnxt *bp)
682{
683 unsigned int i = 0;
684 struct bnxt_rx_queue *rxq;
685 struct bnxt_ring *cp_ring;
686 struct bnxt_ring *ring;
687 struct bnxt_rx_ring_info *rxr;
688 struct bnxt_tx_queue *txq;
689
690 for (i = 0; i < bp->rx_cp_nr_rings; i++) {
691 rxq = bp->rx_queues[i];
692 /* Rx-compl */
693 cp_ring = rxq->cp_ring->cp_ring_struct;
694 cp_ring->fw_ring_id = INVALID_HW_RING_ID;
695 /* Rx-Reg */
696 rxr = rxq->rx_ring;
697 ring = rxr->rx_ring_struct;
698 ring->fw_ring_id = INVALID_HW_RING_ID;
699 /* Rx-AGG */
700 if (bnxt_need_agg_ring(bp->eth_dev)) {
701 ring = rxr->ag_ring_struct;
702 if (ring != NULL)
703 ring->fw_ring_id = INVALID_HW_RING_ID;
704 }
705 }
706 for (i = 0; i < bp->tx_cp_nr_rings; i++) {
707 txq = bp->tx_queues[i];
708 /* Tx cmpl */
709 cp_ring = txq->cp_ring->cp_ring_struct;
710 cp_ring->fw_ring_id = INVALID_HW_RING_ID;
711 /*Tx Ring */
712 ring = txq->tx_ring->tx_ring_struct;
713 ring->fw_ring_id = INVALID_HW_RING_ID;
714 }
715}
716
717/* ring_grp usage:
718 * [0] = default completion ring

Callers 1

bnxt_alloc_hwrm_ringsFunction · 0.85

Calls 1

bnxt_need_agg_ringFunction · 0.85

Tested by

no test coverage detected