Article View: linux.kernel.netdev
Article #10613Re: [PATCH net v2] bnxt_en: Take RTNL before netif_close() when aborting FW reset
From: Stanislav Fomichev
Date: Tue, 03 Nov 2026 20:10
Date: Tue, 03 Nov 2026 20:10
72 lines
14608 bytes
14608 bytes
On 11/02, Bryan Cochrane wrote:
> netif_close() must be called with RTNL held in addition to the netdev
> instance lock: __dev_close_many() asserts it, and the NETDEV_GOING_DOWN
> and NETDEV_DOWN notifier chains it runs rely on it for serialization.
>
> Commit 004b5008016a ("eth: bnxt: remove most dependencies on RTNL")
> replaced rtnl_lock() with netdev_lock() in bnxt_fw_reset_task() and
> bnxt_fw_reset(). That is sufficient for the paths that only tear the
> NIC down internally with __bnxt_close_nic(), but the abort paths close
> the netdev via bnxt_fw_reset_abort() -> netif_close(), and the error
> path in bnxt_fw_reset() calls netif_close() directly. Those now run
> without RTNL and trigger a WARN_ONCE() cascade when a firmware reset is
> aborted:
>
> RTNL: assertion failed at net/core/dev.c (1740)
> WARNING: net/core/dev.c:1740 at __dev_close_many+0x1be/0x1f0
> Workqueue: bnxt_pf_wq bnxt_fw_reset_task [bnxt_en]
> Call Trace:
> netif_close_many+0xb5/0x190
> netif_close+0xa2/0xd0
> bnxt_fw_reset_task.cold+0x8d/0x213 [bnxt_en]
> process_one_work+0x19d/0x3a0
> worker_thread+0x1af/0x320
> kthread+0xe3/0x120
>
> followed by the same assertion from call_netdevice_notifiers_info(),
> fib_rules_event(), inetdev_event(), rtnl_fill_ifinfo(),
> devlink_compat_phys_port_name_get() and ip_mc_down().
>
> This was observed on a machine in real use with a BCM57504 (4 PFs,
> FW 236.1.153.0) running v7.1.6: the firmware crashed, announced a
> "Fatal firmware reset event" and then failed to come back within the
> advertised max wait, so bnxt_fw_reset_task() aborted the reset on all
> ports:
>
> bnxt_en 0000:c1:00.1 eno16905np1: Firmware reset aborted
> bnxt_en 0000:c1:00.1 eno16905np1: fw_health_status 0x448100
>
> Take RTNL (before the netdev instance lock, matching the OPENING state
> which already uses rtnl_trylock()) in the fw_reset_abort path of
> bnxt_fw_reset_task() and route the POLL_VF abort through that same
> path.
>
> In bnxt_fw_reset() only the error path that closes the device after
> bnxt_get_registered_vfs() fails needs RTNL: drop the instance lock,
> take RTNL and the instance lock, then clear BNXT_STATE_IN_FW_RESET and
> close. The normal reset flow, which may run on many VFs at the same
> time, keeps running without RTNL. BNXT_STATE_IN_FW_RESET stays set
> across the lock switch, so a concurrent close marks the reset aborted
> as it does today and a concurrent recovery request backs off.
>
> The bug was found by inspecting the kernel log of the affected machine
> and the driver source; the fix was prepared with the help of an AI
> coding assistant (Gemini based) and reviewed by the submitter. It is
> build tested (allmodconfig with W=1, plus the same change on top of
> v7.1.6 built as a module for the affected BCM57504 host). The aborted
> reset path itself only runs when the firmware fails to return from a
> reset, which could not be reproduced on demand.
>
> Fixes: 004b5008016a ("eth: bnxt: remove most dependencies on RTNL")
> Cc: stable@vger.kernel.org
> Signed-off-by: Bryan Cochrane <bcochrane@google.com>
> ---
> v2:
> - Keep bnxt_lock_sp() in bnxt_fw_reset() and take RTNL only on the
> bnxt_get_registered_vfs() error path, so that the normal FW reset
> flow does not add RTNL contention when many VFs recover at the same
> time (Michael Chan).
> - Dropped Stanislav's Acked-by because of the change above.
Acked-by: Stanislav Fomichev <sdf@fomichev.me>
Technical Details
Message-ID:
<auo_uBLO1gNqk2HN@devvm16445.scu0.facebook.com>Path:
mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-355944-linux-kernel-netdev=dewy.ruReferences:
<20261103042210.2984373-1-bcochrane@google.com>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-355944-linux-kernel-netdev=dewy.ru
From: sdf.kernel@gmail.com (Stanislav Fomichev)
Newsgroups: linux.kernel.netdev
Subject: Re: [PATCH net v2] bnxt_en: Take RTNL before netif_close() when
aborting FW reset
Date: Tue, 3 Nov 2026 12:10:39 -0800
Organization: Usenet Network
Message-ID: <auo_uBLO1gNqk2HN@devvm16445.scu0.facebook.com>
References: <20261103042210.2984373-1-bcochrane@google.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Injection-Info: usenet.network;
logging-data="3251937"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:bxQwkb2c8F6/tSrXk4uOVG65QDw= sha256:xTTTjAy+YOCab6Ece4F5ilep0Jl1zYMehkGvDN8a4OI=
sha1:5OVqPLdGfrZi3HL7U0NjyLArZzo= sha256:OadVlGne2sAUwWEH1kZ5HX4dnUUhmUEkobJMkDv678w=
Content-Disposition: inline
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 92CB71129F0; Tue, 3 Nov 2026 23:13:15 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -3.049
X-Spam-Status: No, score=-3.049 tagged_above=-9999 required=6.31
tests=[DCC_REPUT_70_89=0.1, DKIM_SIGNED=0.1, DKIM_VALID=-0.1,
DKIM_VALID_AU=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.001,
FREEMAIL_FROM=0.001, 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=gmail.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 YEwubFA-FKdd;
Tue, 3 Nov 2026 23:13:08 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.105.105.114; helo=tor.lore.kernel.org; envelope-from=netdev+bounces-355944-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN>
X-Authentication-Results: OpenDMARC; dmarc=fail (p=none dis=none) header.from=gmail.com
X-Received: from tor.lore.kernel.org (tor.lore.kernel.org [172.105.105.114])
by mail.dewy.ru (Postfix) with ESMTPS id 008591129A9; Tue, 3 Nov 2026 23:12:58 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92])
by tor.lore.kernel.org (Postfix) with ESMTP id 2F2DC28ECC; Tue, 3 Nov 2026 20:10:53 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1
X-ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass;
t=1793736651;
b=XXupJHiRugUC30jYpqeebamvXSX4xPqplPWnWnaPjN/PQBKfskizpLgCtD7n8hdUrAcK
gzQp2RHwk4n+gdM0KzdK3n720h2aNSrbHmRxNZzX1wrNTHqrAH0rNlm+mXGV8HOcWbDvt
4ByrnkuZYkeekbHflR5P86dukfNP2tqWa32euId6AHR9FDiZeAc6u5FbAv+Qtw+IcumvZ
/2Pd6GNBAGzHKyi7trjvH0AgFMmAzeVZz7Xpaa5dGEjdC8tj9BUg/W5pN58PKfa+eVmPD
rAQ+1OsUMAnHLiWJhMjF7T5ddx8mAv2oZdey/HhiJc7n6MD1Qi5YY/hB2bBa1OOq42w==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
a=rsa-sha256; c=relaxed/relaxed; t=1793736651;
h=X-Original-To:Received:DMARC-Filter:Received:DKIM-Signature:
X-Google-DKIM-Signature:X-Forwarded-Encrypted:X-Gm-Message-State:
X-Gm-Gg:X-Received:Received:Date:From:To:Cc:Subject:Message-ID:
References:X-Mailing-List:List-Id:List-Post:List-Help:List-Subscribe:
List-Unsubscribe:List-Owner:Precedence:MIME-Version:Content-Type:
Content-Disposition:In-Reply-To;
bh=G+e0C+OO2ssPNCY+CMpKUyz+R3cTGFEfmTPvkxrQ+aU=;
b=5SiDgXnt3+c7K10IZpTWDDuMjq3WrsjozxFySN2KN71qRODNbMMAVIbY0AVhqH87jaFM
DdjDHK74UyqnY8DiMGc/Otyyfn0TKu54Dri2r0HrKRqccnhCsq2QGnwrCnCinU7CB002o
ysFkBuETQZP2idmFbTpWYZrj2wbX1eLD5dRudg8u9xkc98ir6hb86gdrKM7A9VYUz48tc
EEhiwLlqAaimihU+jgVEnodGrL0tF+7gyn6o2zY+gK7ZyDCgeKUD4jP0hSDitJXGlj7kq
SMSI5wtMeVFw8ZfF5a2prXaBQ1wi8P7P3rCq/tjh87tP9EPKCQiDi/qWtoAcqDkM90w==
X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org;
dkim=pass header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=aiuJxGNq;
dmarc=pass header.from=gmail.com;
spf=pass smtp.mailfrom=gmail.com;
arc=pass header.oldest-pass=0 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 C7376606A324;
Tue, 3 Nov 2026 20:10:51 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org;
dkim=pass (2048-bit key, unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=aiuJxGNq
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=74.125.229.6
X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none;
t=1793736646;
b=oBQeH35ttZcFSwBreiyaSmIk2SAdMlafedkg7PThmk8vpgtFYZVqO6Pa4S9yvu4rAXPo
Drawm5pMAq8ceAj2s3kGthfISOuq+CjkdEdEN6Tiy/RSjMXsR4GkYHZ+MrqY5o6Hyt9Xc
EM4a2Or8uwQBtKFsSKrPd/VDeWxhJBiOOrtuH/cV/Jkgnaq88sFFKlZQ3Bi5s+RG1N9v7
JCXOKNsRdPsOKxO2IpIWFbC9G7OLz06xPLZzPBlbctI8dlB+AW1pO/Y90mHiGkfhYfORp
IA1oUN56IyYNS7/Yt8XZmSNcBi+GH8EuR0ez6YUGN0JPAUXdAf1Anqjw3iBb4F2vLXQ==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
a=rsa-sha256; c=relaxed/relaxed; t=1793736646;
h=DMARC-Filter:Received:DKIM-Signature:X-Google-DKIM-Signature:
X-Forwarded-Encrypted:X-Gm-Message-State:X-Gm-Gg:X-Received:Received:
Date:From:To:Cc:Subject:Message-ID:References:MIME-Version:
Content-Type:Content-Disposition:In-Reply-To;
bh=G+e0C+OO2ssPNCY+CMpKUyz+R3cTGFEfmTPvkxrQ+aU=;
b=BB/FNf2jluW85UHYrjVaUU8X2iEX9mylybeEsSaQw+tSf7UFfkOcwU2uzjGvwhcFO0pz
GrqwViBfWs4IW5duWjZAUUwMbIABBm3ScySaxWgLNrXseUL/z9OFrBcQ2pbmrQFU1GKXX
R+9xfwXTSlR4DjA8EakHDDpNsaIXAh8fC5QGkKu3ZqVBvezl4jIhi2SgK9XLFEOwwASGJ
2dWjyXS/DhUE6Z6NUFsHyoliuD1r2SfnJy8hu810Ra15aJxeneJtXuOWVbkblPelBYVNs
BX7/E/4n2c19ZBx4oY8s3hZd15VM6FXh84FM8xJv6UyqR1tEmnXvTydsQ++RKt3H1AQ==
X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org;
dmarc=pass header.from=gmail.com;
spf=pass smtp.mailfrom=gmail.com;
dkim=pass header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=aiuJxGNq;
arc=none smtp.remote-ip=74.125.229.6
X-Received: from mail-dy2-f6.google.com (mail-dy2-f6.google.com [74.125.229.6])
(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 9834B606A326
for <netdev@vger.kernel.org>; Tue, 3 Nov 2026 20:10:45 +0000 (UTC)
X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 9834B606A326
X-Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com
X-Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com
X-Received: by mail-dy2-f6.google.com with SMTP id 5a478bee46e88-33e48934fa8so1399046eec.0
for <netdev@vger.kernel.org>; Tue, 03 Nov 2026 12:10:45 -0800 (PST)
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=gmail.com; s=20260707; t=1793736645; x=1794341445; darn=vger.kernel.org;
h=in-reply-to:content-disposition:content-type:mime-version
:references:message-id:subject:cc:to:from:date:from:to:cc:subject
:date:message-id:reply-to:content-type;
bh=G+e0C+OO2ssPNCY+CMpKUyz+R3cTGFEfmTPvkxrQ+aU=;
b=aiuJxGNqM2NOSyqLYh6xbIBKOf21JDB4WHU1FyrgtQBJZArufAJ0HrqHViyCi6VD38
vRVHbkUKCTR4vl8vruhaj+5eMiuN+U8fqOOCro9zpjEpBRYYf9lLfxnGQ0LZFl5JH6IN
8Ugtk70zgdRxYJIwwY2K3f+TweezPzv3QsuPwBe7ZYHU5cSmedf1L/S/1vKgctgmq2Wk
fLaPC4K0kgS2dYkqhL5k3FDjBUvaMeb0sk4FG8b2w+z877/RtUSt6NewD9lzrSQS4USx
Yn1EIzEbSO+F1BZtFUXZYpuPjkz8FoGmoAo9k+LE1kdlS1yFXNg06wMs0Papz7oZdk4P
//ng==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=1e100.net; s=20260707; t=1793736645; x=1794341445;
h=in-reply-to:content-disposition:content-type:mime-version
:references:message-id:subject:cc:to:from:date:x-gm-gg
:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to
:content-type;
bh=G+e0C+OO2ssPNCY+CMpKUyz+R3cTGFEfmTPvkxrQ+aU=;
b=boyKrrNsS1cmfW95VRRHiJ0JvZy7JHesYDF1hw/Uf0ozfSZfzNgneN1Q4QVd3vA4OE
O4/soyVm2aXOJEO5VxMN+4IuF2itdG3uJtNJanwkkbVUhbaUWKc7qmNyxOUFI/imcDKD
AEOcNQe/iv0IR+opV01l4QvbIDzEf1s1FXJJcfbs2a0bzeN9yl9VbXGxo9178jIdAmMe
UJ1qpJ7S7JgFSvQRet2FJAf+N8KyKFUYUbNGt4aeryQRGv6Qqs/QOWu2IwjfkloN9zP8
3UWuUjo14twton1NcoUmU1QHZaE3AjP16RtjymJnuXoPpmBNcMN5BaQ46OkRZEOBwKeE
YDrA==
X-Forwarded-Encrypted: i=1; AKwUvBzNeQzNroXlv/byk/hM9DgyYZzbteiAx3x37pbYXtXXgUf9YvUVH0tWe/oWm2RFzQFFezE3PKA=@vger.kernel.org
X-Gm-Message-State: APuU4Z+s0D/xZKu9arEQYSEucuItjjydMNdzIkXOx2KD8/A5PdbWb8VY
rvWRqs/aLAyJ6FhXIpPbYdQK4Kz5vN12oprtUTJptKaak/eaGBlIw76m
X-Gm-Gg: AYBFou0huD77s0fAoZeBqyDXCrw1KKUnUFXOENDP0uSujBRhw9PRc6/2ubBxiEbKgJP
tYddDrObRXJqIcyF0MZnoderveNuJ1O5gSk5RA/1pu7aIQAlKn231iLYdVlZ2lkYfHCjtJB1JEY
ebNwN3yYwnEpfadpk9EoKMvtxg7vSY2L77im+dTSSOV3k+n6YPFIrV34kLWnBeoDMDurJww5x+V
AReIDZE9Q63Ed6k945psB2uClb2vDzQGeaFOvhvSPWfV84nwaDgiNp0hDLOZXxSaLs50EjP+yv2
aBJ9gmt8AqFFaqob/96eJ7n5HvXw7QjaL6PWE6akInTgq3BdJR7Vait/Tf8CtwR6a4oqQLWmhSF
I+EEgoTsFXOKEyJ94oRRRudSLvV81idJd6GHmFZ5O5AoYOAbRWKug8Ik3+5G1g3+vt/45Sh0Ac3
WRnnqWWGVkM39ZkpB+E0a3ZxvILyOlGjLmINy0TFQsLSmpZ/iEiLLstpC7NgJft3CXRX/dsGJU4
Vsua4zFxIKW+BrgvbVxLzkHS5HNBx7LTwnbNY0zbxFqHgwuOoNmmluGePCDwI4J0GmHcJD77XR7
YI7STSn1tpkulD++TXmgZH61GtTo/FASnmzTEyllNHw=
X-Received: by 2002:a05:693c:2512:b0:369:fa7c:aee9 with SMTP id 5a478bee46e88-36a423f54a1mr20127351eec.19.1793736644552;
Tue, 03 Nov 2026 12:10:44 -0800 (PST)
X-Received: from localhost ([2a03:2880:9ff:41::])
by smtp.gmail.com with ESMTPSA id 5a478bee46e88-36ca38a54ccsm481879eec.4.2026.11.03.12.10.43
(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
Tue, 03 Nov 2026 12:10:44 -0800 (PST)
X-Cc: Michael Chan <michael.chan@broadcom.com>,
Pavan Chebbi <pavan.chebbi@broadcom.com>, netdev@vger.kernel.org, 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>,
Stanislav Fomichev <sdf@fomichev.me>, Joe Damato <joe@dama.to>, linux-kernel@vger.kernel.org,
stable@vger.kernel.org
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
X-In-Reply-To: <20261103042210.2984373-1-bcochrane@google.com>