Article View: linux.kernel.netdev
Article #9015[PATCH net] octeontx2-pf: fix XDP frames freed as skbs on interface down
From: Nicolai Buchwitz
Date: Fri, 30 Oct 2026 20:12
Date: Fri, 30 Oct 2026 20:12
56 lines
10444 bytes
10444 bytes
On interface down, the TX completion cleanup also runs on the XDP
queues, but treats the pending xdp_frames as skbs. Freeing them with
dev_kfree_skb_any() corrupts page pool memory.
This happens when XDP_TX or redirected packets are still in flight on
ifdown, or when the XDP program is replaced.
Fixes: 94c80f748873 ("octeontx2-pf: use xdp_return_frame() to free xdp buffers")
Signed-off-by: Nicolai Buchwitz <nb@tipi-net.de>
---
Pre-existing bug, flagged by the clashiko review of my ipsec transmit
fixes for this driver [1], which seems reasonable (and fixable) to me.
The other pre-existing findings there (e.g. the SA lifetime in
cn10k_ipsec_del_state()) may be worth fixing too, but I'll leave those
to the maintainers.
Compile-tested only, I have no octeontx2 hardware.
[1] https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261027-nb-otx2-ipsec-tx-fixes-net-v1-0-2114c4f10c36%40tipi-net.de
---
drivers/net/ethernet/marvell/octeontx2/nic/otx2_txrx.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/drivers/net/ethernet/marvell/octeontx2/nic/otx2_txrx.c b/drivers/net/ethernet/marvell/octeontx2/nic/otx2_txrx.c
index 90af9b9044aa0..e3b07e5335fb8 100644
--- a/drivers/net/ethernet/marvell/octeontx2/nic/otx2_txrx.c
+++ b/drivers/net/ethernet/marvell/octeontx2/nic/otx2_txrx.c
@@ -1332,6 +1332,7 @@ void otx2_cleanup_tx_cqes(struct otx2_nic *pfvf, struct otx2_cq_queue *cq)
struct nix_cqe_tx_s *cqe;
struct netdev_queue *txq;
int processed_cqe = 0;
+ int xsk_frames = 0;
struct sg_list *sg;
int qidx;
@@ -1348,6 +1349,10 @@ void otx2_cleanup_tx_cqes(struct otx2_nic *pfvf, struct otx2_cq_queue *cq)
if (!cqe)
continue;
+ if (cq->cq_type == CQ_XDP) {
+ otx2_xdp_snd_pkt_handler(pfvf, sq, cqe, &xsk_frames);
+ continue;
+ }
sg = &sq->sg[cqe->comp.sqe_id];
skb = (struct sk_buff *)sg->skb;
if (skb) {
---
base-commit: d8a4f4c59da52b7c31ae337243b8473a19a3f819
change-id: 20261028-nb-otx2-xdp-cqe-cleanup-net-5810d40e1d30
Best regards,
--
Nicolai Buchwitz <nb@tipi-net.de>
Technical Details
Message-ID:
<20261030-nb-otx2-xdp-cqe-cleanup-net-v1-1-710635c0f504@tipi-net.de>Path:
mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-353901-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-353901-linux-kernel-netdev=dewy.ru From: nb@tipi-net.de (Nicolai Buchwitz) Newsgroups: linux.kernel.netdev Subject: [PATCH net] octeontx2-pf: fix XDP frames freed as skbs on interface down Date: Fri, 30 Oct 2026 21:12:03 +0100 Organization: Usenet Network Message-ID: <20261030-nb-otx2-xdp-cqe-cleanup-net-v1-1-710635c0f504@tipi-net.de> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Injection-Info: usenet.network; logging-data="2308074"; mail-complaints-to="abuse@usenet.network" Cancel-Lock: sha1:8r04eGxR1gBCunfskYTE2NRLBRk= sha256:MtnNLFupDbB6fzz4HK3uAvcFkcAGNHEpKnaJAxaavR0= sha1:AtUqNrYEYZli5JxRYrttUwN5mQw= sha256:NpM8141tEdyWDAOOJDpP9INtAsrbRvCuz1TusjOAc68= 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 6DEE8125CA6; Fri, 30 Oct 2026 23:13:39 +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, 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, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (2048-bit key) header.d=tipi-net.de 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 kYZcDjE5-6cj; Fri, 30 Oct 2026 23:13:36 +0300 (MSK) X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-353901-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> X-Authentication-Results: OpenDMARC; dmarc=none (p=none dis=none) header.from=tipi-net.de X-Received: from sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10]) by mail.dewy.ru (Postfix) with ESMTPS id AA433125CA4; Fri, 30 Oct 2026 23:13:26 +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 7246825DCC; Fri, 30 Oct 2026 20:12:47 +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=1793391167; b=1qyDHabvVXaJ+aUwKzklKr5/o1f59Etk/i4Ao3oiqNu83GaRg8Y8VaIniqtRpFjyxl8d c8Zjs4K0b1vQBGYYefz6b5tefS7umXoU5ySXHSEv5l40unsBZWZHBEC68IyE2bZ0oLtga ypS0cUHsYpqnhd5Fv2fW1jJP2+wVnUMYGknLOw3azX6JCt9ldGgrePlR9Zcv9dinntfGj IUDFxiVPA5bc2woDkjxkTKKEA0lNWB7HeWX0x5XuSLndmxLKOnSs9MzackXhfpmtJUpfq GPAOocYNe6TxxtPEkihSSuHm31JR8OOP3z7SxyDtG9MgwhoLsTr3neljZmkmTYXEHBA== X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1793391167; h=X-Original-To:Received:DMARC-Filter:Received:DKIM-Signature:From: Date:Subject:X-Mailing-List:List-Id:List-Post:List-Help: List-Subscribe:List-Unsubscribe:List-Owner:Precedence:MIME-Version: Content-Type:Content-Transfer-Encoding:Message-Id:X-B4-Tracking: X-Change-ID:To:Cc:X-Mailer:X-Last-TLS-Session-Version; bh=f/EQ4RTL5ZaofeX+YVVBXEXZZ41Q19YQIBhtCHASxOM=; b=YDKb8AExTKKWAMU01KNYe6eMVHZhaUmxxnyjf0iBwSMgMk7PeHhVKn5CzmBt8VAsLVcF 1bumHe+gvGZNFSjoOpkUOFtWBDhk+xg/0d92M+oLPyUvCD43Lwx2o1iW3zNtffdV8jpL1 M1yRCFYKkJaZ9nMx0Q35C8tqjGmU7aNHyXE9NchpV4Ekjtzj8cEpJINsyjXjviTlM0Qje BlYuknQ8LKNl63nFsXRGjPbiYhpVRX2Ak8MAK43QBTcyv3T7OrTCDohU3p0LyKq/b6On4 nomFtP5sHTu0K1+hPRpng4OkTBJHpyC+pLfbtC/WkRjl5qfxCZQD7dhac1j6iG6SqsQ== X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dkim=pass header.d=tipi-net.de header.i=@tipi-net.de header.a=rsa-sha256 header.s=dkim header.b=Z8OPLDjq; dmarc=none header.from=tipi-net.de; spf=pass smtp.mailfrom=tipi-net.de; 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 2E9EC606A324; Fri, 30 Oct 2026 20:12:47 +0000 (UTC) X-Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key, unprotected) header.d=tipi-net.de header.i=@tipi-net.de header.a=rsa-sha256 header.s=dkim header.b=Z8OPLDjq X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=194.13.80.246 X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1793391154; b=jPQ3Zko/NBIJioeQBWjfGGbMRbvKE+K2d8xdZc2QNaHpcfpxvxD9i16Wq/hB7D1u4vTQ s/LEmzIkinYxTBOw54+ONkic+KyDgtWlrwCHnA9VyyLr0b7pqZyj6VoiL9t0OUD+SXu3V GoZkM/epbDoXOeLrM/v1u82ON4mScppFLpMJss0+pu5Xoi/V89XdUzqdm8161godAgPHK Tx/Wy3EYcHTMC6e4+B5b0CUgv2Fqd+EOAyV70zCMf0FGA47YqzVEsXJ/1rWzf6e1bqcFc gvRK/zsSB6z95R5KfA6eS4DprUSqVKbZxSpUJkLo+P/TMMaIutiqwm2+1pSj2FWxcdA== X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1793391154; h=DMARC-Filter:Received:DKIM-Signature:From:Date:Subject:MIME-Version: Content-Type:Content-Transfer-Encoding:Message-Id:X-B4-Tracking: X-Change-ID:To:Cc:X-Mailer:X-Last-TLS-Session-Version; bh=f/EQ4RTL5ZaofeX+YVVBXEXZZ41Q19YQIBhtCHASxOM=; b=PrchOWu6P8KJNtS7Fc5uKJoUkBWcm3jJfBrYeRthNHZASPWC3LBwR9HuNlyqDEPM/IIN mt53cFp7BKTlYCjeV6gy5kB41ewenk2JQjkjqI5ce+FeJG78joAV8gmidkpaF/R/S6rqW x4IZCU4OHff078ghv48dDS3uqfPNy3lg95VFIHDnMcsksepePjeS4/FCJCrU4FrCiZ2Xq XPuxOEV7qBOO8G+0ytZNgkolk8JLzRGVrdt6zqAS56btTwiijBI0L067gKju7+fJPYQev iiioby3G32Aid0Lx/FlJ1N/3aAyYS/Y4f/Z2p9BA8R+MKbXl1cCR9NbtxZlCJBpHbkA== X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none header.from=tipi-net.de; spf=pass smtp.mailfrom=tipi-net.de; dkim=pass header.d=tipi-net.de header.i=@tipi-net.de header.a=rsa-sha256 header.s=dkim header.b=Z8OPLDjq; arc=none smtp.remote-ip=194.13.80.246 X-Received: from mail.tipi-net.de (mail.tipi-net.de [194.13.80.246]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 15C44606A326; Fri, 30 Oct 2026 20:12:32 +0000 (UTC) X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 15C44606A326 X-Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=tipi-net.de X-Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=tipi-net.de X-Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id CDAE9A1579; Fri, 30 Oct 2026 21:12:26 +0100 (CET) X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tipi-net.de; s=dkim; t=1793391150; h=from:subject:date:message-id:to:cc:mime-version:content-type: content-transfer-encoding; bh=f/EQ4RTL5ZaofeX+YVVBXEXZZ41Q19YQIBhtCHASxOM=; b=Z8OPLDjqD4THolW8m69iOqwWZ10KH3uaPNX5f4GJ2JzC3e9G2tqC0kYky2SW8OQDQZQreS Uc2NfypAXgRpmsnT2cec7Z1g+wZ1xSWRIjdd34LUeEusNAwIKbdV4/Jf/cpdE2nTycicrA U/4CovaMqVddZ+8QRVnB0xUtK5xkv02y49QfD60Gcb8e0Mjbmqrh/FcKkiE59+yBHKw4wE a2lH81G/RddNm9YlCtbKRj1PjbR1sOmZMFa7DMWKr/yMR7x1qrZyGn6L9gwTzCwMXDlZdx e/fKMwL71qDezNCBoxcyF3zbGEr6Kpe2NFN+Zx/qt4ZURlYCgg0k6vjcordkoA== 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-B4-Tracking: v=1; b=H4sIAAAAAAAC/yXM2wrCMBCE4Vcpe+1CEg8UX0W8aJNRV2Qbk7QES t/dqJf/MHwrZSRBpnO3UsIiWSZtYXcd+cegd7CE1uSMO1njetaRp1Id1xDZv8H+hUHnyIrCx96 acDCwYW+oCTHhJvWnX6gd6Pof8zw+4cvXpW37AKG1UmyEAAAA X-Change-ID: 20261028-nb-otx2-xdp-cqe-cleanup-net-5810d40e1d30 X-Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, bpf@vger.kernel.org, Nicolai Buchwitz <nb@tipi-net.de> X-Mailer: b4 0.16.0 X-Last-TLS-Session-Version: TLSv1.3