🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #12284

[PATCH net v5 2/4] bnxt_en: check HWRM response if completion never arrives

#12284
From: Joe Damato
Date: Fri, 06 Nov 2026 19:14
73 lines
13474 bytes
When a command is sent over a completion ring, __hwrm_send() waits for
NAPI to consume the completion and gives up if it never arrives, without
looking at the response.

If a completion is not posted within the timeout, check the response
before giving up. If resp_len is set, the sequence id matches, and the
valid byte is set then the firmware completed the command and only the
notification was lost. Fall through to the normal error_code handling in
that case.

Several seconds are spent waiting for the completion, so a response that
was written at all is complete by the time the wait gives up. There is no
need to poll for the valid byte here the way the polling path below has
to, where the poll is for a non-zero length and the valid byte at the end
of the message may still be on its way.

Log the response state on both paths so there is more data when this rare
event occurs.

Fixes: 74608fc98d28 ("bnxt_en: Ring free response from close path should use completion ring")
Signed-off-by: Joe Damato <joe@dama.to>
---
 .../net/ethernet/broadcom/bnxt/bnxt_hwrm.c    | 33 ++++++++++++++++---
 1 file changed, 29 insertions(+), 4 deletions(-)

diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt_hwrm.c b/drivers/net/ethernet/broadcom/bnxt/bnxt_hwrm.c
index 5bfabdca7d0e..4feba90f0bf6 100644
--- a/drivers/net/ethernet/broadcom/bnxt/bnxt_hwrm.c
+++ b/drivers/net/ethernet/broadcom/bnxt/bnxt_hwrm.c
@@ -582,11 +582,36 @@ 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;
+			__le16 resp_seq_id;
+			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.
+			 */
+			dma_rmb();
+			resp_seq_id = READ_ONCE(ctx->resp->seq_id);
+			len = le16_to_cpu(READ_ONCE(ctx->resp->resp_len));
+			if (len && resp_seq_id == ctx->req->seq_id)
+				valid_byte = *((u8 *)ctx->resp + len - 1);
+
+			if (!valid_byte) {
+				hwrm_err(bp, ctx,
+					 "Resp cmpl intr err msg: 0x%x len:%d seq:0x%x/0x%x\n",
+					 req_type, len,
+					 le16_to_cpu(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));
 		}
-		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 */
-- 
2.53.0-Meta
Technical Details
Message-ID: <20261106191423.4194081-3-joe@dama.to>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-358131-linux-kernel-netdev=dewy.ru
References: <20261106191423.4194081-1-joe@dama.to>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-358131-linux-kernel-netdev=dewy.ru
From: joe@dama.to (Joe Damato)
Newsgroups: linux.kernel.netdev
Subject: [PATCH net v5 2/4] bnxt_en: check HWRM response if completion never arrives
Date: Fri,  6 Nov 2026 11:14:18 -0800
Organization: Usenet Network
Message-ID: <20261106191423.4194081-3-joe@dama.to>
References: <20261106191423.4194081-1-joe@dama.to>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Injection-Info: usenet.network;
	logging-data="3954713"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:lm0JLjP9ExjPNsSdftw8OB5l2Qs= sha256:Y8v2qdIqT99X67ioXzsVr+ogdp2d+CwGG36d0hNUhw0=
	sha1:OpFkUS/ajId2q3KbQLVERbEumM4= sha256:6Y8rLOWqvGf7RDA7xwbAqkrerPA80roHmNavV9lk9KY=
List-ID: <netdev.vger.kernel.org>
X-Mailpost-Empty-Hdrs: X-Spam-Level
X-Received: from localhost (localhost [127.0.0.1])
	by mail.dewy.ru (Postfix) with ESMTP id 09D291132F6; Fri,  6 Nov 2026 22:20:00 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -3.051
X-Spam-Status: No, score=-3.051 tagged_above=-9999 required=6.31
	tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1,
	HEADER_FROM_DIFFERENT_DOMAINS=0.249, MAILING_LIST_MULTI=-1,
	RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001]
	autolearn=ham autolearn_force=no
X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (2048-bit key)
	header.d=dama-to.20260707.gappssmtp.com
X-Received: from mail.dewy.ru ([127.0.0.1])
	by localhost (mail.dewy.ru [127.0.0.1]) (amavisd-new, port 10024)
	with ESMTP id 9ltEZ2rFfd0m;
	Fri,  6 Nov 2026 22:19:57 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-358131-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> 
X-Authentication-Results: OpenDMARC; dmarc=none (p=none dis=none) header.from=dama.to
X-Received: from sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10])
	by mail.dewy.ru (Postfix) with ESMTPS id 365F61132B2; Fri,  6 Nov 2026 22:19:48 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92])
	by sea.lore.kernel.org (Postfix) with ESMTP id 847953A82A; Fri,  6 Nov 2026 19:14:52 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.remote-ip=127.0.0.1
X-ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=fail;
	t=1793992484;
	b=xGEl0m6i9DDh3RqUZ6ZlsxGblmcbT60jyHeRUSEFe1Mu4Zx2AXfhZZFr04FggnoSMf7i
	 8YKIcVSP+c/Dsb8Oor9ISBYEvrBfTJUH5OXKwXfqNI/suIRZY/94nxOgekGIhdpro0Idn
	 PnA6TdHECsb+DJGwl+et7+ZEaKk4HOlbnbV2ra8hpazItL5BfHJqeQPrhGlzg5JFAT+e0
	 +9ai9oXtB6ixmrWqyx9iu2d/DVkTj+tvgOY7xoj2vP+BifF70x2x0CRk/UQYSEyOMxZ0Q
	 M9eDvvYKwbyWm8mAJrYhQOFRFLkDz7Y4wCFmnTfIB93gRjGj/UXPMLSAxAKZJnCHy2w==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1793992484;
	h=X-Original-To:Received:DMARC-Filter:Received:DKIM-Signature:
	 X-Google-DKIM-Signature:X-Gm-Message-State:X-Gm-Gg:X-Received:
	 Received:From:To:Cc:Subject:Date:Message-ID:X-Mailer:In-Reply-To:
	 References:X-Mailing-List:List-Id:List-Post:List-Help:List-Subscribe:
	 List-Unsubscribe:List-Owner:Precedence:MIME-Version:
	 Content-Transfer-Encoding;
	bh=aslm3Yn3BYgx8V54FZU0TWe6uKvDrpLLy9fax5L8J1M=;
	b=GBVVb460QIWDhzIIPTyv2dD/6a3kZ6R9asGNIlUw3CPpUTGaRUlRrrPWoJO3nMGWzHAQ
	 NzrBSi5USzgrjYfMLgeYZ7mzAGpZy0xAvxGZWOH6y/xpDm/v0T9QU1mpNWntlbH/9C75A
	 ilxZ0sOxydZmL/6nP5jPMuWyHsWt4XG0n6bn4SpdlGSzIkHpAGv7YOTQw0levoDQKonGa
	 8mEQad5jbFNk/pfBXxP7s0CHERvXjdVjm/D7vQu4MQR6T+fintI/nWp2ObSobK+fjNu9F
	 ThreGhvUNp5w7PoNHi8jCw2B+K5l9n4m9KEjhcF7thxGiJQ0m5rBZPUSaEBUzjA0+yA==
X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; 
	dkim=pass header.d=dama-to.20260707.gappssmtp.com header.i=@dama-to.20260707.gappssmtp.com header.a=rsa-sha256 header.s=20260707 header.b=fD4M4g12;
	dmarc=none header.from=dama.to;
	spf=none smtp.mailfrom=dama.to;
	arc=fail smtp.remote-ip=127.0.0.1
X-Received: from localhost.localdomain (localhost [127.0.0.1])
	by smtp.subspace.kernel.org (Postfix) with ESMTP id 6C63A606A326;
	Fri,  6 Nov 2026 19:14:44 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org;
	dkim=pass (2048-bit key, unprotected) header.d=dama-to.20260707.gappssmtp.com header.i=@dama-to.20260707.gappssmtp.com header.a=rsa-sha256 header.s=20260707 header.b=fD4M4g12
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.210.180
X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none;
	t=1793992483;
	b=QEHVX9hVbyYkQhM9Wstvv15kXXSNkT2klQ0Ei4YR6BKCxBlWEbvFjQ0AAhACZ1MAGz55
	 8g4iQ6YL8XR38aAIQV5W1H2kz4wwunnCTvwgAqAOhWPdODh1gIPxMDa9B82T8I3+Fj83b
	 WVlLFOf7VgRXUeo6ZUw6ezwClzX22A1zjlkjcd8ovuF+zRCaL1HLet8GpFws8N2/zMhT5
	 2eE5v9qffcJv+7I8/6AJgQ94/zZ/d+eYraDX9GN5DyV92F7ho5xfJEWJN9vR+2+Rw+8rX
	 PEUDIkvhAVpZXEUlerHgKKp4iW4MVhc9VIJsZ04tYg+GOisBbkY4YUup+2K3X9XVjhg==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1793992483;
	h=DMARC-Filter:Received:DKIM-Signature:X-Google-DKIM-Signature:
	 X-Gm-Message-State:X-Gm-Gg:X-Received:Received:From:To:Cc:Subject:
	 Date:Message-ID:X-Mailer:In-Reply-To:References:MIME-Version:
	 Content-Transfer-Encoding;
	bh=aslm3Yn3BYgx8V54FZU0TWe6uKvDrpLLy9fax5L8J1M=;
	b=vjzBxDhbaFv49uTjOMJNlAaDtX0Md2zQ25dY4YvROiczmv3jo+lpEVDQKVrv8IEV6MG/
	 YPzDdvrWj0KrEdVC78wTtigXWHdz7bAQ3vy04QfXXu9+wqVBjVtWQ9evyCxZaLyJqLz7m
	 fPKglSz+PKYpioX+K8nEKUr3PjCM2cTNRnjPAIrP3ra5D2grfF1zhcBseDaiy7r7tmXRS
	 UY1s7xh5NhHku4EF2e5Be3dVGHX09nKC9IlIk/gIgrW/AIIVb5E6LLKHQ8AKm5SlaCS0V
	 sDTadk/2himtrW4fElJZEdVZxazvADIvewHG7tlwm3IDpms5ZOms9QzcRiZ/oOvuiSw==
X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; 
	dmarc=none header.from=dama.to;
	spf=none smtp.mailfrom=dama.to;
	dkim=pass header.d=dama-to.20260707.gappssmtp.com header.i=@dama-to.20260707.gappssmtp.com header.a=rsa-sha256 header.s=20260707 header.b=fD4M4g12;
	arc=none smtp.remote-ip=209.85.210.180
X-Received: from mail-pf1-f180.google.com (mail-pf1-f180.google.com [209.85.210.180])
	(using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)
	 key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256)
	(No client certificate requested)
	by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1898D606A32C
	for <netdev@vger.kernel.org>; Fri,  6 Nov 2026 19:14:42 +0000 (UTC)
X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 1898D606A32C
X-Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=dama.to
X-Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=dama.to
X-Received: by mail-pf1-f180.google.com with SMTP id d2e1a72fcca58-8b271e573adso480706b3a.2
        for <netdev@vger.kernel.org>; Fri, 06 Nov 2026 11:14:42 -0800 (PST)
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=dama-to.20260707.gappssmtp.com; s=20260707; t=1793992482; x=1794597282; darn=vger.kernel.org;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:from:to:cc:subject:date
         :message-id:reply-to:content-type;
        bh=aslm3Yn3BYgx8V54FZU0TWe6uKvDrpLLy9fax5L8J1M=;
        b=fD4M4g12rMDwQ+mCHieGTT+VTcQBpBM0I1nzyEp24lrICR1UikVwZ+X+IWCMI7wV3K
         Wp0/46Fn8EEeeQs9icZxwhBVdstyNIOUpXelauYtrcKUsTNzhRror/h7Oo2xapgwHZJw
         BbV5KT/WxiWSHpffrp6ygKjPMaLwqCbXP+OH3t+N+DW5iEdUsCqlWY+7FsiZn1BwGKL1
         3uYuqHyfiUxmYw8wTh2x28YVu6GzG00kclMFWKHVmGtjX1IXWO5XEYu9pJBnxTq6uMAu
         qgbKAX5psDv1Fw9aeAGfCcNrRt7TzxklYZoaL+2+jeHdNhFsmZ7wUZiu0pv0InHjQx3N
         vOpA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20260707; t=1793992482; x=1794597282;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from
         :to:cc:subject:date:message-id:reply-to:content-type;
        bh=aslm3Yn3BYgx8V54FZU0TWe6uKvDrpLLy9fax5L8J1M=;
        b=K70a2GcXHAIlofdPIWTkaQETfRP9h85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Dpm+HrD+GupM3ixPQPt46FfCe
	X5T9z5aGA9DGoq36SszrumQrhkyu1i0GgOUgHYp38A==
X-Received: by 2002:a05:6372:a80c:b0:3e1:3858:1dd0 with SMTP id adf61e73a8af0-3ebb293a76amr3480273637.42.1793992482406;
        Fri, 06 Nov 2026 11:14:42 -0800 (PST)
X-Received: from localhost ([2a03:2880:2ff:7::])
        by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-cdb70aa3ffasm982983a12.26.2026.11.06.11.14.41
        (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
        Fri, 06 Nov 2026 11:14:41 -0800 (PST)
X-Cc: edumazet@google.com,
	horms@kernel.org,
	linux-kernel@vger.kernel.org,
	Joe Damato <joe@dama.to>
X-Mailer: git-send-email 2.53.0
X-In-Reply-To: <20261106191423.4194081-1-joe@dama.to>
X-Mailing-List: netdev@vger.kernel.org
X-List-Post: <mailto:netdev@vger.kernel.org>
X-List-Help: <mailto:netdev+help@vger.kernel.org>
X-List-Subscribe: <mailto:netdev+subscribe@vger.kernel.org>
X-List-Unsubscribe: <mailto:netdev+unsubscribe@vger.kernel.org>
X-List-Owner: <mailto:netdev+owner@vger.kernel.org>
X-Precedence: list