From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp1.osuosl.org (smtp1.osuosl.org [140.211.166.138]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B1EEC606A320 for ; Tue, 1 Dec 2026 13:58:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key, unprotected) header.d=osuosl.org header.i=@osuosl.org header.a=rsa-sha256 header.s=default header.b=lIiFg+eP; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=mpsucTkt Received: from localhost (localhost [127.0.0.1]) by smtp1.osuosl.org (Postfix) with ESMTP id 9153780F7B; Tue, 1 Dec 2026 13:58:08 +0000 (UTC) X-Virus-Scanned: amavis at osuosl.org Received: from smtp1.osuosl.org ([127.0.0.1]) by localhost (smtp1.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP id 8li3eUkVoyFY; Tue, 1 Dec 2026 13:58:07 +0000 (UTC) ARC-Filter: OpenARC Filter v1.3.2 smtp1.osuosl.org BC08780F9F Authentication-Results: smtp1.osuosl.org; arc=none smtp.remote-ip=140.211.166.142 ARC-Seal: i=1; d=osuosl.org; s=arc; a=rsa-sha256; cv=none; t=1796133487; b=FUt37SVviiBZ83Ek5Ueh4VBw8hh6OWQf2M8RTFCF9Bu1haCdRJW18bdsP2DL17HW173q FuC6IeEgqNCOD6t9PN3LAKwemdga9u3nGb9MCYssgrb9u4QIo+MlbvqYjjyBjR4XHs9j7 r4DfYwYG9nsFI2rREVnjyHsTJcAaHqqg2Z0eEXRITpXd443RFsdHoaR1lmi29n7gwlYLV WeHv0HS/9nfnpPKL/W3tP5nx84DHsH2eC27/1OCShnV7U9XaFaqbjy8odgP8GrYve7hlS a2Cqns8E5rq5u+ckeT4d0nUpqW/8Q7bP1qJXI2c7XOIrESgYE5lDtS/9VvfpgRf4x/w== ARC-Message-Signature: i=1; d=osuosl.org; s=arc; a=rsa-sha256; c=relaxed/relaxed; t=1796133487; h=X-Comment:DKIM-Signature:X-Original-To:Delivered-To:Received: Received:X-Virus-Scanned:X-Spam-Flag:X-Spam-Score:X-Spam-Level: X-Spam-Status:Received:ARC-Filter:Received-SPF:Received:Received: Received:DKIM-Signature:Message-ID:Date:MIME-Version:User-Agent: Subject:To:Cc:References:Content-Language:From:In-Reply-To: Content-Type:Content-Transfer-Encoding:X-BeenThere:X-Mailman-Version: Precedence:List-Id:List-Unsubscribe:List-Archive:List-Post:List-Help: List-Subscribe:Errors-To; bh=b6BcLorqh6FnBWb/McwVoCB6fyYHx4Px5fdpq17GoKw=; b=QSxJ1MkkJN/v1ODzKdR3x+CbS//DWni0uRmYndDF5zQkrUCvY0PWnTgEptUQpKDdFe0a yd4G6dSXPm+h7Gh9irht14SjpeRNLhJXjNIRlZQgMcLqLgUS+UI8oe2PlXW/VOTVT26M9 /VhzUUmIljskfg50yhwZyo2+Zwc0hFc/aI0xM323UZ4Okb43oj8SlMOkRxaSeK+o3yTs3 x3Qv+BbK/TZiXVib9/1d3PgNoY/S7M4QqCQq5AgEPwnsthggeiBHljFGPJUrkhQ0WuKu/ cutf8Wh9FtgYN2RfDKyVldCLV/IKYQg0Tf/Wkuvp+s2OJbq5sO3Vz+7q8rTzNmAndYg== ARC-Authentication-Results: i=1; smtp1.osuosl.org; arc=none smtp.remote-ip=140.211.166.142 X-Comment: SPF check N/A for local connections - client-ip=140.211.166.142; helo=lists1.osuosl.org; envelope-from=intel-wired-lan-bounces@osuosl.org; receiver= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=osuosl.org; s=default; t=1796133487; bh=b6BcLorqh6FnBWb/McwVoCB6fyYHx4Px5fdpq17GoKw=; h=Date:Subject:To:Cc:References:From:In-Reply-To:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=lIiFg+ePI+fRj280j3aF3c6x03FngaOVy2HXDvZ+VPFPF6urpxThohIEjQpGokfSi CAw6ex9AGbve5eVujyaO3CX0PWEG30sNsKifna6CsCSXRKMRPwqla7FgOqC0WxKvj8 B5P42umLVONxiH3Qgu/Ddx3VBg/HCGOB7dzBY/hXopn6hPT+CtKUXOJYWybGFw0PLf awSfoSvWp0W35fkfAWlwj8tBxZ+S+XiHj3F3u6ThaCcmvKD04NggFj802oWGq2s0Ly a1Q0Y7EUEPuztwzzc7urncMF93NghyIT80QzwuFPXh7WFoKItHFblxkpwBYVbqSH1H GtuY/oaAIWyrg== Received: from lists1.osuosl.org (lists1.osuosl.org [140.211.166.142]) by smtp1.osuosl.org (Postfix) with ESMTP id BC08780F9F; Tue, 1 Dec 2026 13:58:07 +0000 (UTC) Received: from smtp3.osuosl.org (smtp3.osuosl.org [IPv6:2605:bc80:3010::136]) by lists1.osuosl.org (Postfix) with ESMTP id ABF2249E for ; Tue, 1 Dec 2026 13:58:06 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp3.osuosl.org (Postfix) with ESMTP id 9216F608EF for ; Tue, 1 Dec 2026 13:58:06 +0000 (UTC) X-Virus-Scanned: amavis at osuosl.org Received: from smtp3.osuosl.org ([127.0.0.1]) by localhost (smtp3.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP id i1B69jaFk4cy for ; Tue, 1 Dec 2026 13:58:05 +0000 (UTC) ARC-Filter: OpenARC Filter v1.3.2 smtp3.osuosl.org 783A360872 Authentication-Results: smtp3.osuosl.org; arc=none smtp.remote-ip="2600:3c04:e001:324:0:1991:8:25" Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=2600:3c04:e001:324:0:1991:8:25; helo=tor.source.kernel.org; envelope-from=hawk@kernel.org; receiver= Authentication-Results: smtp3.osuosl.org; dmarc=pass (p=quarantine dis=none) header.from=kernel.org Authentication-Results: smtp3.osuosl.org; dkim=pass (2048-bit key, unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=mpsucTkt Received: from tor.source.kernel.org (tor.source.kernel.org [IPv6:2600:3c04:e001:324:0:1991:8:25]) by smtp3.osuosl.org (Postfix) with ESMTPS id 783A360872 for ; Tue, 1 Dec 2026 13:58:04 +0000 (UTC) Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) by tor.source.kernel.org (Postfix) with ESMTP id B26F76256F; Tue, 1 Dec 2026 13:58:03 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4CCD31F008A0; Tue, 1 Dec 2026 13:57:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796133482; bh=b6BcLorqh6FnBWb/McwVoCB6fyYHx4Px5fdpq17GoKw=; h=Date:Subject:To:Cc:References:From:In-Reply-To; b=mpsucTktj6mO8MvWP6aSCL9FAuQu1cZnYAIIGlHR5BYv/+xtP9Y6SEBbCkyGpoIlr WGEFjaMu9WJT7F8VhdchPxb8PrbBCYEcXQ0kxpfFqMwpv1t2DnvWGaaeAotzCFT+0c +JTBvfD7Cx5AKTlaN2o6kQRRWjiXMPhANc9BlQpnjkRATPUHBvHUIqkQULhSUbjwMO CBYPGZqH3tfjGrTLfiMi9wkfXKvn2VQNza6Yc0Ri5frS0SQNqHLih2RlTzqQ5IPhfX OLx3iHQzwo/CeSD2b5IbjzmwlPpkR3yjPazJWEpH1Lwnl3KDmXOuZkRIQi9ZVzHrz8 EFxamiOnrZ58g== Message-ID: Date: Tue, 1 Dec 2026 14:57:51 +0100 X-Archived-By: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH bpf-next 00/15] xdp: add SKB core extensions to keep RX metadata until skb creation To: Tianyi Gao , Stanislav Fomichev , Jakub Kicinski Cc: bpf@vger.kernel.org, netdev@vger.kernel.org, Alexei Starovoitov , Daniel Borkmann , Andrii Nakryiko , Martin KaFai Lau , John Fastabend , Stanislav Fomichev , Lorenzo Bianconi , Vladimir Vdovin , "David S. Miller" , Eric Dumazet , Paolo Abeni , Simon Horman , Andrew Lunn , Donald Hunter , Eduard Zingerman , Kumar Kartikeya Dwivedi , Song Liu , Yonghong Song , Jiri Olsa , Emil Tsalapatis , Ihor Solodrai , Tony Nguyen , Przemek Kitszel , Maciej Fijalkowski , Alexander Lobakin , Magnus Karlsson , Tushar Vyavahare , Jason Xing , Nikolay Aleksandrov , Madalin Bucur , Ioana Ciornei , Jonathan Corbet , Shuah Khan , Shuah Khan , Randy Dunlap , Nathan Chancellor , Nick Desaulniers , Bill Wendling , Justin Stitt , Chris J Arges , Jakub Sitnicki , linux-doc@vger.kernel.org, linux-kselftest@vger.kernel.org, intel-wired-lan@lists.osuosl.org, llvm@lists.linux.dev, kernel-team@cloudflare.com References: Content-Language: en-US From: Jesper Dangaard Brouer In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: intel-wired-lan@osuosl.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Intel Wired Ethernet Linux Kernel Driver Development List-Archive: List-Post: List-Help: List-Subscribe: , X-Spam-Status: No, score=-7.4 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_PASS, USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=4.0.1 X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on aws-us-west-2-korg-listserv-alma10-1 On 11/12/26 00:46, Tianyi Gao wrote: > > On 11/11, Stanislav Fomichev wrote: [...] > >> and slowly creeping more features into xdp making it >> more and more like skb. > > I will leave this to Jesper. > Stanislav, you made the key point yourself: an XDP prog that changes the packet needs a way to correct the HW offload info [3]. After a decap, the outer csum status no longer holds, and today BPF cannot flip it to NONE. The prog also cannot change a stripped VLAN tag. So this is not a new feature. It fixes what Jakub called "a known bug" [6]: after XDP changes the packet, the HW offload info is stale, and XDP has no way to tell the kernel which part it changed. And it is not another metadata area. It is part of the xdp_frame. In Alexei's sketch, struct xdp_rx_meta sits right after struct xdp_frame, in the same cache line, and flag bits in xdp->flags say which fields are valid. It also has the same life as the xdp_frame. The prog writes only the values it changed. In my proposal [7], the driver fills the rest after the prog has run, and only for a frame that survives XDP. So XDP_DROP does not touch it, and XDP_DROP performance stays the same. data_meta and this area have different owners and different readers: - data_meta belongs to the BPF progs. They define the format, and BPF progs (XDP, TC) or AF_XDP read it. - This area belongs to the kernel. The kernel defines the format, and the kernel reads it when it builds the skb. So they do not overlap. The kernel cannot use data_meta, because it does not know the format. A driver-local setter would also work, but only while the driver builds the skb itself, on XDP_PASS. It does not work after XDP_REDIRECT: the descriptor is recycled, and cpumap or veth builds the skb on another CPU. And it cannot support the mini-SKB direction [7], where the driver hands the xdp_frame to core code, and core code builds the skb. Core code cannot read driver-local state. A kernel-known area works in all three cases. On feature creep: yes, the xdp_frame grows towards a mini-SKB. But it only gets the fields that the skb needs from the HW offloads: hash, VLAN and csum, and later maybe RX timestamp and RX queue index. These are core skb fields, and they rarely change. So the list is short, and it stays short. --Jesper [3] https://lore.kernel.org/all/amEojEGsIGkUjIWn@devvm7509.cco0.facebook.com/ [6] https://lore.kernel.org/all/20260722113525.34092660@kernel.org/ [7] https://lore.kernel.org/all/b3e67ffc-5610-4598-9291-ee0264983a4a@kernel.org/