From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.221.51 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== 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== 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 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 ; Fri, 4 Dec 2026 20:44:10 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org BA82E606A322 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com 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 Received: by mail-wr1-f51.google.com with SMTP id ffacd0b85a97d-4a7b8abe209so943711f8f.0 for ; Fri, 04 Dec 2026 12:44:10 -0800 (PST) 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+ YQSpPw4bafe4ajlk7tR8Y5YxKOcp9aNWqCH64S/buY332Vl+24FMo5iLscB0E352qZ02 F+7/Irh++PH0Has2NyVZt1i+cLwNichDbEIMUxjxNqLNlTq3S+gfhvA/boo/A0bvbLWk VemryAryoXItjVhpJqD/2Mbq/NqDTNOt9oZIzE+XQpeLV/aqTkY8Z4/0nYiw22dBg07v ICuryRvnlTfjvCNQWR0mbIKjXiajkzLJHljNUcVuKQxi30rX5GA9lcB+8iB7Y/VZqUAc L6pw== X-Gm-Message-State: AB4q+uHqP/Wz65xeL7ktiJ5o4OrIIp7Jmznpciy5du4/b2l4nEukfPSb AOMAavDLBTpN52Dk4sNR/ArjonmqBTiodskgpx8Bt2GjdkAVh+dXUXUz X-Gm-Gg: AZFdTZdxJ1D1xpNhXDvMtiX3iWthXnq4abw8a8VqrQXCBVQVfev+N03I94MvshYJL7F zWmQFXNvAsBRvWtMjPOoWwmuwiZ2loekHRhC7J8pbKjo2wBhRMapG9e/lUhAhX6X6tfu4zSiwhS oAy7FaUJSUlDRGynuY8RCbIL9f4BeTWKFrFbnc8Akztjm5Tb1s/A4pCEAOk84fuPeAZhTQ5bSu4 Xa76gs6x6cql8XN/F8caLSVxJ+PrQba4J1YQ8Qm8lI9K8gtlyA3hJY2WoQQJ/tfywj6SsV3Bv/l vVGfk2aabLeTYz9Lq8FJN4njS0LUvsQ8Ax03PVYTQHgbmVES/v+eM6VIY86BXsjS3FpcU8g6/yQ dQr5AQwUwNKVRrTnnpEgVUCKe4okz0MZEL5LdN95S8HxJiw43qyYtffvsRqR4Cw43W2Wwn20DJx 1zRh4z2I11lV7FJYqksBx6Mh4SkdO53GJ67U+WGmKqEFLqfhSrZdgG+ye0Taxs6dkG1vn7dhbq4 yS/NnGuBFP+hOVsykF0OBF7YDLuQ+R1Y40lazKnSVC0CQcNdeqoj6Vzk2bosOBigPVj6xpR9h1h lxLuNeH9SKuQ//nj5fqgNkXuN8vAHDgEW/e0xOPO6hrL X-Received: by 2002:a05:6000:2f87:b0:490:71a7:6f51 with SMTP id ffacd0b85a97d-4d1ea5a8a51mr5947676f8f.45.1796417048946; Fri, 04 Dec 2026 12:44:08 -0800 (PST) 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) From: Matteo Croce To: Tony Nguyen , Przemek Kitszel , Andrew Lunn , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Alexei Starovoitov , Daniel Borkmann , Jesper Dangaard Brouer , John Fastabend , Mohsin Bashir , "Nemo D'ACREMONT" Cc: netdev@vger.kernel.org, bpf@vger.kernel.org, intel-wired-lan@lists.osuosl.org, linux-kernel@vger.kernel.org Subject: [PATCH net-next v5 0/6] e1000e: add XDP support Date: Fri, 4 Dec 2026 21:43:54 +0100 Message-ID: <20261204204400.87468-1-technoboy85@gmail.com> X-Mailer: git-send-email 2.56.1 X-Mailing-List: netdev@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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