Re: [RFC net v3 3/3] bnxt_en: stop DMA before releasing rings the firmware did not free
From: Michael Chan
Date: Thu Sep 24 2026 - 02:29:15 EST
On Wed, Sep 23, 2026 at 2:07 PM Joe Damato <joe@xxxxxxx> wrote:
> @@ -7798,6 +7802,19 @@ static void bnxt_hwrm_ring_free(struct bnxt *bp, bool close_path)
> bp->grp_info[i].cp_fw_ring_id = INVALID_HW_RING_ID;
> }
> }
> +
> + if (!stuck)
> + return 0;
> +
> + netdev_err(bp->dev, "Firmware did not free %d ring(s)\n", stuck);
> + return -EIO;
> +}
> +
> +static void bnxt_stop_dma(struct bnxt *bp)
> +{
> + netdev_err(bp->dev,
> + "Disabling DMA before releasing ring memory, a firmware reset is required\n");
> + pci_clear_master(bp->pdev);
> }
>
Thanks for the patches. The general scheme to more properly handle
RING_FREE timeout to prevent possible memory corruption is correct.
However, the corrective action here feels incomplete. We should at
least set some bp->state flags so that at the next open, we would know
that something was wrong and could take further actions (e.g. FLR,
etc) to try to bring it back.
Attachment:
smime.p7s
Description: S/MIME Cryptographic Signature