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=UWo+b2+oBFe6SpNkmwFkEtdPmzwF5ZOgx1PRi2Qjnif+BG6kwj92UG+5iWOUxpdayeOF iIq5oJncmzQMEDU5k7bavtzTw8NSSR/gy3PAWsPxW1Gs+iJtDDTuB2ufeE7PY9ZSLEtvR P95U5F6Mk262MMvDVg7rhqyGu6KjkNXA3qiC/86tEAEWrMBWezJA3DMDlwJwLrAznaOB5 gESEFW7Es9x73X/WghCJNB9aMKuFvYuTajPqvpqLlLW4Y4jD527mu2sLf8tm9qxdy4gDN JJmJGiMuGUnwJK0b+pKh7L8oZJ+2Bi89vTdVDfSeVh+CztEfJApgXfm2fdXlSpz7nMQ== 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-Forwarded-Encrypted: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=JiHc1hmh61TjasYaqL2KFB1UCLeEtv4OQAjgw4U1lJaik4JLgGmmVGVyJbFIOdDWTdS/ PcgY/HIL6KHedZMV6nAg9xfIJj8jH61Ig+lTmoB8MI2dg+PsU3A/npzUqS6BHvk0VOwHM guF3meQMSGXTiH+xpTkBeaLR9NyuQb/r5Zc98HR1j7skbo6B7UaslT2pqT/rAlcJXY1Mm 3lSkRRzvRTMwQa3tn69MAObwmeu6GItNYkMW29t5RcjEhn2ycp9LeQbn06QX3L7Z932LV o0yujTgIJ4jtPC5J47KQkeZd7CVlul4nSAeLNnsjxcTxn4Zftq0+/r+SaI/8HHouLZQ== 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 BA8F0606A32C for ; Fri, 4 Dec 2026 20:44:10 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org BA8F0606A32C 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-4c8fef0a906so836569f8f.1 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=BsCxyUIPbHOwe4M11Ymv+ujx5cxOw0jOl8aqsgWEwWiqbSBmtNI0Ej5cgfyNeG8bc6 Z6GHZn5nswFziTL0EaIvmZPHCenTaq/Qhy4uNTDNhJtUnfQoMLGQuxcks0RPP7mdiSYj 59v67paQW6PHQAmVuDjPOM9+h1WDLMlDWqxuGDFlyA2IGtiBF5+Mqst5GYIa0PzTy9lI vzO5DEhIr2X/9DlM46THnmWOZ3h84WfyEZq3jDgfhmuU3mYO7FWWr5TVOCQZ29+t/dCw mf/U9qw+4rX76T97V/kqDJRMDCtg2061Q17KMVOhiIH8AlhybAgCOBEaOsXw6t4O6OIB +WBQ== X-Forwarded-Encrypted: i=1; AL+hErEZs7L+V6JDeTvn/yYGHBG12FAwdb3mwKqTlnZHNGc8s+u+5wwyoAhP+grpu9g5Z0JCjRo=@vger.kernel.org X-Gm-Message-State: AB4q+uFqREp/lWxbIrmMqx/1AsxO1f62bGGUssYxYfTjsvOarwj7jUJR hqWes5vj+VPMB1G4VXYt1gRvx2IZVT2JswZgZrV24FD/LVsXJd1OPCQp X-Gm-Gg: AZFdTZdIPx9YoUAxyHkhzD/jCSLfa3q6S3GvKbczazYQtk9WNAUB3M5hpRHiIwgBZFH LAhRUjva1HJzTLKf7H9Pj8EzFt8Jst4kC6GL7BCwtg5tc7dHvjTdFC1RnYr/KuJjvTpXXL6TE8B ZNn0NHm8qkYG7T7el3kgv0Ym6VcXUFJTTOFYYqqPRxE+rgNRS8/BWpC4//tzyLi3m2pkQr7DKMe KCxqWXHMVYaVFN2ODKA8yNWiSW7nOSIX+oKhVCitGlsHfWSU/wSyi4noK1Woq7CTXFmh8NPQ2fG 7k33QVNrFw8bHS4KZAiMt8WbRq445L5uLJ0m0icxjSV/BHWVJre6bWOKftlmbaXt/jGcaEj38Gl fZXGzFXUvsCdmxaCQ5tYLrxMnCfJq3mXE4F8qwzdOpoxx7zb/UT8PIvyoLFs+0cYDJ96wYzrrkw kKsjjKbPzdJ5Sur7BD24ht+jHfHtfglRmlsXN19n8VxpfBjpaiWuxwqbSp9A+/O0px70/w9c9a9 Yj5rqegjOw2YmWJVANenBVEgEZM/viklBM9WW579bFyK1a81SZhTRqOWjNoy66ijBWZl+LkCkjY KlmQwMuGsZf7Yj6LDjk48kGyp0Rxv/OjX2wT0nJfVfXG 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: bpf@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