Article View: linux.kernel.netdev
Article #13107[PATCH net v5 1/2] gve: refuse XDP on queue formats without XDP support
From: Amaan Cheval
Date: Mon, 09 Nov 2026 10:04
Date: Mon, 09 Nov 2026 10:04
56 lines
13723 bytes
13723 bytes
Commit d8a8ca14c937 ("gve: add XDP_TX and XDP_REDIRECT support for DQ
RDA") enabled XDP on DQO-RDA by dropping the queue_format check from
verify_xdp_configuration(), which until then refused every format but
GQI-QPL. Nothing replaced it: gve_set_netdev_xdp_features() advertises
no XDP features for DQO-QPL and gve_xdp_xmit() rejects it, but the core
only checks that ndo_bpf exists, so a native XDP program, and an AF_XDP
socket on top of it, can still be attached on a queue format the driver
does not support.
The DQO-QPL RX path was never written for that. Its page accounting
assumes the driver keeps a reference of its own across every handoff:
gve_xdp_done_dqo() passes the buffer to xdp_do_redirect() and then
recycles it with gve_reuse_buffer(), so a redirect target that releases
the buffer synchronously, such as an AF_XDP socket in copy mode, can
drop the page's last reference when pagecnt_bias runs out. The page is
then freed while it is still DMA-mapped and registered in the QPL, and
the driver posts it back to the device.
Refuse XDP setup in gve_verify_xdp_configuration() whenever the driver
advertises no XDP features for the current queue format, which today
means DQO-QPL. A zero-copy XSK pool bind is already refused by the core
for the same reason, and a copy-mode bind never reaches the driver and
is harmless without a program.
Fixes: d8a8ca14c937 ("gve: add XDP_TX and XDP_REDIRECT support for DQ RDA")
Cc: stable@vger.kernel.org
Signed-off-by: Amaan Cheval <amaan.cheval@gmail.com>
---
v5:
- Check dev->xdp_features instead of queue_format, and reword the
subject and message around that (Joshua).
v4: https://lore.kernel.org/netdev/20261106114551.212675-2-amaan.cheval@gmail.com/
drivers/net/ethernet/google/gve/gve_main.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/drivers/net/ethernet/google/gve/gve_main.c b/drivers/net/ethernet/google/gve/gve_main.c
index 2437cd8ba633..fe560f5c5408 100644
--- a/drivers/net/ethernet/google/gve/gve_main.c
+++ b/drivers/net/ethernet/google/gve/gve_main.c
@@ -1723,6 +1723,12 @@ static int gve_verify_xdp_configuration(struct net_device *dev,
struct gve_priv *priv = netdev_priv(dev);
u16 max_xdp_mtu;
+ if (!(dev->xdp_features & NETDEV_XDP_ACT_BASIC)) {
+ NL_SET_ERR_MSG_MOD(extack,
+ "XDP is not supported on this queue format.");
+ return -EOPNOTSUPP;
+ }
+
if (dev->features & NETIF_F_GRO_HW) {
NL_SET_ERR_MSG_MOD(extack,
"XDP is not supported when HW-GRO is on.");
--
2.47.3
Technical Details
Message-ID:
<20261109100437.331423-2-amaan.cheval@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-359196-linux-kernel-netdev=dewy.ruReferences:
<20261109100437.331423-1-amaan.cheval@gmail.com>Show 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-359196-linux-kernel-netdev=dewy.ru
From: amaan.cheval@gmail.com (Amaan Cheval)
Newsgroups: linux.kernel.netdev
Subject: [PATCH net v5 1/2] gve: refuse XDP on queue formats without XDP support
Date: Mon, 9 Nov 2026 15:34:36 +0530
Organization: Usenet Network
Message-ID: <20261109100437.331423-2-amaan.cheval@gmail.com>
References: <20261109100437.331423-1-amaan.cheval@gmail.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Injection-Info: usenet.network;
logging-data="323152"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:t6F18EdD0dqXO2yxmQYTvqVTpps= sha256:OEJT7d1uAVir8IayPavPrnI+R6xZBM+NLsGfA7G5fTw=
sha1:Fe7W0o9XEPRNbj7H9t5h/5lquuw= sha256:dvhkBf9QJdInWruWqYuFdwaNrjBMW7Znr+7P766G7P8=
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 27E2C113781; Mon, 9 Nov 2026 13:08:07 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -3.149
X-Spam-Status: No, score=-3.149 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.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 z8BZXt5U8xma;
Mon, 9 Nov 2026 13:07:59 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.232.135.74; helo=sto.lore.kernel.org; envelope-from=netdev+bounces-359196-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 5733811375F; Mon, 9 Nov 2026 13:07:51 +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 2996B61D769; Mon, 9 Nov 2026 10:05:30 +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=1794218726;
b=LfXnNZ5j0WBGzY4kCuG6hmYtnDSuP6I2+hKFKFmolxMKylFRS5a04G6E7isgx39vf5iD
7Jy6PqTR5SYp+bw+EmhNBvzXpZmLeTmbOj8usDJ6Zpf0OFh2Fp0HX/GDZK58x/8rO8j2I
i1BuTguQxjE8r2H8q47GGsa11s4E3QDEEzRUbjm86B8xPe8mjL+PON7z54BpFTYXQEgPV
TkKeoy6T72dSCFPaEtgGZdWc2I83/mS0W07HkiurpNbdRT0PS2hhlz2JPMG1TZYaqqPnB
BIE+fV7auLGKPXMrkNswQxX5W9/qTfZVHxDRRX1Z/Y/ypdpwUhwDXNBeZl8ZWzqFshg==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
a=rsa-sha256; c=relaxed/relaxed; t=1794218726;
h=X-Original-To:Received:DMARC-Filter:Received:DKIM-Signature:
X-Google-DKIM-Signature:X-Gm-Message-State:X-Gm-Gg:X-Received:
Received: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;
bh=DsOK3xaIdRnyMSa9XbrX3s3+g6voTmIrmONsKMzeqsQ=;
b=oleSJlc6ixML4iCOz5KZ8L9iZZ0bLLjOH+ZyrczgLlp9Sz1Fv66sQauDGnxvdWM4Cpp/
Idk6ExAqsTIiDeig0SS/M8xOsD/cXPGhwtBsPyo0GNx8Iwo6H/KDbQjHg0Gpw5oOTrGF5
ejFSW1fBPDRUUS0S+357dg2fEzx7/XfzWFzesIEeuwbHKLCBB8O3mL9VBO5fTWBz4JBqc
G9/UxT83s/iXJQjf4H0h6ADXZceZ2KqgGy0dc+iKUEqOpO1a/yanFoGtOVAwHWSkgUYTM
4p1iGZmKV070aAeYyv9Uvpv093/kKe9LU4Cmfr35KHHD/n8JNZ39dOtGDSaSiYMnYOA==
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=wlromTHX;
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 E7519606A33D;
Mon, 9 Nov 2026 10:05:25 +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=wlromTHX
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=74.125.82.178
X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none;
t=1794218725;
b=NJ3voh/n9TJsyYa448+QISpx4i91zQv3xZVotD5fTbDLDFb7Ic5UYfoD4adtZozTrawk
7QgZHJB1m1dCRfu0ITdYgVowP7v4hMccVjI9hVArqX0zD7p2BOXK5nCg0OPJ0BJ0jVnts
gXGNRwih2tMDxOj67UqRkqK1a3/LhEhzpvyRhiH5cCw9RwFRtg4gWeW7Mp5iExxvE3cbZ
YbM46xBDVpAOlNo0D+0NjZwtxQYoE9DdUQVcvRDS0Xi0dq9yrWL6TIKdrmlS7MQtofJ2w
spBuCE5qUhrYaydlWDrHwWn8tLLJbsPtiz454WA3wGq+IoPZrAYJIyLZBJhrpaGLyDw==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
a=rsa-sha256; c=relaxed/relaxed; t=1794218725;
h=DMARC-Filter:Received:DKIM-Signature:X-Google-DKIM-Signature:
X-Gm-Message-State:X-Gm-Gg:X-Received:Received:From:To:Cc:Subject:
Date:Message-ID:X-Mailer:In-Reply-To:References:MIME-Version:
Content-Transfer-Encoding;
bh=DsOK3xaIdRnyMSa9XbrX3s3+g6voTmIrmONsKMzeqsQ=;
b=zyEHDZEw3SzeCZ08T+EePXD3yHCLHoCEA+dzmiTsU8GzF/0rKQ4Zrxy2gThiEjMDq0OL
jLuo7WMrx9r9ljhpo7ujxqcq3sPE5theLydnK8WIqWcz3DL2IKzqiQw8tSaecDnsux4GL
PcdQN0XHd59RY8ebS6zoDJIgJqFUGZO/Pp/W/plm/0bo5kF3okDT7x4CgCYdvpeZ++VKI
NAAotiNWa7QjvFFToP6+fXFr74LgeEwy1T+W0kTwisVMfxtAQygWoZuT8+mVkrPqxkjWY
AW04RNEUKzhDMack4R/9LFUMI0pnzeKaZX5aMJD/XZXDJkQaAsmM0Q9Lh74JlNY95hQ==
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=wlromTHX;
arc=none smtp.remote-ip=74.125.82.178
X-Received: from mail-dy1-f178.google.com (mail-dy1-f178.google.com [74.125.82.178])
(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 BA056606A322
for <netdev@vger.kernel.org>; Mon, 9 Nov 2026 10:05:24 +0000 (UTC)
X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org BA056606A322
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-dy1-f178.google.com with SMTP id 5a478bee46e88-36e99cf7bb3so1200562eec.0
for <netdev@vger.kernel.org>; Mon, 09 Nov 2026 02:05:24 -0800 (PST)
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=gmail.com; s=20260707; t=1794218724; x=1794823524; darn=vger.kernel.org;
h=content-transfer-encoding:mime-version:references:in-reply-to
:message-id:date:subject:cc:to:from:from:to:cc:subject:date
:message-id:reply-to:content-type;
bh=DsOK3xaIdRnyMSa9XbrX3s3+g6voTmIrmONsKMzeqsQ=;
b=wlromTHXqlNDcGqKiVJjw0vw8vMkcQ1/dgdG8oGvptPI4AKx5hzvAG2oPLaNgi3FBT
XraKeqI/g8Gp0q0uMl2+LBqAgILgLLZc5vCw5niwDJPw7nKvkPpMs7ntvKsBSXRqkjna
NVHAEaV8MmPp9AVPrRot9jIqdzXn/WpvtKgR+SzbYBa+0Svk8rib0suTI2KlgKul0Yxz
HgDP4YKrJuv/N93lA8UcqFu5pGeZaDig9ONXQELh3tWEp7lKyUCgT8uEYmdx8Wkx2Xuj
qDH8HYZUQ517c1Sge5DDjO5vNfJIzN6PWXTRo7OVriuRACwBtT6vWoUsqe3EQbnw7gtG
onTw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=1e100.net; s=20260707; t=1794218724; x=1794823524;
h=content-transfer-encoding:mime-version:references:in-reply-to
: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=DsOK3xaIdRnyMSa9XbrX3s3+g6voTmIrmONsKMzeqsQ=;
b=ilWrIuT/i31pc5M3sq09wuuMZuwHluJKnmDy7aHDADga14YRjL6bP9/JfkFHlhepoE
DPjiJnCQSovytObdu+He10w0faBGkjxXJ7zkFC0aH9qrWSQHsI0IJgSB2dBtb07aeogi
QCTnnL7wAjtbzz1rtIWCRXnUDFv/Nafeq4nzsmIKtH6wT/2gu6XXg0Q0fU/T0oFLeRIn
SjFgP8+aSbtUo1KP/po+8T16IU2cNBwxm8NuxztQxW/xDqLC0bZwALTwQBEr6CUHFC8D
JLaFTxt9PfpuGMOw2atm2bdaCFyeaYN4yFkM+EMXPojsAdY1OqnOvyDoA2HoVUuuqmHp
wTvQ==
X-Gm-Message-State: APuU4Z+0XKR3SioVNOvPHPUwnMlVzamj0vOIDM4mCJhRu863yCPRTpDw
x7pIOPOHtkuneYciX8VvseG+BhfluLPYWXc/KbdblaDSD4UP6e68AmQjPukMdpUU
X-Gm-Gg: AYBFou1jf7TEjBbQp31KnHz1bCj7f69EFQXGlkHCd52FAV0KCuJ9Fo27bGjMzauYE9r
lIkfQ91SsFrVQ3I7mj0wBS/5XoWOLjs96mCJjdtPtx8TzaWtLvUgLWDDCVr8mYl6o9aEDX5T3MJ
aNeUdRgW+5XMwcEdZG7P7hPnZfrWZ9pypkJSKHatdaQczCBk5WQZ6VLQlgz7mzV1/2qo8j8qbgy
S34ajluOIp4mArJxWMv/gTBySAhVzm6GP4u3rT4vINH0DI9AyMARgCpPguGjjMQ92a78Dj6WW8f
G65Jhle6kTKn+qCgustfxesa58iH7UYbmmbItnKDUBDG92s264y3uIczzl8VomRq/6EE6ZxtG1a
c5DD3P5BWBTm95erCxos+H+XzsD1/fCMmzJOBJH68lCoOcknPPfLzlrB8nVWjxchKoflPbrGj9Q
RYS/jOv+Dl9fuge5JniLbh7cXIP5KMwyHYU1v4WLZG1sy3fF1qXYbRwbX9jZQJqHHBIaYtEfk2l
4ranr4MV72P7H7F7W1A18Clp29OfY+ddc1116GYnVcLoSlV7sXm2s7gD2KQ3I+C7kgjNxGNRv/9
a0jonZ8Kfp7YbiHUIV0viXU+MLaiLzVCFuOxvtqWJGQx
X-Received: by 2002:a05:7301:da0a:b0:36a:1434:c691 with SMTP id 5a478bee46e88-37256bed190mr6227845eec.14.1794218723536;
Mon, 09 Nov 2026 02:05:23 -0800 (PST)
X-Received: from localhost.localdomain ([2406:7400:51:5a62:c2b6:f9ff:fe77:10a0])
by smtp.gmail.com with ESMTPSA id 5a478bee46e88-372667d60absm12886710eec.26.2026.11.09.02.05.14
(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
Mon, 09 Nov 2026 02:05:23 -0800 (PST)
X-Cc: joshwash@google.com,
hramamurthy@google.com,
andrew+netdev@lunn.ch,
davem@davemloft.net,
edumazet@kernel.org,
kuba@kernel.org,
pabeni@redhat.com,
bcf@google.com,
jordanrhee@google.com,
przemyslaw.kitszel@intel.com,
maciej.fijalkowski@intel.com,
pkaligineedi@google.com,
maolson@google.com,
csully@google.com,
willemb@google.com,
yangchun@google.com,
npl@google.com,
awogbemila@google.com,
shailend@google.com,
nktgrg@google.com,
maxyuan@google.com,
bpf@vger.kernel.org,
john.fastabend@gmail.com,
hawk@kernel.org,
sdf@fomichev.me,
daniel@iogearbox.net,
ast@kernel.org,
linux-kernel@vger.kernel.org,
stable@vger.kernel.org,
Amaan Cheval <amaan.cheval@gmail.com>
X-Mailer: git-send-email 2.49.0
X-In-Reply-To: <20261109100437.331423-1-amaan.cheval@gmail.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