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

Function bnxt_alloc_async_cp_ring

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

Allocate dedicated async completion ring. */

Source from the content-addressed store, hash-verified

772
773/* Allocate dedicated async completion ring. */
774int bnxt_alloc_async_cp_ring(struct bnxt *bp)
775{
776 struct bnxt_cp_ring_info *cpr = bp->async_cp_ring;
777 struct bnxt_ring *cp_ring;
778 uint8_t ring_type;
779 int rc;
780
781 if (BNXT_NUM_ASYNC_CPR(bp) == 0 || cpr == NULL)
782 return 0;
783
784 cp_ring = cpr->cp_ring_struct;
785
786 if (BNXT_HAS_NQ(bp))
787 ring_type = HWRM_RING_ALLOC_INPUT_RING_TYPE_NQ;
788 else
789 ring_type = HWRM_RING_ALLOC_INPUT_RING_TYPE_L2_CMPL;
790
791 rc = bnxt_hwrm_ring_alloc(bp, cp_ring, ring_type, 0,
792 HWRM_NA_SIGNATURE, HWRM_NA_SIGNATURE, 0);
793
794 if (rc)
795 return rc;
796
797 cpr->cp_raw_cons = 0;
798 bnxt_set_db(bp, &cpr->cp_db, ring_type, 0,
799 cp_ring->fw_ring_id, cp_ring->ring_mask);
800
801 if (BNXT_HAS_NQ(bp))
802 bnxt_db_nq(cpr);
803 else
804 bnxt_db_cq(cpr);
805
806 return bnxt_hwrm_set_async_event_cr(bp);
807}
808
809/* Free dedicated async completion ring. */
810void bnxt_free_async_cp_ring(struct bnxt *bp)

Callers 2

bnxt_alloc_memFunction · 0.85
bnxt_dev_configure_opFunction · 0.85

Calls 5

bnxt_hwrm_ring_allocFunction · 0.85
bnxt_set_dbFunction · 0.85
bnxt_db_nqFunction · 0.85
bnxt_db_cqFunction · 0.85

Tested by

no test coverage detected