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

Function bnxt_alloc_async_ring_struct

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

Source from the content-addressed store, hash-verified

827}
828
829int bnxt_alloc_async_ring_struct(struct bnxt *bp)
830{
831 struct bnxt_cp_ring_info *cpr = NULL;
832 struct bnxt_ring *ring = NULL;
833
834 if (BNXT_NUM_ASYNC_CPR(bp) == 0)
835 return 0;
836
837 cpr = rte_zmalloc_socket("cpr",
838 sizeof(struct bnxt_cp_ring_info),
839 RTE_CACHE_LINE_SIZE,
840 bp->eth_dev->device->numa_node);
841 if (cpr == NULL)
842 return -ENOMEM;
843
844 ring = rte_zmalloc_socket("bnxt_cp_ring_struct",
845 sizeof(struct bnxt_ring),
846 RTE_CACHE_LINE_SIZE,
847 bp->eth_dev->device->numa_node);
848 if (ring == NULL) {
849 rte_free(cpr);
850 return -ENOMEM;
851 }
852
853 ring->bd = (void *)cpr->cp_desc_ring;
854 ring->bd_dma = cpr->cp_desc_mapping;
855 ring->ring_size = rte_align32pow2(DEFAULT_CP_RING_SIZE);
856 ring->ring_mask = ring->ring_size - 1;
857 ring->vmem_size = 0;
858 ring->vmem = NULL;
859 ring->fw_ring_id = INVALID_HW_RING_ID;
860
861 bp->async_cp_ring = cpr;
862 cpr->cp_ring_struct = ring;
863
864 return bnxt_alloc_rings(bp, bp->eth_dev->device->numa_node, 0, NULL,
865 NULL, bp->async_cp_ring, NULL, "def_cp");
866}
867
868int bnxt_alloc_hwrm_tx_ring(struct bnxt *bp, int queue_index)
869{

Callers 1

bnxt_alloc_memFunction · 0.85

Calls 4

rte_zmalloc_socketFunction · 0.85
rte_freeFunction · 0.85
bnxt_alloc_ringsFunction · 0.85
rte_align32pow2Function · 0.50

Tested by

no test coverage detected