Re: [RFC net v2 2/3] bnxt_en: check HWRM response if completion never arrives

From: Michael Chan

Date: Wed Sep 23 2026 - 00:14:54 EST


On Tue, Sep 22, 2026 at 11:24 AM Joe Damato <joe@xxxxxxx> wrote:

> @@ -582,12 +606,39 @@ static int __hwrm_send(struct bnxt *bp, struct bnxt_hwrm_ctx *ctx)
> }
>
> if (READ_ONCE(token->state) != BNXT_HWRM_COMPLETE) {
> - hwrm_err(bp, ctx, "Resp cmpl intr err msg: 0x%x\n",
> - req_type);
> - goto exit;
> + bool completed = false;
> + u8 valid_byte = 0;
> +
> + /* The completion ring entry was not delivered for
> + * some reason. It might be possible that the command
> + * was carried out even without a completion being
> + * posted. Check the response before giving up and log
> + * the state.
> + */
> + len = le16_to_cpu(READ_ONCE(ctx->resp->resp_len));
> + if (len &&
> + READ_ONCE(ctx->resp->seq_id) == ctx->req->seq_id) {
> + valid = (u8 *)ctx->resp + len - 1;
> + completed = hwrm_wait_for_valid(valid) <
> + HWRM_VALID_BIT_DELAY_USEC;

I feel that it is not necessary to wait for the valid bit in this
case. We have already waited several seconds for the interrupt and it
never came. By now, the whole response should be valid if we got it.

This differs from the polling case below which polls for a non-zero
length. As soon as we see the length, we need to wait a bit for the
valid bit which is at the end of the message.

> + valid_byte = *valid;
> + }
> + if (!completed) {
> + hwrm_err(bp, ctx,
> + "Resp cmpl intr err msg: 0x%x len:%d valid:0x%x seq:0x%x/0x%x\n",
> + req_type, len, valid_byte,
> + le16_to_cpu(READ_ONCE(ctx->resp->seq_id)),
> + le16_to_cpu(ctx->req->seq_id));
> + goto exit;
> + }
> + netdev_warn(bp->dev,
> + "Resp cmpl intr not delivered, msg: 0x%x completed anyway (len:%d valid:0x%x err:0x%x)\n",
> + req_type, len, valid_byte,
> + le16_to_cpu(ctx->resp->error_code));
> + } else {
> + len = le16_to_cpu(READ_ONCE(ctx->resp->resp_len));
> + valid = ((u8 *)ctx->resp) + len - 1;
> }
> - len = le16_to_cpu(READ_ONCE(ctx->resp->resp_len));
> - valid = ((u8 *)ctx->resp) + len - 1;
> } else {
> __le16 seen_out_of_seq = ctx->req->seq_id; /* will never see */
> int j;

Attachment: smime.p7s
Description: S/MIME Cryptographic Signature