Article View: linux.kernel.netdev
Article #6582[PATCH iwl-net v1] iavf: reset the VF instead of freeing rings when queue disable fails
From: Yuho Choi
Date: Thu, 22 Oct 2026 19:27
Date: Thu, 22 Oct 2026 19:27
56 lines
13175 bytes
13175 bytes
iavf_close() leaves the Tx/Rx rings in place because the hardware can
still DMA into them, and iavf_virtchnl_completion() frees them once the
PF has answered VIRTCHNL_OP_DISABLE_QUEUES. It does so whatever the PF
answered: for a non-zero v_retval the error is only logged and the
DISABLE_QUEUES case runs anyway.
The PF can fail the request while queues are still running. ice and
i40e give up before the Rx queues when a Tx queue cannot be stopped,
and ice also fails when an Rx queue does not stop in time. The rings
and Rx buffers are then freed while the queues still point at them, and
received packets and descriptor write-backs land in freed memory.
Keep the rings when the PF reports an error and request a VF reset
instead. The reset makes the PF stop all queues of the VF, and
iavf_reset_step() frees the rings once it has completed. Until then
iavf_close() may warn that the resources are not yet released, and
iavf_open() returns -EBUSY. During removal no reset is scheduled, but
iavf_remove() resets the VF itself before it frees the rings.
Fixes: e284fc88dfb6 ("i40evf: delay releasing rings")
Assisted-by: LLM
Signed-off-by: Yuho Choi <oss.patchbox@gmail.com>
---
This was found by code inspection as part of ongoing, not yet
published research. It has not been reproduced, as that needs a PF
that fails VIRTCHNL_OP_DISABLE_QUEUES.
Compile-tested only (x86_64 defconfig with IAVF, I40E and ICE, W=1).
drivers/net/ethernet/intel/iavf/iavf_virtchnl.c | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/drivers/net/ethernet/intel/iavf/iavf_virtchnl.c b/drivers/net/ethernet/intel/iavf/iavf_virtchnl.c
index e6b7e8f82c7c..178bba609677 100644
--- a/drivers/net/ethernet/intel/iavf/iavf_virtchnl.c
+++ b/drivers/net/ethernet/intel/iavf/iavf_virtchnl.c
@@ -2718,6 +2718,15 @@ void iavf_virtchnl_completion(struct iavf_adapter *adapter,
adapter->flags &= ~IAVF_FLAG_QUEUES_DISABLED;
break;
case VIRTCHNL_OP_DISABLE_QUEUES:
+ /* If the PF could not stop the queues, the hardware may still
+ * access the rings and Rx buffers. Keep them and request a VF
+ * reset; the reset path releases them after the PF has reset
+ * the VF.
+ */
+ if (v_retval) {
+ iavf_schedule_reset(adapter, IAVF_FLAG_RESET_NEEDED);
+ break;
+ }
iavf_free_all_tx_resources(adapter);
iavf_free_all_rx_resources(adapter);
if (adapter->state == __IAVF_DOWN_PENDING) {
base-commit: c03c1a14507dfaf8b856c2608f9ac216021fc222
--
2.43.0
Technical Details
Message-ID:
<20261022192753.69765-2-oss.patchbox@gmail.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-350770-linux-kernel-netdev=dewy.ruShow 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-350770-linux-kernel-netdev=dewy.ru
From: oss.patchbox@gmail.com (Yuho Choi)
Newsgroups: linux.kernel.netdev
Subject: [PATCH iwl-net v1] iavf: reset the VF instead of freeing rings when queue disable fails
Date: Thu, 22 Oct 2026 15:27:46 -0400
Organization: Usenet Network
Message-ID: <20261022192753.69765-2-oss.patchbox@gmail.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Injection-Info: usenet.network;
logging-data="302595"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:IsXFFo+fd0sn9NweLl9eQbbLPrc= sha256:1VULM8wKOjWswL6luscmaGx8lCCqqAT06pTbwe2LEwI=
sha1:BQUL/ENCWUvUqRDOy7+E0vjPqKE= sha256:uATP5p8QR6yMeWMGDnlrR2WvlkdmommUmK0hF9kD3Uk=
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 30F35111350; Thu, 22 Oct 2026 22:28:25 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -3.148
X-Spam-Status: No, score=-3.148 tagged_above=-9999 required=6.31
tests=[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.25, 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 TUzg8VvB1xVL;
Thu, 22 Oct 2026 22:28:18 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.232.135.74; helo=sto.lore.kernel.org; envelope-from=netdev+bounces-350770-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 sto.lore.kernel.org (sto.lore.kernel.org [172.232.135.74])
by mail.dewy.ru (Postfix) with ESMTPS id 16644111344; Thu, 22 Oct 2026 22:28:07 +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 723756061E0; Thu, 22 Oct 2026 19:28:04 +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=1792697281;
b=0XxmnC/sjTT/yPam4+taBWyQfgQBr6F6KHx0murb9NqVF+9aB4ZB5SYHuZsZ3VjtPJTT
o1oS2T6dJxllIZ1vew76nHewv59rAuSl5AAX02Rfwj48o9cgcSt/f7XDx1ZHgisz0HS4j
4kFGg9kW4AeiKuBTUHJEak5XDoKMVaOIubQotU0fQiD0Guh84xU1bEibgjAb7qDp/jwIb
nSQy/03FYmHYhJU2+vPL3eBOCzuwU+B74F0y2U76Yl08BuX+RkDNjwc1aSrf/EVwzB4iI
XB3MWvAc+N1pi5vCyRXPvAF3IJpQKO9ZuTwDjutUh/0zJlBwgt6PlL08qmdOzBq8hSw==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
a=rsa-sha256; c=relaxed/relaxed; t=1792697281;
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: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;
bh=7i5zp/nMBoh4FpTzc2q5LQUaQs09zWC1CfEISFvjXJc=;
b=CGhEWwybn4K0mQ3GMNiQcT2/ve3f2mSSvmkUJxz794WBvjwQZtI1UFZ1E/KYzDXTcDTB
rJR2u+V9zOvT7Cibu1N3yxqH06PWozVchfYfbPg4DQsWP6glbV9vSX4UYitm7N0saHA3m
vMmNUKHRKeUt6BqJaxO/nS5IqgfWliiVsJugA9JVrswwsW4FnIkN0VeHDyfH30IfcK/a+
oyE1yhsx/Rs7F4KtR2sMSLIuq1QDURmrD/N24hduVWr5V2T2FvQfOKLA9L0HQNsUIpiA3
HpK0atqaiyjti2PIlzULeAY+Ra6vk6ha0IXwTLRfW9jhdYAxVw5ZDtESZQVV4lp1K4g==
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=20251104 header.b=jcVNGsST;
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 91812606A326;
Thu, 22 Oct 2026 19:28:01 +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=20251104 header.b=jcVNGsST
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.219.48
X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none;
t=1792697280;
b=Zukd1KkPstDfe07TtVZ9gJKpgAi1FkcI78yJ8k+w132ViHH+8c9M6fEy8PeWajsxyj39
08T5kgePL17Y5jNsjUZ55UIOzcis5DIrikYltDthVBP76yS1Q2hu1iRVJTB1xMFQ5GDQz
MZQjbU7NMMlFgRYI6aYAnX3l8vr30CXw3CYxFWNlm1T3mnvI/AkoT2OEG+JJotiWkgeJY
qyUor8VIvJGtbwGXPF496VxrWIFWttXndpS11iHIAHkT2oOSL+HixenXnUQO0K6xrOqbA
ALUji4OZFKGT33Fg86I1oisjtANYioj65yB6Z9GKQThZFUSNnf/iSjl+0uZCE11wSvQ==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
a=rsa-sha256; c=relaxed/relaxed; t=1792697280;
h=DMARC-Filter:Received:DKIM-Signature:X-Google-DKIM-Signature:
X-Forwarded-Encrypted:X-Gm-Message-State:X-Gm-Gg:X-Received:Received:
From:To:Cc:Subject:Date:Message-ID:X-Mailer:MIME-Version:
Content-Transfer-Encoding;
bh=7i5zp/nMBoh4FpTzc2q5LQUaQs09zWC1CfEISFvjXJc=;
b=qLXm3qafsmtaIry1CI3jb1SVoxjOESrKUurkBlKzijkyiofA2jo3JY0a8jx4Uej5trvD
tvRjreCwbe7ityRZLYxLWL2+4mclzFoADG9NMwucvv5XvY8VVc07AyadEDPYa2x/554BW
yzZJLq2/2tQT9ZDCYNnLtzaylk2W1XxCjEXJyJiL+Wt6p1Bt1NlAdGNjWY/Ferd0OXFgs
BamoUWqITGYiEvetl8osLOtRc4qZLcJ1N5ZUO4Ps3l0fLUeFiOmf/Rfp5QIVdkeFfqEyj
/Rm0KCHu9rs1wLBB8cVEf9yurOOhMj+Tjs60LcVLClEDzRDnEvRIENBjLf2LTK3m6jQ==
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=20251104 header.b=jcVNGsST;
arc=none smtp.remote-ip=209.85.219.48
X-Received: from mail-qv1-f48.google.com (mail-qv1-f48.google.com [209.85.219.48])
(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 5CEB5606A319
for <netdev@vger.kernel.org>; Thu, 22 Oct 2026 19:28:00 +0000 (UTC)
X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 5CEB5606A319
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-qv1-f48.google.com with SMTP id 6a1803df08f44-9196d8543cbso2413656d6.1
for <netdev@vger.kernel.org>; Thu, 22 Oct 2026 12:28:00 -0700 (PDT)
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=gmail.com; s=20251104; t=1792697279; x=1793302079; darn=vger.kernel.org;
h=content-transfer-encoding:mime-version:message-id:date:subject:cc
:to:from:from:to:cc:subject:date:message-id:reply-to:content-type;
bh=7i5zp/nMBoh4FpTzc2q5LQUaQs09zWC1CfEISFvjXJc=;
b=jcVNGsSTUgOJZcsD4vjQuyUcr+VHbKW452Ay+18BZmBjCtAmtShccx2Mm2NqZJqVrL
iA0pkDn622MxPFIfy2TOVL8bEutW1ghtxtQRpbTilXonVWn6Pi3WZ6M6NXcjDjui0fUq
GDfocVuIHpVgJtVD3OvAuGo9GBEyOM4Bugcy52PrhM6KS76zbcrDXkPzVwmazuFERIMp
QTGwZUp/pwg/X3m9uyy8q2qjO3p7oKuT9+YpuaTKAu+eQ57cg+/vbTsw42DJtwVYX6oX
2ByBAGegWuUra3lxMOOJtliqlhHHFSy/Peg0tKviIpbbNYFkYe/yCoJrvA+TtvB9lwd3
Lnyg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=1e100.net; s=20260707; t=1792697279; x=1793302079;
h=content-transfer-encoding:mime-version:message-id:date:subject:cc
:to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date
:message-id:reply-to:content-type;
bh=7i5zp/nMBoh4FpTzc2q5LQUaQs09zWC1CfEISFvjXJc=;
b=bDgNW8ogBp9RojpqJ2W1GTsAZ5lxzzdd7X5JOP0kIKTPMWIc6SxljzzgRSdz8pEnEI
P3hSXpaj1FCDCgf5hQtuqPUo2wr6NrGx0CM1PTnXeuLq1Vt6mlz4voKEub7pKCL/aXMs
WFVZG+B8/r5q1sJEIsOBucxH/YVuQXo9vt5YBym5XHCBrPvDwqN9og2CmssQpWkFJGJx
C0Cc6M+wK51Xc/StSwMt8v3+9A5mgJ0Ilon4GqD9GQuyGJjeF2RVRmZYEM6//LhEyZ5U
HJVFmVlZhvHVtZMdQdO9N7P2Xt4QbqT60J8jy6jS7I/xgbfrO/wNn4oXR4Ofu/G/xnv+
ajrg==
X-Forwarded-Encrypted: i=1; AKwUvBzjkAPhnWSs1YEAC0bZ+VjYvipFU/jtdsdftkq+LIFvPRTO7c1s6WmAjWuQXJIHv1fXUBInedY=@vger.kernel.org
X-Gm-Message-State: AFq9FYJIolVc9QiZxUX2K6GhY+OimZC1LiNW3X5GPx1C4h0xU387BwJB
u3/vCMMXCmIi9DE0lS6z9udNbYE/gPLj7Hk1qGtmMUq6aTRkyd6UEFr9
X-Gm-Gg: AYBFou3BKuG4LC48nHiwIyzGdJWBdRbavTwvp2ZBg8fQ8EBvjUGNlQdPd5U2ZfAgKhg
bT7n/JZZCjT/V0mYNBp2cRa9tu8jOL97cjXUbVKIx6s2X8zXLHoVeUzexaPKzh2EiZUZFl7YJiy
+mwJT1ObykgdwHyrGMpnZg+sagUJb3+XIX4nFL6XFTzrFIoMSwxp1nBRl9pBj33ScYNgRpgMSuY
+eIksFS9uyPIgZqhx5ZHaPEycaO3xs5da5jYGQna3NxNnZ4PGY2nA2/FARxg+OCVRSBGEiO0An6
M+lRI7RiKaNoYDIKFqPkSOZ1yqq1o25YgUPZsKRIsCzX/p32458MS7VLBXsdtpYl0LdFaXlicnT
H+8VY7BcoCqDHZHP0jcSDpN2RfqzI65JQSKtZy+IDd5sS/a81MAMJS14Sh1sZE0Ro8NXcTzHSGJ
4PGc5aqldWt0xU88p9DnSovqsjQMJqFlmDDDny22LAMh1vdMFeAR2noFHZx6s3U+LpbdFBinpvQ
o1e4fX1UrFcgAOVibH4hWnMs2jWSgMO3ND2HRrBUdyyS6HTAsNw2kBOoPr8+AiIbw8DXMonP0Xo
EyQ=
X-Received: by 2002:a05:6214:509d:b0:919:5a24:d20d with SMTP id 6a1803df08f44-91c12eb53a6mr104325966d6.11.1792697279221;
Thu, 22 Oct 2026 12:27:59 -0700 (PDT)
X-Received: from i4-gl-tmk5904.ad.psu.edu ([130.203.156.186])
by smtp.gmail.com with ESMTPSA id 6a1803df08f44-91c396afa91sm370296d6.11.2026.10.22.12.27.58
(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
Thu, 22 Oct 2026 12:27:58 -0700 (PDT)
X-Cc: 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>,
intel-wired-lan@lists.osuosl.org,
netdev@vger.kernel.org,
linux-kernel@vger.kernel.org,
Yuho Choi <oss.patchbox@gmail.com>
X-Mailer: git-send-email 2.43.0
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