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

Function bnxt_alloc_ring_grps

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

Source from the content-addressed store, hash-verified

48}
49
50int bnxt_alloc_ring_grps(struct bnxt *bp)
51{
52 if (bp->max_tx_rings == 0) {
53 PMD_DRV_LOG(ERR, "No TX rings available!\n");
54 return -EBUSY;
55 }
56
57 /* P5 does not support ring groups.
58 * But we will use the array to save RSS context IDs.
59 */
60 if (BNXT_CHIP_P5(bp)) {
61 bp->max_ring_grps = BNXT_MAX_RSS_CTXTS_P5;
62 } else if (bp->max_ring_grps < bp->rx_cp_nr_rings) {
63 /* 1 ring is for default completion ring */
64 PMD_DRV_LOG(ERR, "Insufficient resource: Ring Group\n");
65 return -ENOSPC;
66 }
67
68 if (BNXT_HAS_RING_GRPS(bp)) {
69 bp->grp_info = rte_zmalloc("bnxt_grp_info",
70 sizeof(*bp->grp_info) *
71 bp->max_ring_grps, 0);
72 if (!bp->grp_info) {
73 PMD_DRV_LOG(ERR,
74 "Failed to alloc grp info tbl.\n");
75 return -ENOMEM;
76 }
77 bnxt_init_ring_grps(bp);
78 }
79
80 return 0;
81}
82
83/*
84 * Allocates a completion ring with vmem and stats optionally also allocating

Callers 1

bnxt_alloc_memFunction · 0.85

Calls 2

rte_zmallocFunction · 0.85
bnxt_init_ring_grpsFunction · 0.85

Tested by

no test coverage detected