hwrm_ring_free_send_msg() reports failure to its caller, returning -EIO when the firmware rejects HWRM_RING_FREE or never answers it. All three ring free helpers that send the command discard the value. Return it instead. No caller acts on it yet, so there is no functional change. Fixes: 74608fc98d28 ("bnxt_en: Ring free response from close path should use completion ring") Signed-off-by: Joe Damato --- drivers/net/ethernet/broadcom/bnxt/bnxt.c | 48 +++++++++++++---------- 1 file changed, 27 insertions(+), 21 deletions(-) diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt.c b/drivers/net/ethernet/broadcom/bnxt/bnxt.c index 33c4cacc8ffe..ea8529c78994 100644 --- a/drivers/net/ethernet/broadcom/bnxt/bnxt.c +++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.c @@ -7679,50 +7679,55 @@ static int hwrm_ring_free_send_msg(struct bnxt *bp, return 0; } -static void bnxt_hwrm_tx_ring_free(struct bnxt *bp, - struct bnxt_tx_ring_info *txr, - bool close_path) +static int bnxt_hwrm_tx_ring_free(struct bnxt *bp, + struct bnxt_tx_ring_info *txr, + bool close_path) { struct bnxt_ring_struct *ring = &txr->tx_ring_struct; u32 cmpl_ring_id; + int rc; if (ring->fw_ring_id == INVALID_HW_RING_ID) - return; + return 0; cmpl_ring_id = close_path ? bnxt_cp_ring_for_tx(bp, txr) : INVALID_HW_RING_ID; - hwrm_ring_free_send_msg(bp, ring, RING_FREE_REQ_RING_TYPE_TX, - cmpl_ring_id); + rc = hwrm_ring_free_send_msg(bp, ring, RING_FREE_REQ_RING_TYPE_TX, + cmpl_ring_id); ring->fw_ring_id = INVALID_HW_RING_ID; + return rc; } -static void bnxt_hwrm_rx_ring_free(struct bnxt *bp, - struct bnxt_rx_ring_info *rxr, - bool close_path) +static int bnxt_hwrm_rx_ring_free(struct bnxt *bp, + struct bnxt_rx_ring_info *rxr, + bool close_path) { struct bnxt_ring_struct *ring = &rxr->rx_ring_struct; u32 grp_idx = rxr->bnapi->index; u32 cmpl_ring_id; + int rc; if (ring->fw_ring_id == INVALID_HW_RING_ID) - return; + return 0; cmpl_ring_id = bnxt_cp_ring_for_rx(bp, rxr); - hwrm_ring_free_send_msg(bp, ring, - RING_FREE_REQ_RING_TYPE_RX, - close_path ? cmpl_ring_id : - INVALID_HW_RING_ID); + rc = hwrm_ring_free_send_msg(bp, ring, + RING_FREE_REQ_RING_TYPE_RX, + close_path ? cmpl_ring_id : + INVALID_HW_RING_ID); ring->fw_ring_id = INVALID_HW_RING_ID; bp->grp_info[grp_idx].rx_fw_ring_id = INVALID_HW_RING_ID; + return rc; } -static void bnxt_hwrm_rx_agg_ring_free(struct bnxt *bp, - struct bnxt_rx_ring_info *rxr, - bool close_path) +static int bnxt_hwrm_rx_agg_ring_free(struct bnxt *bp, + struct bnxt_rx_ring_info *rxr, + bool close_path) { struct bnxt_ring_struct *ring = &rxr->rx_agg_ring_struct; u32 grp_idx = rxr->bnapi->index; u32 type, cmpl_ring_id; + int rc; if (bp->flags & BNXT_FLAG_CHIP_P5_PLUS) type = RING_FREE_REQ_RING_TYPE_RX_AGG; @@ -7730,14 +7735,15 @@ static void bnxt_hwrm_rx_agg_ring_free(struct bnxt *bp, type = RING_FREE_REQ_RING_TYPE_RX; if (ring->fw_ring_id == INVALID_HW_RING_ID) - return; + return 0; cmpl_ring_id = bnxt_cp_ring_for_rx(bp, rxr); - hwrm_ring_free_send_msg(bp, ring, type, - close_path ? cmpl_ring_id : - INVALID_HW_RING_ID); + rc = hwrm_ring_free_send_msg(bp, ring, type, + close_path ? cmpl_ring_id : + INVALID_HW_RING_ID); ring->fw_ring_id = INVALID_HW_RING_ID; bp->grp_info[grp_idx].agg_fw_ring_id = INVALID_HW_RING_ID; + return rc; } static void bnxt_hwrm_cp_ring_free(struct bnxt *bp, -- 2.53.0-Meta