Article View: linux.kernel.netdev
Article #27126[PATCH net-next v5 0/6] e1000e: add XDP support
From: Matteo Croce
Date: Fri, 04 Dec 2026 20:43
Date: Fri, 04 Dec 2026 20:43
129 lines
16514 bytes
16514 bytes
This series adds XDP support to the e1000e driver, with multi-buffer
frames, XDP_TX, XDP_REDIRECT and .ndo_xdp_xmit.
As suggested in the v4 review, the Rx path is reworked first: the three
Rx routines, and the clean_rx and alloc_rx_buf function pointers, are
replaced by a single routine using the libeth helpers, and XDP is built
on top of it:
- patch 1 processes Tx completions from NAPI also in MSI-X mode (82574),
as page_pool buffers can't be returned from hard interrupt context;
- patch 2 disables NAPI in e1000e_down(), as a page_pool tied to a NAPI
instance can only be destroyed while the NAPI is disabled;
- patch 3 removes the packet split Rx routine;
- patch 4 replaces the two remaining Rx routines with a single one:
buffers are allocated from a libeth page_pool and assembled into an
xdp_buff, which can span multiple descriptors, then converted into an
skb;
- patch 5 adds XDP support, including XDP_TX and XDP_REDIRECT, for both
single and multi-buffer frames;
- patch 6 adds .ndo_xdp_xmit, so that the device can be a redirect
target, with or without a program attached.
The hardware only supports power of two Rx buffer sizes, so it is always
programmed for 2 KB buffers, and frames bigger than that span multiple
descriptors. With the standard MTU, long packet reception is disabled
and frames never exceed a VLAN tagged frame, so the buffers are
allocated just big enough for it, two per 4 KB page.
The device has a single Tx queue, shared with the regular transmit path,
so XDP_TX and .ndo_xdp_xmit place the frames on it with the Tx queue lock
held. The libeth_xdp Tx helpers assume dedicated XDP queues, e.g. a frame
can be split across bulk flushes, so like ice the Tx side is handled by
the driver.
Attaching or removing a program resets the device, as the Rx buffers
are reallocated with the XDP headroom. Programs without frags support
are rejected when the MTU allows jumbo frames, and the MTU can't be
raised above 1500 while one is attached.
User visible changes: the copybreak module parameter and the
rx_header_split ethtool statistic are removed, as the copy and the
header split Rx paths they refer to are gone.
Tested in QEMU, with three emulated 82574L devices connected to the same
hub, one of them moved into a network namespace as the remote end:
- drivers/net/xdp.py selftest: 21 of 27 tests pass, the other 6 are the
qstats ones, as e1000e doesn't report queue stats; same result with
MSI-X and with legacy interrupts;
- UDP frames reflected with XDP_TX, with a redirect to the same device
and with a redirect to another e1000e without a program attached:
250 single buffer frames of 18 to 1472 bytes and 450 multi-buffer
frames of up to 8972 bytes in each mode, none lost or corrupted;
- 60 seconds of bidirectional TCP traffic (8.95 GB) while about 180k
frames were reflected onto the same Tx rings with XDP_TX and redirect,
with 17 reconfigurations in the meantime (ring sizes, MTU, program,
link down and up): no corrupted frame, and the device works normally
afterwards;
- no page_pool left with in-flight pages after the interfaces go down;
- the same on a kernel with KASAN, lockdep, DMA API debugging, kmemleak
and a strict IOMMU, without any warning or leak report.
The other driver selftests give the same results with and without this
series. ping.py's native XDP tests fail, as they ping right after
attaching the program, while the link is still down after the device
reset; without this series one of them is skipped, the other fails.
Tested on an Intel 82574L (PCIe x1), connected at 1 Gbps through a
switch to a Realtek RTL8111, which generates the traffic with pktgen.
The RTL8111 can't send more than about 0.53 Mpps of 64 byte frames,
below the 82574L line rate, and the 82574L handles all of them in every
mode, so this is the load of the CPU handling its interrupts at that
rate, with generic XDP before the series and native XDP after it:
before after
no program 53% 51%
XDP_DROP 19% 4.5%
XDP_PASS 58% 54%
XDP_TX 28% 8.5%
XDP_REDIRECT 28% 11%
XDP_REDIRECT sends the frames back on the same device, as there is no
other e1000e. TCP throughput is 941 Mbit/s in both directions, with and
without the series, and with and without a program attached. The
XDP_TX and redirect tests done in QEMU pass also on hardware, with
MSI-X, MSI and legacy interrupts, and with the link at 100 Mbps. The
device keeps working after 12 reconfigurations under 0.15 Mpps of
XDP_TX and redirect traffic, without leaving page_pool pages in flight.
v4: https://lore.kernel.org/all/20260323182823.5813-1-teknoraver@meta.com/
v5:
- rework the Rx path to use libeth with a single Rx routine, and add
multi-buffer support (Maciej)
- take the Tx queue lock for XDP_TX, as the ring is shared with the
regular transmit path (Aleksandr)
- don't put the program reference on ndo_bpf failure, it's done by the
core (Aleksandr), the interface is now reset with down/up which can't
fail
- .ndo_xdp_xmit still stops at the first frame which doesn't fit: the
caller frees the remaining ones and reports them as dropped with the
xdp_devmap_xmit tracepoint, so they are not lost silently (Aleksandr)
- clean the Tx ring from NAPI also in MSI-X mode, freeing XDP buffers
from the hard interrupt handler was not allowed
- fix the cover letter, this series is not about AF_XDP (Maciej)
v4: bugfixes
v3: removed a leftover file.
v2: added a missing 'select PAGE_POOL' which triggered a build failure
with some configurations.
Matteo Croce (6):
e1000e: clean the Tx ring from NAPI in MSI-X mode
e1000e: disable NAPI when bringing the interface down
e1000e: remove packet split Rx
e1000e: use libeth for Rx buffer management
e1000e: add XDP support
e1000e: add .ndo_xdp_xmit support
.../device_drivers/ethernet/intel/e1000e.rst | 15 -
drivers/net/ethernet/intel/Kconfig | 1 +
drivers/net/ethernet/intel/e1000e/e1000.h | 66 +-
drivers/net/ethernet/intel/e1000e/ethtool.c | 1 -
drivers/net/ethernet/intel/e1000e/netdev.c | 1853 +++++++----------
drivers/net/ethernet/intel/e1000e/param.c | 6 -
6 files changed, 792 insertions(+), 1150 deletions(-)
base-commit: d5cf954cebe4f175dfd834e1dc471a3aa203ec7d
--
2.56.1
Technical Details
Message-ID:
<20261204204400.87468-1-technoboy85@gmail.com>Path:
mbox-mo1.pugleaf.net!feed-us-txt.newsdeef.eu!feed-us-ny.newsdeef.eu!srv.newsdeef.eu!news.mb-net.net!open-news-network.org!3.eu.feeder.erje.net!feeder.erje.net!feeder1.feed.ams11.usenet.farm!feed.usenet.farm!feeder.usenetexpress.com!tr3.eu1.usenetexpress.com!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-377620-linux-kernel-netdev=dewy.ruShow Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!feed-us-txt.newsdeef.eu!feed-us-ny.newsdeef.eu!srv.newsdeef.eu!news.mb-net.net!open-news-network.org!3.eu.feeder.erje.net!feeder.erje.net!feeder1.feed.ams11.usenet.farm!feed.usenet.farm!feeder.usenetexpress.com!tr3.eu1.usenetexpress.com!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-377620-linux-kernel-netdev=dewy.ru From: technoboy85@gmail.com (Matteo Croce) Newsgroups: linux.kernel.netdev Subject: [PATCH net-next v5 0/6] e1000e: add XDP support Date: Fri, 4 Dec 2026 21:43:54 +0100 Organization: Usenet Network Message-ID: <20261204204400.87468-1-technoboy85@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Injection-Info: usenet.network; logging-data="2861060"; mail-complaints-to="abuse@usenet.network" Cancel-Lock: sha1:7AV971XCmNHvlSQb5weNK38ssXE= sha256:F03JJGk+IxMWjLtpp+Ia0Tzy0TIZW9/Z6446tkL30So= sha1:nyQpJQhS4tLh3eT/ZGXbBAzVcP4= sha256:yfTCWw0hcS02LgBLPcZHxYwj9GZRK1NEpZhZ8Alklwo= 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 B8A2B117CDD; Fri, 4 Dec 2026 23:44:43 +0300 (MSK) X-Virus-Scanned: Debian amavisd-new at usenet.network X-Spam-Flag: NO X-Spam-Score: -3.396 X-Spam-Status: No, score=-3.396 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.001, 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=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 Th4-NS1I42jY; Fri, 4 Dec 2026 23:44:40 +0300 (MSK) X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.105.105.114; helo=tor.lore.kernel.org; envelope-from=netdev+bounces-377620-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 94031117CD9; Fri, 4 Dec 2026 23:44:32 +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 1053729150; Fri, 4 Dec 2026 20:44:27 +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=1796417057; b=2ULhiKMIAZ+C6nQ+afp2k9Ap5HcRio6uOJStLyyJaoXWfVVIqzlaXP7WLK53c5hGHyyE c6gI+32iyTkRwBsTYjXUhK80P3ewP93PwzzSL2QA+E1je5Q4yS8XJLbaNpXohib/wxtmf zPyAU+2de3joMAJezu6LW+Lngp30B0hd3sYCgZpeyUHEVhFwP6OM8QzonCLgCOzBacFu4 eWtMkhUHck56LW/PjJzLa3Ys8DPNTqAH3os3Qa+lKg6nOq5r62B8B2GFdaZJmYzlkTOzL eG+hrWVYXDI5pVGTX5ZonZNqqq/T6gxzJYmjDgVIdbleTVOnTAe+e8EWTQBpr824SeQ== X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796417057; 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:X-Mailing-List: List-Id:List-Post:List-Help:List-Subscribe:List-Unsubscribe: List-Owner:Precedence:MIME-Version:Content-Transfer-Encoding; bh=Eic7SGmr77uWNzINDCyhcriWZF+7RaE41R6NaL8QlK0=; b=isvKgLOXGLtyfNc2I02LXODGkiIldlUeoMAiag921WIZT5rHYQzk7JBd/fp1w+q9r9Hv wRMXTeRHm4tBTAMZy+W413U1MoCEPlxSAbcEx0nx3ye6KNPmYwIL5VndLInewbLaua4XU PuXEP09fbHWOuOY+TdHJKT+upGAki9br/2c7DFADriVjp4PgJkmAwxWRBsUFV8cdi7Szg TcB/S5qgObvBLWO/2ZbI8XWkJ3s2OlceYrxtTx4L58NC6Ri0xyHY6eed1ETGpG6m2lb2R 9tXd21rcQrrSYX3QHoFQeuO1fMQLXyZv//hed4da/yKJg+x5ecV6/HnlZ9Zve0cxnTg== 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=AzD3m5Z7; 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 02D7A60A262D; Fri, 4 Dec 2026 20:44:17 +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=AzD3m5Z7 X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.221.51 X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796417051; b=dPEVJUz1fAVM4cnhZxluOt0+OmwhInSxTZRH5UV8w65j5XuoCu/+nZbtSgTUhnVbgGQY u/Aev+lcUxlp/ZhSOFIp85xbnGxM+o3T1wxXNOvF1weRA274TKw2u50pBA2e3Tu28yTuS iuumUgYBzr1zUNMUJvQqWp6taO7CF1/f+uxvTvbEzgh7VCKwRY8H5SC6da1T8jLsbXgaM bWe6SeaUAO7bh3yJoCbdia2LVWOhyrqB5nlypFuf2R2qJQV3kJBburWlJUbRcwhe4RLRG S+swGfXDe/oK1iujoojd8ooLJZ97pENlu+39JRKjE4X/8UYM021EMpal6+RB+xCgjBg== X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796417051; 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:MIME-Version:Content-Transfer-Encoding; bh=Eic7SGmr77uWNzINDCyhcriWZF+7RaE41R6NaL8QlK0=; b=LzdWLPvKo6kj/2YibpwjjY2snVXx6lifi7jhU4oq3/R0k1Q8DRDQawvrwIBb9MxBgLzI 4C4plln890+OKgIMNvRTUGTipCEpN6hJTC9ErV7AV12By4ERk26E17PEG22bJZgYvOm9m PyY0i8l0DXC57IQY7vA165RHsYOzt1Xg4cOnvEp5fnn/O0VhfDcWSBmZHW5yVH4ccSFlP yRdhyFW6xXQjCgJHt1cACRPLqJI3fsw33LbHitjT2TyfH3Lm3mHX9KYTsMvJFS/rD9+Y4 GVfHP9+yf58UDKnVosyKo1J6FkybMhBZKJpnX4/Ccrnwofbr9BJyWLJto1dEANay3sA== 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=AzD3m5Z7; arc=none smtp.remote-ip=209.85.221.51 X-Received: from mail-wr1-f51.google.com (mail-wr1-f51.google.com [209.85.221.51]) (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 BA82E606A322 for <netdev@vger.kernel.org>; Fri, 4 Dec 2026 20:44:10 +0000 (UTC) X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org BA82E606A322 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-wr1-f51.google.com with SMTP id ffacd0b85a97d-4a7b8abe209so943711f8f.0 for <netdev@vger.kernel.org>; Fri, 04 Dec 2026 12:44:10 -0800 (PST) X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20260707; t=1796417049; x=1797021849; 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=Eic7SGmr77uWNzINDCyhcriWZF+7RaE41R6NaL8QlK0=; b=AzD3m5Z71uoXGqEpsModX4GiN5xR0VMtVA6JsFnCibhuMAEWrkGaere9Z/TJMQaBxy 6J0uB9EdGOBRE2Mh2saBSy74prum2MfmnWe0Vpx4Gu4nSiQKC5jQib7MHV795M+nfNUB iK09PqQcsY65E37K3xeuHGhmiI/6kV69nGMgxpcHDc2hdNqrR6Ka9fFqbqgzOgD0HQrk gs/aZkRpWqWyHjc3f1yY7Q6M7DTtCLNB4nx1qHUU5nHSocMh58lnUFGtnP+27xtGT1bq IHFhP4KpSvV7RzweDJb5YRdMQn0xpqC1oEfEbWWY+dsCXcoPCQYMSq288zHWyMq0NagF hSdA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1796417049; x=1797021849; 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=Eic7SGmr77uWNzINDCyhcriWZF+7RaE41R6NaL8QlK0=; b=j35xNWEcY0ze/4Zzr5Yq4GQBSlcn3huo37KoSdp/h48sng4exYggrvMyf3+c+RvZt+ YQSp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87:b0:490:71a7:6f51 with SMTP id ffacd0b85a97d-4d1ea5a8a51mr5947676f8f.45.1796417048946; Fri, 04 Dec 2026 12:44:08 -0800 (PST) X-Received: from turbo.teknoraver.net ([195.182.211.216]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-4d173ab8d7csm7851524f8f.41.2026.12.04.12.44.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 04 Dec 2026 12:44:08 -0800 (PST) X-Cc: netdev@vger.kernel.org, bpf@vger.kernel.org, intel-wired-lan@lists.osuosl.org, linux-kernel@vger.kernel.org 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