Article View: linux.kernel.netdev
Article #14983[PATCH net v6 1/2] gve: refuse XDP on queue formats without XDP support
From: Amaan Cheval
Date: Thu, 12 Nov 2026 09:14
Date: Thu, 12 Nov 2026 09:14
66 lines
14346 bytes
14346 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 GQI-RDA and gve_xdp_xmit() rejects
both, 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.
GQI-RDA is no better off: an XDP_TX there goes through
gve_tx_fill_xdp(), which copies the frame into tx->tx_fifo, but a
raw-addressing TX ring never allocates that FIFO, so the first XDP_TX
writes through a NULL tx_fifo.base.
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 and GQI-RDA. 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
Reviewed-by: Joshua Washington <joshwash@google.com>
Signed-off-by: Amaan Cheval <amaan.cheval@gmail.com>
---
v6:
- Say the check also covers GQI-RDA, where XDP_TX writes into a TX
FIFO that raw addressing never allocates (Sashiko). Message only, so
I carried Joshua's Reviewed-by.
v5: https://lore.kernel.org/netdev/20261109100437.331423-2-amaan.cheval@gmail.com/
- 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:
<20261112091451.22969-2-amaan.cheval@gmail.com>Path:
mbox-mo1.pugleaf.net!news-lax.pugleaf.net!srl.newsdeef.eu!newsfeed.bofh.team!nntp.comgw.net!eternal-september.org!feeder.eternal-september.org!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-361635-linux-kernel-netdev=dewy.ruReferences:
<20261112091451.22969-1-amaan.cheval@gmail.com>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-lax.pugleaf.net!srl.newsdeef.eu!newsfeed.bofh.team!nntp.comgw.net!eternal-september.org!feeder.eternal-september.org!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-361635-linux-kernel-netdev=dewy.ru
From: amaan.cheval@gmail.com (Amaan Cheval)
Newsgroups: linux.kernel.netdev
Subject: [PATCH net v6 1/2] gve: refuse XDP on queue formats without XDP support
Date: Thu, 12 Nov 2026 14:44:50 +0530
Organization: Usenet Network
Message-ID: <20261112091451.22969-2-amaan.cheval@gmail.com>
References: <20261112091451.22969-1-amaan.cheval@gmail.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Injection-Info: usenet.network;
logging-data="1049469"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:7A8p4WuHYmgsjE9DvpyBu8neacA= sha256:z/G5jGY0xbb0+nPswaM9A4lZCyk0vc0nEMI8dZY5kUs=
sha1:c0WKMaslBKF5Bjpk9ZpOPZB4ICg= sha256:iO8LYHcHY/vQbmEnFizjTue7H/MwLxgBxvOJA18iXDk=
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 8475E114102; Thu, 12 Nov 2026 12:25:02 +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 5CqTosY3gOZm;
Thu, 12 Nov 2026 12:24:58 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.105.105.114; helo=tor.lore.kernel.org; envelope-from=netdev+bounces-361635-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 tor.lore.kernel.org (tor.lore.kernel.org [172.105.105.114])
by mail.dewy.ru (Postfix) with ESMTPS id 9824E11416B; Thu, 12 Nov 2026 12:24:50 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92])
by tor.lore.kernel.org (Postfix) with ESMTP id 8BD0FC860E; Thu, 12 Nov 2026 09:15:48 +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=1794474927;
b=crtE9/X1QC6U8djEAJxpBmclIT/o6kzbxf6qtPlmB2ql02fBc5xKX0fCWe3s5BtOsiwT
NlAIJOicvbh1sTWsF+Nc9XV+GRfmfZLIzxWj0+EqhMD3e2klB+dpFTj1p0ojmWEPfbb4+
AFnFc4hx1/EUsgJ5S4U8IryitxRvMjsB4xs1xSyiZaumBQmVMwIoOJjPmxzU+FZjFvRNJ
lH6A3am54a74DF/CLfznqJNPfKFZ7gKBSAhsKX9K6E7LAUX42+8XR7/5OvISL/NuUOjND
igAFNcuTEMK94mPqhHQKrFCt9kmKOtSvTfOXjC232ypJ4Ygqw9TAjwmGYT1lfYv2X9A==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
a=rsa-sha256; c=relaxed/relaxed; t=1794474927;
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=cEN7d+jyurewLFa/LuiPLiAZonMx9OftX2NbfIlKgdw=;
b=g0ZtlG8hAPBGCmWadA2RYA9OGS69lecNT7U2bFMRswyYqBa5cjmDrmC5v6nDAIYuInpo
wf/8hhgDeZlNhoquGrVAx2VCERb55G8tPdWnfEOk3UxxqKsvLQAJ+I2S4BkwXNloGsCBj
Nf/5h+6axdOkvw9GGRPKqBU4la2pzuJrwORLMjvTbH1eteVJpavIjZeZWXbNuG+INUJkl
fWZ2v2lI8Ky3KQ+Ar1dil1wIgcP+h0+MSrqZQDJZLmU3lnmsexxiJz/gyC9D1jyCbURnj
J+1+n7wmbVjeVayO2sOHeq0Cy04qCbkox7XVTE6lxCeOiUOTFadb1gcNrWyQ4LFyOqQ==
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=RdELOKkG;
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 AF497606A890;
Thu, 12 Nov 2026 09:15:27 +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=RdELOKkG
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=74.125.82.172
X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none;
t=1794474926;
b=gYX7lAy2oRya/Foxn0akUblWjzMA9qCpG/jZFndMJkAPztlU9/eB7ZcjeteV98E3mDva
SW1ivK7DFS9XtqURTqWlSPzYe38kWW3uFqfdkgbRjPn+yExg5QovlEum1X4yLsk2voNXb
IAuwopqaNWH6f2nxivWRRxOMTL/2N7vOWXelOwhyDBO05xEcJDIn2yJqZaitz8FLCAWif
zfKq+Bld/2eJcFxvcUH5p8lBMIoOnNFYcnVYOJsSnXod8knvyOe5sRVNx5PWPMSoS2M0D
EQG5LBVhUJqxNNaVzIs8Tv6Zd7M0EjKRffkrsKOEeXnizTxtadf7QazSFT964TsByog==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
a=rsa-sha256; c=relaxed/relaxed; t=1794474926;
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=cEN7d+jyurewLFa/LuiPLiAZonMx9OftX2NbfIlKgdw=;
b=NBFB4SEoOcJgxjHVotyb8kyjyCWCI2P0EniIlEU4H8hnCx4MoyfumH7SGaEEoQg+JpHU
d5t8hX6JdttpXjPQZT0XatOGAVZsVrUIdPDZW6EQu1sZbDP9iFx9SwTDp04deM0y46G1H
t9uP9j4nTf/4t9anK+mbqgM0yf7Bsp8TmAjoOhznEpSoNC4K3rqDniqP3eN/fW7HH0uXA
Mjx5XNorgWnpoIOgM26uLNwC6/89YFLuA1a73jPkg2CKjoHovY570wTEOUp7aOuOu/Vae
xiILPDdRd9keM9/hx1wFwUXOQYqNbDjDOZDhmx8engDZroeax86JVGujko8+B0sfYBQ==
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=RdELOKkG;
arc=none smtp.remote-ip=74.125.82.172
X-Received: from mail-dy1-f172.google.com (mail-dy1-f172.google.com [74.125.82.172])
(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 83375606A32D
for <netdev@vger.kernel.org>; Thu, 12 Nov 2026 09:15:26 +0000 (UTC)
X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 83375606A32D
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-f172.google.com with SMTP id 5a478bee46e88-372bdb942dbso5196968eec.1
for <netdev@vger.kernel.org>; Thu, 12 Nov 2026 01:15:26 -0800 (PST)
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=gmail.com; s=20260707; t=1794474926; x=1795079726; 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=cEN7d+jyurewLFa/LuiPLiAZonMx9OftX2NbfIlKgdw=;
b=RdELOKkGhI/YuUC1xnfrm+5EXnd8mmiRPEm4bZGtKq8StrF+btPPCAlsUV3okt0tpU
JmJ4jZG9ZqPA4105qLMh4EKJsPIAQAtMuGfMFB1PNMjdRKgccORMbGJEdHd38dhZYob1
CUUY/6UmSXOm1ZApgLezphXnJIf7TaTeBdV2fGjdLahhS1BnM6KmeYygB/icQXnOr804
52EwsS7iHDyY4FEPgiTh8RnkXWGW6RbuFcEuarHwbbS2+qIVxhV4RzRduneXq/kRCKye
P3YvP7ReONvCelis5BZGSZ3f+f8kC/z+jk4mqQXDtUOPGhzhtfaa54W67JHaSFXcZd49
0VLw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=1e100.net; s=20260707; t=1794474926; x=1795079726;
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=cEN7d+jyurewLFa/LuiPLiAZonMx9OftX2NbfIlKgdw=;
b=exCxmPg4Aow/VOPLPYADQoR5/DXFOrY9RIs7wZRrNoVW0RDsAhC5UDDaXd4xwcHLKT
hKFAWQP0wHEhKgTM/u7r+ZMhPfl/+odNB2cCobe0ghXEPA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a478bee46e88-3768675676dmr5379824eec.24.1794474924729;
Thu, 12 Nov 2026 01:15:24 -0800 (PST)
X-Received: from localhost.localdomain ([2406:7400:51:27a4:c2b6:f9ff:fe77:10a0])
by smtp.gmail.com with ESMTPSA id 5a478bee46e88-375212e7d24sm40096319eec.22.2026.11.12.01.15.13
(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
Thu, 12 Nov 2026 01:15:24 -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: <20261112091451.22969-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