Article View: linux.kernel.netdev
Article #22036[PATCH net] octeontx2-pf: QOS: Don't free SQ memory if disabling the SQ fails
From: Yuho Choi
Date: Tue, 24 Nov 2026 19:00
Date: Tue, 24 Nov 2026 19:00
59 lines
13298 bytes
13298 bytes
otx2_qos_disable_sq() asks the AF to disable the QoS send queue, its
aura and its pool, but ignores the result of otx2_qos_ctx_disable().
If the mailbox request fails, for example on a timeout or an AQ error,
the driver cannot confirm that all three contexts have been disabled.
It frees the SQBs, the pool stack, and the aura flow-control buffer
anyway, which the hardware may continue to reference.
If the disable fails, log an error and keep the memory: leaking it is
safer than freeing memory the hardware may still access. If the queue
is not set up again, otx2_free_hw_resources() frees it later with the
other queues when the interface goes down, after the SQ and NPA
contexts of the whole LF have been disabled.
Fixes: ab6dddd2a669 ("octeontx2-pf: qos send queues management")
Signed-off-by: Yuho Choi <oss.patchbox@gmail.com>
---
Compile-tested only (x86_64 with COMPILE_TEST, OCTEONTX2_PF=m, W=1). I
don't have OcteonTX2/CN10K hardware, and the disable only fails when
the mailbox request to the AF fails, so I could not trigger this path.
drivers/net/ethernet/marvell/octeontx2/nic/qos_sq.c | 12 ++++++++++--
1 file changed, 10 insertions(+), 2 deletions(-)
diff --git a/drivers/net/ethernet/marvell/octeontx2/nic/qos_sq.c b/drivers/net/ethernet/marvell/octeontx2/nic/qos_sq.c
index 683efce519af..e9ca884cfb4d 100644
--- a/drivers/net/ethernet/marvell/octeontx2/nic/qos_sq.c
+++ b/drivers/net/ethernet/marvell/octeontx2/nic/qos_sq.c
@@ -283,7 +283,7 @@ void otx2_qos_disable_sq(struct otx2_nic *pfvf, int qidx)
struct otx2_hw *hw = &pfvf->hw;
struct otx2_snd_queue *sq;
struct otx2_cq_queue *cq;
- int pool_id, sq_idx;
+ int pool_id, sq_idx, err;
sq_idx = hw->non_qos_queues + qidx;
@@ -311,8 +311,16 @@ void otx2_qos_disable_sq(struct otx2_nic *pfvf, int qidx)
otx2_cleanup_tx_cqes(pfvf, cq);
mutex_lock(&pfvf->mbox.lock);
- otx2_qos_ctx_disable(pfvf, sq_idx, pool_id);
+ err = otx2_qos_ctx_disable(pfvf, sq_idx, pool_id);
mutex_unlock(&pfvf->mbox.lock);
+ if (err) {
+ /* The SQ, aura and pool may still be enabled, so don't free
+ * the memory they point to.
+ */
+ netdev_err(pfvf->netdev,
+ "Failed to disable QoS SQ %d (%d)\n", sq_idx, err);
+ return;
+ }
otx2_qos_sq_free_sqbs(pfvf, sq_idx);
otx2_qos_aura_pool_free(pfvf, pool_id);
base-commit: 37fa509e43ba59d7c329025436e8ea64bdf089d7
--
2.56.1
Technical Details
Message-ID:
<20261124190046.415260-2-oss.patchbox@gmail.com>Path:
mbox-mo1.pugleaf.net!srv.newsdeef.eu!newsfeed.bofh.team!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-370699-linux-kernel-netdev=dewy.ruShow Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu!newsfeed.bofh.team!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-370699-linux-kernel-netdev=dewy.ru
From: oss.patchbox@gmail.com (Yuho Choi)
Newsgroups: linux.kernel.netdev
Subject: [PATCH net] octeontx2-pf: QOS: Don't free SQ memory if disabling the SQ fails
Date: Tue, 24 Nov 2026 19:00:24 +0000
Organization: Usenet Network
Message-ID: <20261124190046.415260-2-oss.patchbox@gmail.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Injection-Info: usenet.network;
logging-data="16011"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:azbNh7gxowIO03JM/c92iW6neuo= sha256:G6LnfSS/0D4PnFDO9Y2AfwHekoBX+mw/o2SQB7AFJ9A=
sha1:SDySHiaqkoC2Gg8QN8CfSM6VmAc= sha256:E/ES75BM4jabYvWy9a6VFYtdacPos3HS1R4LiP8DwNI=
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 68556125E2C; Tue, 24 Nov 2026 22:01:13 +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 gJl51tkblAQo;
Tue, 24 Nov 2026 22:01:09 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-370699-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 6D8FE125E22; Tue, 24 Nov 2026 22:00:59 +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 0FD1929AA7; Tue, 24 Nov 2026 19:00:56 +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=1795546855;
b=fJ6HC3tq96wkKidmZoRT6rNCfADvdK5wjkOpbrfNr6EOH2AzDuQqWz5fnnzYy35VCIkT
VmVLTMa0UAfKJl7UptgZnJVbjqNn0RSwDcWZ99/3HEGVvJGjIE/3xtD9akUvhrBFF9oaE
LIvou7AUxjK3tnYsHK8gdGIN+GtyFpindxxAGBBBiNrklS9CbaLCjhgA1AlabqT4/R1ks
wTVwlCHxc8QXhFPeBz7OiT77sKwOtMR524PFJcWtlx85r4v0NeylyDGstzCcJghjALYJq
zUShkZKlpl6urTmqMrkjAOlOHauv1Wo+mqPT2MhpgUZU4qjhuICSpXBqGnHggjDLf4g==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
a=rsa-sha256; c=relaxed/relaxed; t=1795546855;
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=RHBx7ygYBwCCasJ5yEJegoYV5JS6x5lsxOb8QKtvS9k=;
b=nmAUrDMXPKslZhYUWrOMVLf06l6tBD7fjeHSnTa4RHXDAbIGQhxetBLzpZG7fj/1z4lx
b8Z0NcRCs3CCQz2GsrX+dHBfqrAL3pjfY4aHZM18hbCZS5sy3g/ZLbusbCwoD7KOzQtJw
3GKAB/pYz2DMvHZ7GofWbfG2LV3C9e+RawSaN0LtIFF0uKxn9QHlZYuIFYBPRFJQFvhwy
2OnDFuEEpTDaxeKrtJC6BNL4Fas2L9bxdGQeM6q2MFUiev3OoqQNdTNGHXWqkODZdtFyl
QvRaYXkSN1O7IvZEYaJNL4zP1hbRhyGioh7x7FOSIlNyWe6TiENwVmvTQnvDvm4f8Bg==
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=jJLcQr8I;
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 11164606A682;
Tue, 24 Nov 2026 19:00:55 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org;
dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=jJLcQr8I
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.210.47
X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none;
t=1795546854;
b=Ac79Nwm7iSQPkjSqwLDjmDFlkDLJ50MyQ6xY0Qvp/OL7Ktu57GgUAx8htlqi5h92D6q/
hsClHPQZ9SljQ2z4MnG7I7v2sPnJbcUw70H7wqutxR4KsS8sKLPrEU2hUYwaT8e7VSqqU
9a+T86tmO5G14kprxmYGj3+ZwdkOD2+nK/rpgrnqLXjPsGLBUb/MMSqUB5/TO+asSEaV3
Dt4jJPhcNNdUtGSqp5I6sQp49YIrcb5MxZyOT4i6QFl9Y5dFgXi4qbHRXQQoVONlQUfDQ
zxNdmaWoE3o1SygMkI+eZJggcd3+U0hfw/JpCGNfFnSwwn3uE+EMauuAaSPzj2QwtiA==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
a=rsa-sha256; c=relaxed/relaxed; t=1795546854;
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=RHBx7ygYBwCCasJ5yEJegoYV5JS6x5lsxOb8QKtvS9k=;
b=wAaTXQV8M7z8ZvCUpwxyBG1sZYiy/Fp8yE5JrNjtLROYsLf5akQJz8/f4pFYcZrwazFv
bSFu6bWj3ontnA1+PwugqFBDxrX3SiTiQpoLg8D4QwwUVI0afdzOvxSVx/Vt5YYZmZMX2
of0JunuurLYKe93YSU67KOWMBIYIUqpHxq7T5N/NsPiwAbehNHSj14sTmgZfISV5WuaOa
s3TMpVbxWM1WHnIDoyocqlGSXc6yUErEgNIM2QyGXsTL2UNakOeamOV7NDTOR4PJ2Zdo9
/oZGYblIMQFjOltNpROIOMb/RaBT5i7X8FWAPyv0EbGhuQzX5c0FiFjyTGFhMJx1SFw==
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=jJLcQr8I;
arc=none smtp.remote-ip=209.85.210.47
X-Received: from mail-ot1-f47.google.com (mail-ot1-f47.google.com [209.85.210.47])
(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 7A369606A33F
for <netdev@vger.kernel.org>; Tue, 24 Nov 2026 19:00:52 +0000 (UTC)
X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 7A369606A33F
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-ot1-f47.google.com with SMTP id 46e09a7af769-862b76e3c8cso2262355a34.1
for <netdev@vger.kernel.org>; Tue, 24 Nov 2026 11:00:52 -0800 (PST)
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=gmail.com; s=20260707; t=1795546851; x=1796151651; 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=RHBx7ygYBwCCasJ5yEJegoYV5JS6x5lsxOb8QKtvS9k=;
b=jJLcQr8ImXw64vcfyKHysAvmhH04E8XpGsxubPMVDRF+m+paCKtYuLwZaO1ucPPz8Y
e7msC8PSzO/eMTlzDsNLyLkSHMD5krRY6YVyW+KTpJBefmCRTv63M3am4cLb+ky8pzHu
esF+xHHYgibAk8kylahRJlIqOWxpfg/rCuSAzNhxxakCRsRnmQJ73Q856bOgVwVL4KYk
GAOInZQaQBDcKE9qQPe9LKvidUKkJ2KhkY0BRxAeGkO7Q9CToBGuuDeKQtAiYyi//ZgG
6lJA0oiAoka5CgKuA8UKAVVAUFJFogfMkSBpKJ2VzaGyU+hLKfOiuHCob4539tuj2siB
5P7A==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=1e100.net; s=20260707; t=1795546851; x=1796151651;
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=RHBx7ygYBwCCasJ5yEJegoYV5JS6x5lsxOb8QKtvS9k=;
b=Z69rI5fM6iq99ItwL5Gpb+qJ9X8NXstSWU9nllesdZt+mrAoFafu1I2w+G3iNs3Nk2
cYz+L2358o/9HO4KpazLarkhSFBPrXSN34equAnJjTCK5qStAT4+v8/9tVoMhk0brPI2
da1S9ITlhNmd9XP3Y6ZJ9q/ZuuIZQvk3D11qA0MQlpugITp7Jmo6jCqycQVSAq6SKjRe
RvRHBdxFs5zkYoDQBLwbZI4n14OyCoiRFVaZFux7/VpdyBS777pY6GFSkPXaDU99/jtj
SPJj5gcvirWDQ0m0SSBWT02lsCrK5APKXcIkxO8tLZ5V17DkymFtuj2HoAHOly1ztyhf
1NTQ==
X-Forwarded-Encrypted: i=1; AL+hErHbHiu2RYLNReKxceT81UpcKFQW9Bjx7iZ6E31z/z+/9QC7pqca1xnIIf3iUnmETYqeQQd/H9k=@vger.kernel.org
X-Gm-Message-State: APuU4Z/TrjlIXSsz47OrBSAXovSR8vJGyeusCrgdXQdtn1Nh4WiTNRjy
Kcx2DjHtTeR8esUEYfcW23/fJpabvsCqpappy77lyxJsyrjDwgWAXF8n4FmWWw==
X-Gm-Gg: AZFdTZdGOMQ5CWgFO1XkABSWgHnpYYFcCm5hVVjKqUuuXcK5OW2Z7RkjMKsnTWBFEXC
F3W+gCvcrdedMhINPQcfqgm7BMuttkZG51hW8HhYXrgZ7+GzJy3e0RJiLddkPL0EYUPqPoeTkBX
bOIh3q9wWHBJStYkXc5e/qVcRoAXS/3JMpkb+EO8FVaIW6Ett9HjfDHq1Qmw/6KKG3jmziXcEbG
ciOQkDQSeuGhVmMqi/LCERFYnICRkTX6N6ot96OMfSMzD/io+arRG8/Bgj1eam6mgRWzs/L8PNW
PLbrBtOYfhcUxvsYTQ6BX3UodKx82HnsP7fj0tprVyFxgWJaSy6KBAWH+YVsLAqIn9zfofuNoPI
nJX9V21AkXbYdipzwNUXdzJuW4ftQMxqiHib44+1gxvSMhPsXWCX0wrhYLIA/wM6pHBf5tW5QRh
NbiL3P26yay+IPtMGc9TzuVzhc7TsvAlj/+TIxDbiWwhSORrQa+Esb/FeMv/j53QGkO2paet1z6
1ZHz+zuyVUjxAeqgjFPAongSBNlwWH4s0ARMW+OLDUlp3RPnxwmpRCwxHgLHJYTzRlOsgGcEsK4
KsN/tKkIMHPLDa3v7FFC1vJkL7CLun1PnBAEVkD8dWxNu2QcrBcLUzf7pqOIISN61eRY+LE0ySX
CFUdBn0/FPhwSlPHWAAJF9nd5qdSE247zOWPu7SJ5jcfSc0RTQ7JrfHqp4wM7At29YxU=
X-Received: by 2002:a05:6830:3150:b0:862:a5bf:38d4 with SMTP id 46e09a7af769-8631566a485mr19652167a34.18.1795546849762;
Tue, 24 Nov 2026 11:00:49 -0800 (PST)
X-Received: from tempest-testimage-cc-centos9-stream-server-1191361818 (chi-dyn-129-114-108-164.tacc.chameleoncloud.org. [129.114.108.164])
by smtp.gmail.com with ESMTPSA id 46e09a7af769-86316822ad4sm11049218a34.3.2026.11.24.11.00.48
(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
Tue, 24 Nov 2026 11:00:49 -0800 (PST)
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>,
Simon Horman <horms@kernel.org>,
Jacob Keller <jacob.e.keller@intel.com>,
netdev@vger.kernel.org,
Yuho Choi <oss.patchbox@gmail.com>
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