Article View: linux.kernel.netdev
Article #25543[PATCH net v7 0/7] igb: fix runtime PM resume issues
From: Antonio Quartulli
Date: Wed, 02 Dec 2026 00:23
Date: Wed, 02 Dec 2026 00:23
100 lines
14390 bytes
14390 bytes
igb can be runtime suspended when the link goes down (with power/control set to auto). The suspend can deadlock with an RTNL holder resuming the device, e.g. ethtool (patch 1). Resuming calls functions that need RTNL without holding it (patches 3 and 5), XDP and XSK changes race with a resume or follow a failed one (patch 6), and devices that can't signal a wake-up are suspended anyway, so their port stays down when the link comes back (patch 7). Patch 2 fixes the XSK pool disable path when the device has fewer rings than the stack has queues (a single Tx queue with VFs on 82576, or none while runtime suspended); patch 4 keeps such queues while they still have a zero-copy pool, so that it can still be disabled. Tested with the 82576 emulated by QEMU, with test-only hooks to delay a runtime suspend, to make the open fail on resume, and to force MSI with a single queue on resume. Before/after this version: ethtool during a runtime suspend hangs with RTNL held / completes, and the suspend is retried; closing a zero-copy AF_XDP socket after a failed resume hangs in napi_disable() with RTNL held / completes, then removing the XDP program works. The runtime suspend tests ran without patch 7, as QEMU's 82576 can't signal PME. Not tested: real hardware and PME wake-up, a real system sleep, PCI error recovery. Not run under KASAN. Pre-existing issues left for a follow-up: in the XSK queue disable and enable paths the Tx NAPI isn't stopped when Rx and Tx don't share a vector, a failed buffer reallocation leaves the queue half torn down, Rx wakeups fail on a queue without a Tx ring, and the XSK state isn't handled during PCI error recovery; a failed igb_open() at the end of igb_xdp_setup() leaves the NAPIs disabled; system resume rebuilds the rings without RTNL; and an XDP program is checked against the buffer size of rings that haven't been configured yet. igc has the same resume issues (see the notes) and also takes RTNL when runtime suspending; its fixes will be sent separately. Changes in v7: - patch 6: only update the software state on a detached device, and only check the Rx buffer size when adding or replacing an XDP program, as removing one failed after a resume with the interface down (Sashiko) - patch 7: comments (Sashiko) Changes in v6: - new patch 1: don't wait for RTNL when runtime suspending (Sashiko) - patch 2: the message and comment name the runtime suspended case (Sashiko) - patch 3: the work item resumes the device first (Sashiko) - patch 4: only zero-copy pools keep a queue (Sashiko) - patch 5: don't cancel the work item in __igb_shutdown() anymore - patch 6: handle a failed resume (Sashiko) - added Janis's Reviewed-by to the unchanged patches 2 and 7 Changes in v5: - new patch 3: keep the stack's Rx queues that still have an XSK pool (Janis) - patch 4: cancel the work item before a suspend (Sashiko) - new patch 5: resume the device before changing XDP or XSK settings (Sashiko) - patch 6: check pci_dev_run_wake() when scheduling the suspend (Sashiko) Changes in v4: - patch 1: also handle queues with an Rx but no Tx ring, as with VFs: tear down the Rx ring and skip only the Tx part (Sashiko); subject changed from "don't disable rings ..." to "don't touch rings ..." Changes in v3: - new patch 1 - patch 2: set the real queue counts on system sleep resume and from a work item on runtime resume, and drop packets for queues the device doesn't have until then (Janis, Sashiko) - patch 3 (now 4): link the NAPIs from the same work item Changes in v2: - patch 2 (v2 patch 1): keep setting the queue counts in __igb_open(), only skipping them on resume (Sashiko) - mention the tested hardware in the commit messages v6: https://lore.kernel.org/netdev/20261130213740.3323814-1-antonio@mandelbit.com/ v5: https://lore.kernel.org/netdev/20261124235723.1135808-1-antonio@mandelbit.com/ v4: https://lore.kernel.org/netdev/20261120210134.133238-1-antonio@mandelbit.com/ v3: https://lore.kernel.org/netdev/20261119140412.163202-1-antonio@mandelbit.com/ v2: https://lore.kernel.org/netdev/20261116153041.3002666-1-antonio@mandelbit.com/ v1: https://lore.kernel.org/netdev/20261113105835.3821433-1-antonio@mandelbit.com/ Antonio Quartulli (7): igb: don't wait for RTNL when runtime suspending igb: don't touch rings that don't exist when disabling an XSK pool igb: fix RTNL assertion when resuming from runtime suspend igb: keep the stack's Rx queues that still have an XSK pool igb: link queues to NAPIs under RTNL after runtime resume igb: resume the device before changing XDP or XSK settings igb: only allow runtime PM if the device can wake up drivers/net/ethernet/intel/igb/igb.h | 2 + drivers/net/ethernet/intel/igb/igb_main.c | 185 ++++++++++++++++++---- drivers/net/ethernet/intel/igb/igb_xsk.c | 42 +++-- 3 files changed, 187 insertions(+), 42 deletions(-) -- 2.56.1
Technical Details
Message-ID:
<20261202002317.3140591-1-antonio@mandelbit.com>Path:
mbox-mo1.pugleaf.net!srv.newsdeef.eu!news.mb-net.net!open-news-network.org!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-375450-linux-kernel-netdev=dewy.ruShow Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu!news.mb-net.net!open-news-network.org!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-375450-linux-kernel-netdev=dewy.ru From: antonio@mandelbit.com (Antonio Quartulli) Newsgroups: linux.kernel.netdev Subject: [PATCH net v7 0/7] igb: fix runtime PM resume issues Date: Wed, 2 Dec 2026 01:23:08 +0100 Organization: Usenet Network Message-ID: <20261202002317.3140591-1-antonio@mandelbit.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Injection-Info: usenet.network; logging-data="1851024"; mail-complaints-to="abuse@usenet.network" Cancel-Lock: sha1:FTeIaVF6x/R/AYk1twdDxPBT174= sha256:Dtzh5nJi3DKHjr7ZKlqe8kfDFGV+ZQV1iXs6IesCbZE= sha1:0EgJVcXJPA9boLzDfvD5WXrJb64= sha256:u4PCh7dwMFZpGKY7p+7HW0X1J/UL34QvuJHA4z2NePY= 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 E26A01174F9; Wed, 2 Dec 2026 03:24:04 +0300 (MSK) X-Virus-Scanned: Debian amavisd-new at usenet.network X-Spam-Flag: NO X-Spam-Score: -3.15 X-Spam-Status: No, score=-3.15 tagged_above=-9999 required=6.31 tests=[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 502XdY6KLVvy; Wed, 2 Dec 2026 03:24:01 +0300 (MSK) X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.232.135.74; helo=sto.lore.kernel.org; envelope-from=netdev+bounces-375450-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 sto.lore.kernel.org (sto.lore.kernel.org [172.232.135.74]) by mail.dewy.ru (Postfix) with ESMTPS id 7B9E91174FD; Wed, 2 Dec 2026 03:23:53 +0300 (MSK) X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92]) by sto.lore.kernel.org (Postfix) with ESMTP id 1EEFD602F6D; Wed, 2 Dec 2026 00:23: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=1796171016; b=O/kcOFZg2nSEwFZnC0mQdHsJE08DSPnjI5ZKhyT3qz0CMT8HrUnQCVFf5CuNPYilV+sI JICiIxBHNrTzWEupVoXZwOe++xlNhtqNKZWH0fGHF4k1tspKHv5iB0DrMafBHOg0COlQv Wxzpn/yuGgUKeEMvMZkvFkqrR+9R/3KYeW7RIFXkjEuDaUHTf7/OkUcrLFXoBvedf0cuD gM+XHZicWvInPJr4MNvnN+fhADulOeQf91o+X6G1lZ+RqDYkOAU6dkHs67l3GjDYo+OsD /DKebNSP3LWu0QxTUX5RJhfEd36BiYZTjH0q8yNdZ+bliE3/q2Asy03NPZUiRhGGVcA== X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796171016; h=X-Original-To:Received:DMARC-Filter:Received:DKIM-Signature:From:To: Cc:Subject:Date:Message-ID:X-Mailer: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=fhvt+MNbDQS2xMAVgSC98idT8GU2HDuoS5gnlK9eIfY=; b=RGqTQ1cgklf2Gcw19t3fuphsadYmPNSy5xsKYJEs/bm2fVmmSX1rY9CyhZJGtIOWv454 Ind5DtLuhSJpOFkr4oCt+gJoTgNv5cCWOCzBPdLFzaNqP+BfAhpfbCcjMlH8/MlGO5y2u 5mBDiGvPgWQcuid72h/0/cIAnv0zsLzaee3ZbEfs1NS02DN3Mlbaw3pvxUOsomgT3EG3c UY2E3TWS8fkmK1BPfxWeSwEilJtTvQD0yj//926bJOjyYm51hNUOtZ1hH+dbNmDjNT3oR i7cmoyIySEHA4LkaedCp4K/j1Buf3x9/L9qrNSAa8InI+8rCZibc/AgjBB32j4oUFXA== 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=ufhCEvmH; 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 2525D60A2624; Wed, 2 Dec 2026 00:23:36 +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=ufhCEvmH X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=195.10.208.50 X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796171010; b=0mlYxM1bC4PVlZBIIEDC1NI65eVmYK7kZhCsPtjg2GKxmbdQ/REU15UxW1CdWQCEm+NK Z2WwDkvZLnl4dm3MBB/aMwjU52FCVed9A4Rf4OkvOLP64PPw0AyuUDs0K1NBkaI1Pn4Ex SHvLdy+/K0K2SYd177Riwi98Fv5qGM6+hCG/oeRbjy2mPDBXS8ugFGsHYlPq/7Rq5jNpK 0F85sRnErP/HoFcWl52ZWFdsz7RX0gqiuBOUOdSi4EdsATthiV+r47IIPD7q2nFlzBxvL 30ELhXeS4XCzvpkiisNTuqwIVGvajLhTpWFS4EYfClcyB8hB/LtQT+pIMVWj8kjU7+w== X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796171010; h=DMARC-Filter:Received:DKIM-Signature:From:To:Cc:Subject:Date: Message-ID:X-Mailer:MIME-Version:Content-Transfer-Encoding: X-Rspamd-Queue-Id; bh=fhvt+MNbDQS2xMAVgSC98idT8GU2HDuoS5gnlK9eIfY=; b=ytei0B0QLjz+WDnXKsC/qQ4UWrko+xQDirMfRmdl98fbyhAqEdGfa2EwQxH2MosJZJ7K fwKZld4QJpxu6EcZjhxVZIByGKFgfwuSnJNKnmZR09kLAJCx4/qtpSSDm5L3Rqz+Nnyhk ojrDZn0rg9SNg2I8tRHkIKatp0H3mmYLBbqv82NY/+JosaTrZslIbkT+X/25r6bktG99N PBcCWOR5oiqnRkUqq8ct+qvPzYXTyzcekjwi8KPA3qB38a4pfUZCKN/BWmOseIk8Ic3/Z 6hHOBmhL0yxPixXm57t+baD3QaFEh23fDocU0KxZIKwK/5pRHOpvIY7EP0k1PLyBYcg== 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=ufhCEvmH; arc=none smtp.remote-ip=195.10.208.50 X-Received: from mout-b-105.mailbox.org (mout-b-105.mailbox.org [195.10.208.50]) (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 8D01E606A320; Wed, 2 Dec 2026 00:23:29 +0000 (UTC) X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 8D01E606A320 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 smtp1.mailbox.org (smtp1.mailbox.org [IPv6:2001:67c:2050:b231:465::1]) (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-105.mailbox.org (Postfix) with ESMTPS id 4jfJQ01CWXz9tfW; Wed, 02 Dec 2026 01:23:20 +0100 (CET) X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mandelbit.com; s=MBO0001; t=1796171000; 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; bh=fhvt+MNbDQS2xMAVgSC98idT8GU2HDuoS5gnlK9eIfY=; b=ufhCEvmHHDsTro0CERUwUDsv0k6i9tk6YgONro4qY3ar4QaF1z2Zpmr6/afgW3vkXBmwD6 016bSfI/nb5TB2ET06oWSv9v5GYboxYlRysSncK66ijEBSUhnQ4TQc4//Art6wkm7JDbnT 4AFR3FD36PGpJfxem6jacb0XTFlAaYGPqzyWwbZC/7bt2SPZZM5OGahLxlKv5y1tem6jBj vg0fck1MQr5Da2R8Lm28HIbywkHLcPnsr9l05UjYRafTkybOgj/kjbI7Oz5004EnnQybei tUVxOUFeTKWZYkWCyIu7iaMQ8U89j8tuWOOwhzHYne6fwa9uF94iD5P3JN8klA== X-Authentication-Results: outgoing_mbo_mout; dkim=none; spf=pass (outgoing_mbo_mout: domain of antonio@mandelbit.com designates 2001:67c:2050:b231:465::1 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>, Alexei Starovoitov <ast@kernel.org>, Daniel Borkmann <daniel@iogearbox.net>, Jesper Dangaard Brouer <hawk@kernel.org>, John Fastabend <john.fastabend@gmail.com>, Stanislav Fomichev <sdf@fomichev.me>, Sriram Yagnaraman <sriram.yagnaraman@ericsson.com>, Kurt Kanzenbach <kurt@linutronix.de>, Maciej Fijalkowski <maciej.fijalkowski@intel.com>, Heiner Kallweit <hkallweit1@gmail.com>, Joe Damato <joe@dama.to>, "Rafael J. Wysocki" <rafael@kernel.org>, Sven Auhagen <sven.auhagen@voleatech.de>, netdev@vger.kernel.org, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, bpf@vger.kernel.org X-Mailer: git-send-email 2.56.1 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: 4jfJQ01CWXz9tfW