Skip to content

Commit

Permalink
net/bnxt: fix double allocation of ring groups
Browse files Browse the repository at this point in the history
[ upstream commit 36a97cd ]

After commit "d68249f88266", driver allocates ring groups in
bnxt_alloc_hwrm_rx_ring(). But during port start, driver invokes
bnxt_alloc_hwrm_rx_ring() followed by bnxt_alloc_all_hwrm_ring_grps().
This will cause the FW command failure in bnxt_alloc_all_hwrm_ring_grps()

To fix this, just don't create the ring group if it is already created.

Fixes: 9b63c6f ("net/bnxt: support Rx/Tx queue start/stop")

Signed-off-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Reviewed-by: Lance Richardson <lance.richardson@broadcom.com>
  • Loading branch information
Kalesh AP authored and cpaelzer committed Nov 30, 2021
1 parent 843921a commit 06ccbd7
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions drivers/net/bnxt/bnxt_hwrm.c
Expand Up @@ -1562,6 +1562,10 @@ int bnxt_hwrm_ring_grp_alloc(struct bnxt *bp, unsigned int idx)
struct hwrm_ring_grp_alloc_input req = {.req_type = 0 };
struct hwrm_ring_grp_alloc_output *resp = bp->hwrm_cmd_resp_addr;

/* Don't attempt to re-create the ring group if it is already created */
if (bp->grp_info[idx].fw_grp_id != INVALID_HW_RING_ID)
return 0;

HWRM_PREP(req, RING_GRP_ALLOC, BNXT_USE_CHIMP_MB);

req.cr = rte_cpu_to_le_16(bp->grp_info[idx].cp_fw_ring_id);
Expand Down

0 comments on commit 06ccbd7

Please sign in to comment.