🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #3474

Re: [PATCH net] mlxsw: Initialize register query payloads

#3474
From: Björn Töpel
Date: Thu, 15 Oct 2026 07:48
43 lines
7473 bytes
Til Kaiser <mail@tk154.de> writes:

> MFGD register queries can exhaust EMAD retries and leave Mellanox
> Spectrum switches stuck during boot or shutdown when running OpenWrt
> built with GCC 15.
>
> An example failure is shown below with the second line wrapped:
>
>   EMAD retries (5/5) (tid=9b544fc100001f35)
>   EMAD reg access failed (tid=9b544fc100001f35,reg_id=90f0(mfgd),
>                           type=query,status=0(operation performed))
>
> On an SN2100, the failure occurs during driver teardown on reboot.
> On an SN3420, it occurs while probing mlxsw_spectrum during boot.
>
> The register query API transmits the supplied payload to the device
> before replacing it with the response. Both MFGD callers pass an
> uninitialized stack buffer, so the request contains arbitrary register
> field values and reserved bits. This makes the request depend on stack
> contents and compiler code generation.
>
> Initialize both MFGD query buffers in the firmware fatal event
> configuration and reporter test paths. The initialization has been
> confirmed to eliminate the boot and shutdown hangs on both switches.
> The subsequent read-modify-write still preserves the other fields
> returned by the device.
>
> Also initialize the FORE fan fault query and the MOGCR mirroring policer
> base query, which pass entirely uninitialized payloads. Restore the MTMP
> query initialization in the temperature history reset path, where only
> the slot and sensor index fields are set before querying the register.
>
> This follows commit 5b0907407e7f ("mlxsw: core: Zero payload buffers for
> couple of registers"), which initialized other query payloads after a
> firmware field length bug caused firmware to consume uninitialized data.

Hmm, isn't this pointing to that the query should be more robust,
instead of relying on zeroing receive buffers pre-call? Maybe just fixup
query instead?


Björn
Technical Details
Message-ID: <87a4of8kw1.fsf@all.your.base.are.belong.to.us>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-346575-linux-kernel-netdev=dewy.ru
References: <20261014173117.26305-1-mail@tk154.de>

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-346575-linux-kernel-netdev=dewy.ru
From: bjorn@kernel.org (Björn Töpel)
Newsgroups: linux.kernel.netdev
Subject: Re: [PATCH net] mlxsw: Initialize register query payloads
Date: Thu, 15 Oct 2026 09:48:14 +0200
Organization: Usenet Network
Message-ID: <87a4of8kw1.fsf@all.your.base.are.belong.to.us>
References: <20261014173117.26305-1-mail@tk154.de>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
Injection-Info: usenet.network;
	logging-data="2477024"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:8Mt2yZwFI/zEIIPw113dAsrZwbA= sha256:RPZgr0jCYEpWNr5g/KKITiFSKQ0v2EBzWiWOivD59G4=
	sha1:MW//8kaX8kHG4TBhe3lASHqgG6o= sha256:lRIG7O462ru51NsXNbcbv1wrAYhACpd+ypB+iOV+jC8=
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 4767E11026B; Thu, 15 Oct 2026 10:48:36 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -1.34
X-Spam-Status: No, score=-1.34 tagged_above=-9999 required=6.31
	tests=[DCC_REPUT_70_89=0.1, DKIMWL_WL_HIGH=-0.24, DKIM_SIGNED=0.1,
	DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1,
	MAILING_LIST_MULTI=-1, 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=kernel.org
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 T4pqZvdqVq9O;
	Thu, 15 Oct 2026 10:48:34 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=104.64.211.4; helo=sin.lore.kernel.org; envelope-from=netdev+bounces-346575-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> 
X-Authentication-Results: OpenDMARC; dmarc=pass (p=quarantine dis=none) header.from=kernel.org
X-Received: from sin.lore.kernel.org (sin.lore.kernel.org [104.64.211.4])
	by mail.dewy.ru (Postfix) with ESMTPS id 827C5110266; Thu, 15 Oct 2026 10:48:24 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.90.174.1])
	by sin.lore.kernel.org (Postfix) with ESMTP id DB7B925A55; Thu, 15 Oct 2026 07:48:21 +0000 (UTC)
X-Received: from localhost.localdomain (localhost.localdomain [127.0.0.1])
	by smtp.subspace.kernel.org (Postfix) with ESMTP id 695DE49EC7F;
	Thu, 15 Oct 2026 07:48:20 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org;
	dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="nFcubVq8"
X-Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18])
	(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
	(No client certificate requested)
	by smtp.subspace.kernel.org (Postfix) with ESMTPS id 66D1437BE93;
	Thu, 15 Oct 2026 07:48:18 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18
X-ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;
	t=1792050500; cv=none; b=PKYriV7QPa6rom1X4Tv2IkTy97sBOW1yQKLt84vn7WC4YvPpOeqFRb6GkiZQ4r5QM0UBSKeDSs5l+6jqbJBxU50jEhGQS5kpA4q3IGlLdlTB3QFXcT5Pj9Ddffc3vOyjZFYRiE4GOMtNgpH3lVQimzTPBNNK3OKJpQAmZnMDvos=
X-ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org;
	s=arc-20240116; t=1792050500; c=relaxed/simple;
	bh=2T8DWHLOuIMjqX7qR5+p2AHvU66WpzmJ1U5OQVan6qI=;
	h=From:To:Cc:Subject:In-Reply-To:References:Date:Message-ID:
	 MIME-Version:Content-Type; b=rLwrclxgjgtUPA/tqgn93tlLxQRr+IH1bmVj8o05fD06QCW1ePlE3+7hQbPXul7HNnfCESt0YqfGadtyMhh7nsIw9gnl3kXiq9WLXpJcfD8RWOxVN1Bu10W0lVphA06LoFTYOWaBapmJQoRdTff7adVlLh1V0W6dDApYDzhxKDg=
X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=nFcubVq8; arc=none smtp.client-ip=100.103.45.18
X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id 63ED41F000C4;
	Thu, 15 Oct 2026 07:48:17 +0000 (UTC)
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org;
	s=k20260515; t=1792050497;
	bh=XNRe4wdgHJC8WqhZGcOYLCOcUoEAbq7B+B2ZqkentCM=;
	h=From:To:Cc:Subject:In-Reply-To:References:Date;
	b=nFcubVq8/68DVvnbVCzBHzOy4FsSOzLUb+8XDxxVfJOEdfnorggiqeDsZuiEQusUM
	 qgnwBSWewJapgC8leeknF9ygrJO/II5b4Tv6vVcDOAaVzY6LNpx9ypdv2yMD2kSpl8
	 OcZ/oVDTEFZVTZn1kkBZz2fjh6XXZ2g13J0UyxJhFD4vqgNdwsuK8siq7zTiDxHLi6
	 Y/LsuShBJsccuua6/GHzySKz5IvTrv1N/VmDl/NYZAUVk3Z0dsL1UpS6HxReaGwD9n
	 Ar8mb8LY1lXhx+pH7QSeN86OKYiFZdMX+QI1/fSCGcLB0QClbqv4j2IA+ukxjObAxw
	 Lx/2kxShMUxDw==
X-Cc: Til Kaiser <mail@tk154.de>, stable@vger.kernel.org, Ido Schimmel
 <idosch@nvidia.com>, Petr Machata <petrm@nvidia.com>, Andrew Lunn
 <andrew+netdev@lunn.ch>, "David S. Miller" <davem@davemloft.net>, Eric
 Dumazet <edumazet@kernel.org>, Jakub Kicinski <kuba@kernel.org>, Paolo
 Abeni <pabeni@redhat.com>, Jiri Pirko <jiri@resnulli.us>, Vadim Pasternak
 <vadimp@mellanox.com>, linux-kernel@vger.kernel.org
X-In-Reply-To: <20261014173117.26305-1-mail@tk154.de>
X-Precedence: bulk
X-Mailing-List: netdev@vger.kernel.org
X-List-Subscribe: <mailto:netdev+subscribe@vger.kernel.org>
X-List-Unsubscribe: <mailto:netdev+unsubscribe@vger.kernel.org>