🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #11159

[net PATCH 1/5] fbnic: Take the instance lock to restore filters after a FW crash

#11159
From: Alexander Duyck
Date: Wed, 04 Nov 2026 17:59
48 lines
13020 bytes
From: Alexander Duyck <alexanderduyck@fb.com>

The fbnic_fw_config_after_crash function resets the MACDA and action
TCAM shadows and rewrites them through the __fbnic_set_rx_mode function
from the service task, holding RTNL only. fbnic is ops-locked, so since
the netdev workqueue moved from RTNL to the ops-compat lock the core
calls the fbnic_set_rx_mode function from it holding only the instance
lock. The two do not exclude each other.

Both sides can then allocate MACDA entries at the same time, one can
zero an entry the other is still filling in, and one can clear hardware
entries the other has just written. The crash path also syncs the live
address lists while the netif_rx_mode_run function works on a snapshot
of them, so the reconcile that follows can count the same delta twice
and leave an address that is never unsynced.

Hold the instance lock across the restore, as the fbnic_bmc_rpc_check
function does. The netif_rx_mode_run function holds it from snapshot
through reconcile, so the crash path now syncs either before the
snapshot or after the reconcile.

Fixes: 5a81c72ef9ad ("net: run netdev work under the ops-compat lock")
Signed-off-by: Alexander Duyck <alexanderduyck@fb.com>
---
 drivers/net/ethernet/meta/fbnic/fbnic_pci.c |    5 +++++
 1 file changed, 5 insertions(+)

diff --git a/drivers/net/ethernet/meta/fbnic/fbnic_pci.c b/drivers/net/ethernet/meta/fbnic/fbnic_pci.c
index ad234bb0f75d..09eeb4b4ded8 100644
--- a/drivers/net/ethernet/meta/fbnic/fbnic_pci.c
+++ b/drivers/net/ethernet/meta/fbnic/fbnic_pci.c
@@ -181,10 +181,15 @@ static int fbnic_fw_config_after_crash(struct fbnic_dev *fbd)
 		return -1;
 	}
 
+	/* The rx mode work rewrites the same shadow under the instance lock
+	 * alone, and this runs from the service task under RTNL only.
+	 */
+	netdev_lock(fbd->netdev);
 	fbnic_rpc_reset_valid_entries(fbd);
 	netif_addr_lock_bh(fbd->netdev);
 	__fbnic_set_rx_mode(fbd, &fbd->netdev->uc, &fbd->netdev->mc);
 	netif_addr_unlock_bh(fbd->netdev);
+	netdev_unlock(fbd->netdev);
 
 	return 0;
 }
Technical Details
Message-ID: <179381514591.9644.8634689197787321139.stgit@ahduyck-xeon-server.home.arpa>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-356675-linux-kernel-netdev=dewy.ru
References: <179381496288.9644.9775319757787890210.stgit@ahduyck-xeon-server.home.arpa>

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-356675-linux-kernel-netdev=dewy.ru
From: alexander.duyck@gmail.com (Alexander Duyck)
Newsgroups: linux.kernel.netdev
Subject: [net PATCH 1/5] fbnic: Take the instance lock to restore filters
 after a FW crash
Date: Wed, 04 Nov 2026 09:59:06 -0800
Organization: Usenet Network
Message-ID: <179381514591.9644.8634689197787321139.stgit@ahduyck-xeon-server.home.arpa>
References: <179381496288.9644.9775319757787890210.stgit@ahduyck-xeon-server.home.arpa>
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 7bit
Injection-Info: usenet.network;
	logging-data="3459877"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:aBXT/j5jkZlaxJ2vEH7XLo0q7dY= sha256:Rx9cXJJBwSCdACnv3f1Kl9KUDWi0dzg5vRpNPLySSbY=
	sha1:YpFEExsO8FhRuC3CFz1yAruViDA= sha256:LZ2g5uz8VeOf4jY4afuzoQNgZGg3VwjSZ9om8mwMwM0=
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 911BE112CED; Wed,  4 Nov 2026 21:57:53 +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 DAc6wUHB1Szt;
	Wed,  4 Nov 2026 21:57:50 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-356675-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 sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10])
	by mail.dewy.ru (Postfix) with ESMTPS id 3F428112C7A; Wed,  4 Nov 2026 21:57:38 +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 1C4E23164E; Wed,  4 Nov 2026 18:08:06 +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=1793815149;
	b=OxZvnwoecFdAyhsS/sv340Y2+f5Ha3uex13Mja8TJL9Rl6TPoFlKxapM4m6LcNHpqN2g
	 QuQgRvtXKaHeMsQUt1LRhh7f9ifHEbjbZRiAi5sf5OAimwI7z0ubgM1/xNWEYpntMF80R
	 ysuqUEEzv913O7CimBa5zsV6QPe2vUx8BrWhWh9dWwFCpcnx2oR/xJkTQM3KiViDbfcpo
	 2YKA0fN+WoHeaJKAivPOJ+71i+flv3Uuc8c4kT/pUnhipn3souMlmv56vruU399DoS9vx
	 IvWwUHzubvku3qW18bj0dVEiy6U0RVMpKsBALBPbJUnmsHwdbOmE6pC6xgnxNsJkiJw==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1793815149;
	h=X-Original-To:Received:DMARC-Filter:Received:DKIM-Signature:
	 X-Google-DKIM-Signature:X-Gm-Message-State:X-Gm-Gg:X-Received:
	 Received:Subject:From:To:Cc:Date:Message-ID:In-Reply-To:References:
	 User-Agent:X-Mailing-List:List-Id:List-Post:List-Help:List-Subscribe:
	 List-Unsubscribe:List-Owner:Precedence:MIME-Version:Content-Type:
	 Content-Transfer-Encoding;
	bh=9OTNLiIqnUXo5KXOl56BbVvGFg7giq+An3nV/JQrijE=;
	b=Zw56j5NQ/gX9ESsylb5DG6+IRzr/TQNMQFBaO1pJWI8iqwX6VfbeO5nt2FyWQNfBz5+r
	 8AfxOBcvO+x6S4/y4G8Cl1OWeiWKM+dFmMoktArnT7/5sM6OWE+1L61Uh5sJfe889OdZZ
	 xN0iB1bXlpCxeLMuGejKHj9GYeinfpxVaT1rKUd6qcAs1339QNG7lEHtkJpNqJQD/mUpe
	 img1jYB9ckAvjRIQ80Z3EDu6o2jGXz7HugzVztLw73jwEQlQmFhLasMv9iK93aF/erbOT
	 tpq+M0uYb5au7FjBrAtEfF2wtsd/BYrEpW03AV4Us69ftKzoRPnFnU4Nx6M93Jzu5WQ==
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=oUG6mLyj;
	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 C707E606A7F4;
	Wed,  4 Nov 2026 17:59:09 +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=oUG6mLyj
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.216.54
X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none;
	t=1793815149;
	b=Ja98HebiOQRQqsUn06wiQ60PPhvkGYM+2kmRvREIgnhKV8krWc67Ne7ityjPCQ//lqxI
	 jz+/5+vO7ldXodxBoQELJGH4yOEvqdunxSegMwHPKvB4t6Me86tOYxgXZZe4AVWbXtVnL
	 JTjthBTcZdKV2mL0v5kiql0/+PLm3Ruf0DASFWxZ44DPiNGKxzeWIP2IV+AO8GO4PB9UA
	 NE7VhVfHafcARxWzdjxmz6teYJH9BT1M93YFQw8hRaoI3LOmV25OrVXGTzJP/JrlGFxPK
	 23zXrNBhOZalcOfEjkcq2CZ5sPhJ2IiZRt4lM8an26SPLfbwKkOR94e7qEKm0VkPK0g==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1793815149;
	h=DMARC-Filter:Received:DKIM-Signature:X-Google-DKIM-Signature:
	 X-Gm-Message-State:X-Gm-Gg:X-Received:Received:Subject:From:To:Cc:
	 Date:Message-ID:In-Reply-To:References:User-Agent:MIME-Version:
	 Content-Type:Content-Transfer-Encoding;
	bh=9OTNLiIqnUXo5KXOl56BbVvGFg7giq+An3nV/JQrijE=;
	b=4lJ2NvkVYyr3rOQlCNXQQ29nAmGh6IGUCVxW75F4cZYA2SPbDiqTM1Pzd6BiS40COYir
	 vvN85fKetRAZv/gI+vULAQf6u6h9Ysd+fWJ2mD5+b/Bo2UVXmHpWuBNvMTmSGc+q/kS2T
	 fytVhU38V8LXbVcQGcCJ/WPFE2oek9JltyFO00Zu/QbHHUaIIe9+b6gsg9JZVZSkYIbm4
	 QW2TA+VpLBhjIvW5gAmfO0RLd4D87chSbJ/Kuvwt9yUFq59qHoedct3IjKAt2tXa/YQJf
	 IMqD6hdSdkUlKDUUlf805XnkwdtBAXU9vn+5g2nUKYKmfGnoRkQtz4k49Dn0Nxgy2Yw==
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=oUG6mLyj;
	arc=none smtp.remote-ip=209.85.216.54
X-Received: from mail-pj1-f54.google.com (mail-pj1-f54.google.com [209.85.216.54])
	(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 94E5A606A339
	for <netdev@vger.kernel.org>; Wed,  4 Nov 2026 17:59:08 +0000 (UTC)
X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 94E5A606A339
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-pj1-f54.google.com with SMTP id 98e67ed59e1d1-3ad2b3b1c02so586551a91.1
        for <netdev@vger.kernel.org>; Wed, 04 Nov 2026 09:59:08 -0800 (PST)
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20260707; t=1793815148; x=1794419948; darn=vger.kernel.org;
        h=content-transfer-encoding:content-type:mime-version:user-agent
         :references:in-reply-to:message-id:date:cc:to:from:subject:from:to
         :cc:subject:date:message-id:reply-to:content-type;
        bh=9OTNLiIqnUXo5KXOl56BbVvGFg7giq+An3nV/JQrijE=;
        b=oUG6mLyjg/yptE9UwSwW8GhN3WIHbFQi+vaLoRHcUTxrPQO1IKPagofcu5CpsHFOpO
         PaTtT4tM8QNkjQo6gTfOr00r12ejqj6glJ5msNnSXAQqEKyMGZ5mL3xLgn8d5X01iDlL
         aBKZw0cf7x1fV+TUIYoh61nx1E3pd9vCYcwyFjHobNaHAn1XMZUaAG13/l9NDDCovaje
         2umP5rFG2qZqQcr7ceEwmcs3aRnBPQmCDM9fy4rdzzr2p5gN2Utt8iVEdljh210+bL7t
         zrh3mnbhjCvq0jaFRrT8tXzANq6QodSK7oK52VPT5r4K4uMg81yiK/agj6udV9VKT497
         VUXw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20260707; t=1793815148; x=1794419948;
        h=content-transfer-encoding:content-type:mime-version:user-agent
         :references:in-reply-to:message-id:date:cc:to:from:subject:x-gm-gg
         :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to
         :content-type;
        bh=9OTNLiIqnUXo5KXOl56BbVvGFg7giq+An3nV/JQrijE=;
        b=oQBL0G+FoD0o9PpkCehg0cDOKEk7h/IQrzvWmKVDDSJkPPSX8fUWiRPbsA4Sicvkd6
         0YoVsPuyvpEeVRiP+SnEt+kXex6A8cNWVTg/3TEYh8i0h5Y2bxzRne5bUG0pZLgWSlxn
         syWm3R1MoQTJt7kIrf2/S1dNwTiVP8wbTPj4zf/6o5S8RZ6r2EwejyLQIA/Akm9yZS04
         MKTyuSL1xEDYVBG+tv97OT4wubnhWyAZNH9bp/nbUGx37eTDkw0FFxQeR8NWCk4z7sRe
         SVrcmFLc6G3r8SyqxdUdFzTTkL7fDHWI0D1fFKAlPYg1OFhL6CqGl9cGiVzVdiwBJufq
         227A==
X-Gm-Message-State: APuU4Z8uSgucOxoA9Qq6uHvL/4XFdNZSLYhkfh9Tur+tgC9lW8kSGGNM
	yrk/w1pUyiHcj7UBYrCex/nEGE8Y4U87YMLtyKCDm6ov5cEOuOtjvP678++vQA==
X-Gm-Gg: AYBFou37oYlSIoZ8DJB6FRvAeBaDjTFv9IItzOEIfKCX/DSfXkDLioglthxs90SZGl4
	6Sr+l1vs+GukP+EhVzpWTU6Kl0nrdzOeYnRnod+fvLhqUem/Br+X93kDd1Lw2yJUEKRJPmw4MO5
	T0S2gNNRI4N3tpp57SVwPTyeUqSD/hFAEemvGizdLouO/UenQRNZ4m7MAyaq4zGgrDnoANDGrab
	o+fAhKY2NW36S3jQM8YgLKvFYOk+rjHw56Lek9xgc2DiyEpRUTFfC68JqGpfLsQLtNFepoGVerw
	xpwyOYtk28Zrulua+jAj1mvZPeea2Id9Fcx7YpFj84tRG6mbq73FxqdGKfZ/zEacNA36tC3+taE
	V/LgwMqSpstwbWlyfEkwfi3ydVFHiAoidKUSK0wUTlCQegY7rjU9/sun8Fek702FifbCUUAMzrv
	9x5L/j4ioiyJhtm+7MrWZCQPB3YX609R+OKpoegxmLaa9gLYKr2XpKf6bqVfEwEwZL+2snV7g60
	dSDQv1vqHVVsR4kdwI7OeV63MUyIZTEG+3uQMFHZ1MVDjibsGtRFqlPGNLLJXl7LcCadVSLizt4
	Xhwf6ihNffXwh2iZNaIAOPsuBPbinUT0Xcqw760LYZ7AprtYBFoZ7GdlrG8l8MNiL3+Rd/VTJi+
	JzsoANqGFjukJpwI6pcnM2tbUfy2mfZ0O33MIm9ph16gVPw==
X-Received: by 2002:a17:90b:570c:b0:3ab:e588:c288 with SMTP id 98e67ed59e1d1-3ae897ccb52mr14990622a91.11.1793815147672;
        Wed, 04 Nov 2026 09:59:07 -0800 (PST)
X-Received: from ahduyck-xeon-server.home.arpa ([2605:59c1:38c:400:22f5:2de:b9c3:f27c])
        by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-3b0b31d2b5esm34216a91.15.2026.11.04.09.59.06
        (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
        Wed, 04 Nov 2026 09:59:07 -0800 (PST)
X-Cc: andrew+netdev@lunn.ch, davem@davemloft.net, edumazet@google.com,
 horms@kernel.org, kernel-team@meta.com, kuba@kernel.org, pabeni@redhat.com
X-In-Reply-To:  <179381496288.9644.9775319757787890210.stgit@ahduyck-xeon-server.home.arpa>
X-User-Agent: StGit/1.5
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