{
int rc;
- rc = bnxt_init_ring_grps(bp);
- if (rc)
- return rc;
+ if (BNXT_HAS_RING_GRPS(bp)) {
+ rc = bnxt_init_ring_grps(bp);
+ if (rc)
+ return rc;
+ }
bnxt_init_vnics(bp);
bnxt_init_filters(bp);
goto error_free;
}
- bp->grp_info = rte_zmalloc("bnxt_grp_info",
- sizeof(*bp->grp_info) * bp->max_ring_grps, 0);
- if (!bp->grp_info) {
- PMD_DRV_LOG(ERR,
- "Failed to alloc %zu bytes to store group info table\n",
- sizeof(*bp->grp_info) * bp->max_ring_grps);
- rc = -ENOMEM;
- goto error_free;
+ if (BNXT_HAS_RING_GRPS(bp)) {
+ bp->grp_info = rte_zmalloc("bnxt_grp_info",
+ sizeof(*bp->grp_info) *
+ bp->max_ring_grps, 0);
+ if (!bp->grp_info) {
+ PMD_DRV_LOG(ERR,
+ "Failed to alloc %zu bytes for grp info tbl.\n",
+ sizeof(*bp->grp_info) * bp->max_ring_grps);
+ rc = -ENOMEM;
+ goto error_free;
+ }
}
/* Forward all requests if firmware is new enough */
cpr = bp->tx_queues[i - bp->rx_cp_nr_rings]->cp_ring;
} else {
cpr = bp->rx_queues[i]->cp_ring;
- bp->grp_info[i].fw_stats_ctx = -1;
+ if (BNXT_HAS_RING_GRPS(bp))
+ bp->grp_info[i].fw_stats_ctx = -1;
}
if (cpr->hw_stats_ctx_id != HWRM_NA_SIGNATURE) {
rc = bnxt_hwrm_stat_ctx_free(bp, cpr, i);
bnxt_hwrm_ring_free(bp, ring,
HWRM_RING_FREE_INPUT_RING_TYPE_RX);
ring->fw_ring_id = INVALID_HW_RING_ID;
- bp->grp_info[queue_index].rx_fw_ring_id = INVALID_HW_RING_ID;
+ if (BNXT_HAS_RING_GRPS(bp))
+ bp->grp_info[queue_index].rx_fw_ring_id =
+ INVALID_HW_RING_ID;
memset(rxr->rx_desc_ring, 0,
rxr->rx_ring_struct->ring_size *
sizeof(*rxr->rx_desc_ring));
rxr->ag_ring_struct->ring_size *
sizeof(*rxr->ag_buf_ring));
rxr->ag_prod = 0;
- bp->grp_info[queue_index].ag_fw_ring_id = INVALID_HW_RING_ID;
+ if (BNXT_HAS_RING_GRPS(bp))
+ bp->grp_info[queue_index].ag_fw_ring_id =
+ INVALID_HW_RING_ID;
}
if (cpr->cp_ring_struct->fw_ring_id != INVALID_HW_RING_ID) {
bnxt_free_cp_ring(bp, cpr);
bnxt_free_nq_ring(bp, rxq->nq_ring);
}
- bp->grp_info[queue_index].cp_fw_ring_id = INVALID_HW_RING_ID;
+ if (BNXT_HAS_RING_GRPS(bp))
+ bp->grp_info[queue_index].cp_fw_ring_id = INVALID_HW_RING_ID;
}
int bnxt_free_all_hwrm_rings(struct bnxt *bp)
}
static int bnxt_alloc_nq_ring(struct bnxt *bp, int queue_index,
- struct bnxt_cp_ring_info *nqr,
- bool rx)
+ struct bnxt_cp_ring_info *nqr)
{
struct bnxt_ring *nq_ring = nqr->cp_ring_struct;
uint8_t ring_type;
if (rc)
return rc;
- if (rx)
- bp->grp_info[queue_index].cp_fw_ring_id = nq_ring->fw_ring_id;
-
bnxt_set_db(bp, &nqr->cp_db, ring_type, queue_index,
nq_ring->fw_ring_id);
bnxt_db_nq(nqr);
return rc;
rxr->rx_prod = 0;
- bp->grp_info[queue_index].rx_fw_ring_id = ring->fw_ring_id;
+ if (BNXT_HAS_RING_GRPS(bp))
+ bp->grp_info[queue_index].rx_fw_ring_id = ring->fw_ring_id;
bnxt_set_db(bp, &rxr->rx_db, ring_type, queue_index, ring->fw_ring_id);
bnxt_db_write(&rxr->rx_db, rxr->rx_prod);
return rc;
rxr->ag_prod = 0;
- bp->grp_info[queue_index].ag_fw_ring_id = ring->fw_ring_id;
+ if (BNXT_HAS_RING_GRPS(bp))
+ bp->grp_info[queue_index].ag_fw_ring_id = ring->fw_ring_id;
bnxt_set_db(bp, &rxr->ag_db, ring_type, map_idx, ring->fw_ring_id);
bnxt_db_write(&rxr->ag_db, rxr->ag_prod);
int rc = 0;
if (BNXT_HAS_NQ(bp)) {
- if (bnxt_alloc_nq_ring(bp, queue_index, nqr, true))
+ if (bnxt_alloc_nq_ring(bp, queue_index, nqr))
goto err_out;
}
if (bnxt_alloc_cmpl_ring(bp, queue_index, cpr, nqr))
goto err_out;
- bp->grp_info[queue_index].fw_stats_ctx = cpr->hw_stats_ctx_id;
- bp->grp_info[queue_index].cp_fw_ring_id = cp_ring->fw_ring_id;
+ if (BNXT_HAS_RING_GRPS(bp)) {
+ bp->grp_info[queue_index].fw_stats_ctx = cpr->hw_stats_ctx_id;
+ bp->grp_info[queue_index].cp_fw_ring_id = cp_ring->fw_ring_id;
+ }
if (!queue_index) {
/*
struct bnxt_rx_ring_info *rxr = rxq->rx_ring;
if (BNXT_HAS_NQ(bp)) {
- if (bnxt_alloc_nq_ring(bp, i, nqr, true))
+ if (bnxt_alloc_nq_ring(bp, i, nqr))
goto err_out;
}
if (bnxt_alloc_cmpl_ring(bp, i, cpr, nqr))
goto err_out;
- bp->grp_info[i].fw_stats_ctx = cpr->hw_stats_ctx_id;
- bp->grp_info[i].cp_fw_ring_id = cp_ring->fw_ring_id;
+ if (BNXT_HAS_RING_GRPS(bp)) {
+ bp->grp_info[i].fw_stats_ctx = cpr->hw_stats_ctx_id;
+ bp->grp_info[i].cp_fw_ring_id = cp_ring->fw_ring_id;
+ }
bnxt_hwrm_set_ring_coal(bp, &coal, cp_ring->fw_ring_id);
unsigned int idx = i + bp->rx_cp_nr_rings;
if (BNXT_HAS_NQ(bp)) {
- if (bnxt_alloc_nq_ring(bp, idx, nqr, false))
+ if (bnxt_alloc_nq_ring(bp, idx, nqr))
goto err_out;
}