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

Function bnxt_alloc_hwrm_rings

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

ring_grp usage: * [0] = default completion ring * [1 -> +rx_cp_nr_rings] = rx_cp, rx rings * [1+rx_cp_nr_rings + 1 -> +tx_cp_nr_rings] = tx_cp, tx rings */

Source from the content-addressed store, hash-verified

720 * [1+rx_cp_nr_rings + 1 -> +tx_cp_nr_rings] = tx_cp, tx rings
721 */
722int bnxt_alloc_hwrm_rings(struct bnxt *bp)
723{
724 struct bnxt_coal coal;
725 unsigned int i;
726 int rc = 0;
727
728 bnxt_init_dflt_coal(&coal);
729 bnxt_init_all_rings(bp);
730
731 for (i = 0; i < bp->rx_cp_nr_rings; i++) {
732 unsigned int soc_id = bp->eth_dev->device->numa_node;
733 struct bnxt_rx_queue *rxq = bp->rx_queues[i];
734 struct bnxt_rx_ring_info *rxr = rxq->rx_ring;
735 struct bnxt_ring *ring;
736
737 if (bnxt_need_agg_ring(bp->eth_dev)) {
738 ring = rxr->ag_ring_struct;
739 if (ring == NULL) {
740 bnxt_free_rxq_mem(rxq);
741
742 rc = bnxt_init_rx_ring_struct(rxq, soc_id);
743 if (rc)
744 goto err_out;
745
746 rc = bnxt_alloc_rings(bp, soc_id,
747 i, NULL, rxq,
748 rxq->cp_ring, NULL,
749 "rxr");
750 if (rc)
751 goto err_out;
752 }
753 }
754
755 rc = bnxt_alloc_hwrm_rx_ring(bp, i);
756 if (rc)
757 goto err_out;
758 bnxt_hwrm_set_ring_coal(bp, &coal,
759 rxq->cp_ring->cp_ring_struct->fw_ring_id);
760 }
761
762 /* If something is wrong with Rx ring alloc, skip Tx ring alloc */
763 for (i = 0; i < bp->tx_cp_nr_rings; i++) {
764 rc = bnxt_alloc_hwrm_tx_ring(bp, i);
765 if (rc)
766 goto err_out;
767 }
768
769err_out:
770 return rc;
771}
772
773/* Allocate dedicated async completion ring. */
774int bnxt_alloc_async_cp_ring(struct bnxt *bp)

Callers 1

bnxt_start_nicFunction · 0.85

Calls 9

bnxt_init_dflt_coalFunction · 0.85
bnxt_init_all_ringsFunction · 0.85
bnxt_need_agg_ringFunction · 0.85
bnxt_free_rxq_memFunction · 0.85
bnxt_init_rx_ring_structFunction · 0.85
bnxt_alloc_ringsFunction · 0.85
bnxt_alloc_hwrm_rx_ringFunction · 0.85
bnxt_hwrm_set_ring_coalFunction · 0.85
bnxt_alloc_hwrm_tx_ringFunction · 0.85

Tested by

no test coverage detected