Article View: linux.kernel.netdev
Article #19185[PATCH net v3 3/4] igb: link queues to NAPIs under RTNL after runtime resume
From: Antonio Quartulli
Date: Thu, 19 Nov 2026 14:04
Date: Thu, 19 Nov 2026 14:04
74 lines
12156 bytes
12156 bytes
__igb_open() links queues to NAPIs with netif_queue_set_napi(), which
requires RTNL, but RTNL isn't held when resuming from runtime suspend:
this triggers "RTNL: assertion failed".
Link them in __igb_open() only when RTNL is held, and from the work
item that sets the real queue counts on runtime resume. The links can't
be kept across a suspend, because __igb_shutdown() frees the q_vectors.
These are only freed while __IGB_DOWN is set, which is cleared once
they are allocated again, so the work item checks __IGB_DOWN under RTNL.
Tested with the 82576 emulated by QEMU.
Fixes: b75a1dea500f ("igb: Link queues to NAPI instances")
Cc: stable@vger.kernel.org # 6.16+
Closes: https://bugzilla.ipfire.org/show_bug.cgi?id=13562
Signed-off-by: Antonio Quartulli <antonio@mandelbit.com>
---
v3: link the NAPIs from the work item added by the previous patch, and
in __igb_open() whenever RTNL is held (also on system sleep resume);
dropped Joe's Reviewed-by, as the patch changed
v2: no code changes; mention the tested hardware
Note: igc has the same issue: __igc_open() also links queues to NAPIs
(igc_set_queue_napi()) on the RTNL-less runtime resume path. A fix will
follow separately once it has been tested on igc hardware.
drivers/net/ethernet/intel/igb/igb_main.c | 16 ++++++++++++++--
1 file changed, 14 insertions(+), 2 deletions(-)
diff --git a/drivers/net/ethernet/intel/igb/igb_main.c b/drivers/net/ethernet/intel/igb/igb_main.c
index 2f51edc..6196d7a 100644
--- a/drivers/net/ethernet/intel/igb/igb_main.c
+++ b/drivers/net/ethernet/intel/igb/igb_main.c
@@ -4126,8 +4126,18 @@ static int igb_sw_init(struct igb_adapter *adapter)
return 0;
}
+static void igb_link_queue_napis(struct igb_adapter *adapter)
+{
+ int i;
+
+ for (i = 0; i < adapter->num_q_vectors; i++)
+ igb_set_queue_napi(adapter, i, &adapter->q_vector[i]->napi);
+}
+
/* Some settings need RTNL, which isn't held when resuming from runtime
- * suspend: apply them from here instead, if the device is still up.
+ * suspend: apply them from here instead, if the device is still up. The
+ * q_vectors are only freed while __IGB_DOWN is set, which is cleared once
+ * they are allocated again, so checking it under RTNL is safe.
*/
static void igb_rtnl_resume_task(struct work_struct *work)
{
@@ -4142,6 +4152,7 @@ static void igb_rtnl_resume_task(struct work_struct *work)
adapter->num_rx_queues))
netdev_err(adapter->netdev,
"error setting real queue count\n");
+ igb_link_queue_napis(adapter);
}
rtnl_unlock();
}
@@ -4220,7 +4231,8 @@ static int __igb_open(struct net_device *netdev, bool resuming,
for (i = 0; i < adapter->num_q_vectors; i++) {
napi = &adapter->q_vector[i]->napi;
napi_enable(napi);
- igb_set_queue_napi(adapter, i, napi);
+ if (rtnl_held)
+ igb_set_queue_napi(adapter, i, napi);
}
/* Clear any pending interrupts. */
--
2.56.1
Technical Details
Message-ID:
<20261119140412.163202-4-antonio@mandelbit.com>Path:
mbox-mo1.pugleaf.net!news-lax.pugleaf.net!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-367060-linux-kernel-netdev=dewy.ruReferences:
<20261119140412.163202-1-antonio@mandelbit.com>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-lax.pugleaf.net!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-367060-linux-kernel-netdev=dewy.ru From: antonio@mandelbit.com (Antonio Quartulli) Newsgroups: linux.kernel.netdev Subject: [PATCH net v3 3/4] igb: link queues to NAPIs under RTNL after runtime resume Date: Thu, 19 Nov 2026 15:04:09 +0100 Organization: Usenet Network Message-ID: <20261119140412.163202-4-antonio@mandelbit.com> References: <20261119140412.163202-1-antonio@mandelbit.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Injection-Info: usenet.network; logging-data="2889283"; mail-complaints-to="abuse@usenet.network" Cancel-Lock: sha1:1V/t6mJLLoCnZeBR6W4Npr5BYuw= sha256:P0skxQGo1LLJsUuQuiOkXwTmDruqTNKskwhxpDWUtHc= sha1:CGSG8Z6CR/xSOp5wcXGcNl9u4rI= sha256:oXdF4dBIZ3gvxCZpLMY83hU2SVma+4RqdLh/KvLduJc= 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 7F0C8115685; Thu, 19 Nov 2026 17:04:51 +0300 (MSK) X-Virus-Scanned: Debian amavisd-new at usenet.network X-Spam-Flag: NO X-Spam-Score: -3.05 X-Spam-Status: No, score=-3.05 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, 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, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (2048-bit key) header.d=mandelbit.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 kIEpqMJL0dpY; Thu, 19 Nov 2026 17:04:47 +0300 (MSK) X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-367060-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> X-Authentication-Results: OpenDMARC; dmarc=none (p=none dis=none) header.from=mandelbit.com X-Received: from sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10]) by mail.dewy.ru (Postfix) with ESMTPS id 03F1B115120; Thu, 19 Nov 2026 17:04: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 1BEF716393E; Thu, 19 Nov 2026 14:04:31 +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=1795097068; b=HhW+cU8rcG4Xe1RR3jwrI7WJlo7knqu3rH9Ji78LMeIcM3EBHsC+VMlHEgqRNcGVlRMs zDC/E+n8E13bpfoHDISgwXGcMQw+oG/sucPck2aj7CB1VDXw2uYkTBBagAeh0+PcJP1jE Sk0CovytJm9WxQUzoEx4k3waCdmCRUvR73/ZSMPUU8eGxJziXZdwMgo5XDQNXmLPgouSB lqJ1WgwtyFkfMfoHEIWAzvmUF8b2j/A9IyPZhDzR+NOEoURXxoDp6CGiRMh0jQhbQfWxm KOrOwkTNMTrLA1k6oJtC1tZMn7BDL/kbXJfD+7TMcu6PDhC0CbImAWXnYIrMWpABWLA== X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795097068; h=X-Original-To:Received:DMARC-Filter:Received:DKIM-Signature: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:X-Rspamd-Queue-Id; bh=t1Kvdj1fq2FNjCpeV0l+yuj6IJcjFbmYA/wXT7o/wU0=; b=hiCYbm/FObcKWv9MPvu4pR8lqx4VF9pJKYqdfcckNO+goiW76xSOnUAoPXY7/Ufp0IFL n1NVhFGOgyNcJsJbB8ZCY6Lxv92l9y5bvXW0mgb1yFTc3wtvoht+qhm51sYw6Iminrc6h 3gq+RIL/0M2FcBsgekfc39lAoBeEWTerr29qdYJ+/BXEmobB/gQzD6OnR8ZUsjV3jc+km H5gMV/hk3pFohlo04bkRXC69OTOKgrk/QUkOYRS/1CBtZFchDkwTYMIVRbMSIhSIphxO2 tY8hs/KsnrziUjU5KHCDe2fHW9CnCZBp7LifiFxnC0i3EL6J6bu2z2LJAEkw2L6yuBQ== X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dkim=pass header.d=mandelbit.com header.i=@mandelbit.com header.a=rsa-sha256 header.s=MBO0001 header.b=iGPKbueC; dmarc=none header.from=mandelbit.com; spf=pass smtp.mailfrom=mandelbit.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 A5390606A338; Thu, 19 Nov 2026 14:04:28 +0000 (UTC) X-Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key, unprotected) header.d=mandelbit.com header.i=@mandelbit.com header.a=rsa-sha256 header.s=MBO0001 header.b=iGPKbueC X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=195.10.208.61 X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1795097067; b=x8qlwvZT4JCmvFOpUxnoJhYe3A3jRqVp9HfKWsBZXFrcxk2laBDx7VB8CElKuMma0eLI ml45fbaHzEtHKt2+Fihn7VuPnKJI8kSVnWv1xWRO5cohj9RBNzAf6MZNgl6XHg+PvU8DD dI1criDfeh1JBAGtwIDc/4ZjE2eIwZV4Rm4E4MG2Cpcxm33q2OtYj1MuTCwhDUIXaZiqf 6nQojt0B5jHffadRlMVT1zCsIX1alyot7WpDpKSs6h2bLh28+xVJ9W6F6F78YbZWUdUcl 7t/csKGD6vL0yodmnAK/9qlS/FPogc+0mvzNgMII0gAjvpnHqVpP1wauQRKe/SkBsbg== X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795097067; h=DMARC-Filter:Received:DKIM-Signature:From:To:Cc:Subject:Date: Message-ID:X-Mailer:In-Reply-To:References:MIME-Version: Content-Transfer-Encoding:X-Rspamd-Queue-Id; bh=t1Kvdj1fq2FNjCpeV0l+yuj6IJcjFbmYA/wXT7o/wU0=; b=pdKuERvONvrTS2dREKM/pBPg4lK4RMYVzCDuJydpIiplDVcDBdfZ7aZMp20YF8yrRWtc viHIr4JJaqgfyL6v2K9mBQWnopbekL5GoWi8v3OBNGZxw63U5yFcNBoLvbMf4HvEYqrm5 /7Z9TV6DNFBqtustFaG1Y4jv+KM0mtF4Qa/bzpz79U1jyJ7Qdhk+GKTmFjsiz2jTTqCfV 31t4Iwe3iONBXCXIGAObHHhlS+dAV7E/aQE6ToEoKkYlPntjeetV2KrrTM548HTcEJQKE k9Wvgtk1jL3UnLCXUDthiykmGK0KZS3JsWbg8YyFwVVM/csw+vkpe2BFMZ6Lknte4vA== X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none header.from=mandelbit.com; spf=pass smtp.mailfrom=mandelbit.com; dkim=pass header.d=mandelbit.com header.i=@mandelbit.com header.a=rsa-sha256 header.s=MBO0001 header.b=iGPKbueC; arc=none smtp.remote-ip=195.10.208.61 X-Received: from mout-b-201.mailbox.org (mout-b-201.mailbox.org [195.10.208.61]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4F9E6606A320; Thu, 19 Nov 2026 14:04:25 +0000 (UTC) X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 4F9E6606A320 X-Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=mandelbit.com X-Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=mandelbit.com X-Received: from smtp102.mailbox.org (smtp102.mailbox.org [IPv6:2001:67c:2050:b231:465::102]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519MLKEM768 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mout-b-201.mailbox.org (Postfix) with ESMTPS id 4jVgFK6K6PzLm1Z; Thu, 19 Nov 2026 15:04:21 +0100 (CET) X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mandelbit.com; s=MBO0001; t=1795097061; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=t1Kvdj1fq2FNjCpeV0l+yuj6IJcjFbmYA/wXT7o/wU0=; b=iGPKbueCjY2wxQLML5h/lx9tPcHjwk+EuYiOdXDCKGgpttfCFS25fUfz3rHORa8UB07CZf Y0THPNUDDNg2cchEX6Y2dIZnkRYyofh/m2LztNsMvtRjjtazFPVcWjIA7tzVCJISrKpI/h GDiCK6b6jAOlooQvA+gqSPWyq8M4TevaITcLfzoeDBmq8hhJc1kHjTRpD6ci6uCkf2N46j X5rjXckHidhcyFUFPALDCm5ItHDqMKx5FUuK6opbfFU7yEvfm6j6hr7/pmQHfzKJADGvzv bT2GHRIwlp09e8YlDB0ntsv8036+hkeyylfCN2NZ0OqBaIbTQphCNTvGhJbYgQ== X-Authentication-Results: outgoing_mbo_mout; dkim=none; spf=pass (outgoing_mbo_mout: domain of antonio@mandelbit.com designates 2001:67c:2050:b231:465::102 as permitted sender) smtp.mailfrom=antonio@mandelbit.com X-Cc: Antonio Quartulli <antonio@mandelbit.com>, Tony Nguyen <anthony.l.nguyen@intel.com>, Przemek Kitszel <przemyslaw.kitszel@intel.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>, Janis Edvarts Lacis <janislacis06@gmail.com>, Kurt Kanzenbach <kurt@linutronix.de>, Joe Damato <joe@dama.to>, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, stable@vger.kernel.org X-Mailer: git-send-email 2.56.1 X-In-Reply-To: <20261119140412.163202-1-antonio@mandelbit.com> 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-Rspamd-Queue-Id: 4jVgFK6K6PzLm1Z