From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp3.osuosl.org (smtp3.osuosl.org [140.211.166.136]) (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 4BC49606A33A for ; Thu, 3 Dec 2026 13:59:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=osuosl.org header.i=@osuosl.org header.a=rsa-sha256 header.s=default header.b=UgyIs11/; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=WcvGyWtR Received: from localhost (localhost [127.0.0.1]) by smtp3.osuosl.org (Postfix) with ESMTP id 2843761487; Thu, 3 Dec 2026 13:59:12 +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 Dhsl7N28WC-T; Thu, 3 Dec 2026 13:59:11 +0000 (UTC) ARC-Filter: OpenARC Filter v1.3.2 smtp3.osuosl.org 58E8B61495 Authentication-Results: smtp3.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=1796306351; b=FWRgMNng4N6d1khbnUxwDbsXglJ2G41uOjPSRm55skEvhY0soTNJfesus6GVE1mgG5iW bMpwit8T6TE06PPDVfpH0u2om+CoGAYiQ8Nwt3Tcv6ydCFGMOU7B8GR9YBPpIHjJyVKTV TGjhNRYQ+pknrBqGcrrohp6NdXx7Kl3Dj4GyJqJduPRgAN9qVkaMgMm7DHHTpSi3GZ9LY uHFq+n+3B6PN1NkG+qmPJ/K230DPL+DMhEJy6q8eidNLhAzq59u+irh6cFKvqWxZ7iEaG TAhgcZ69zrXlKbwuGPnHuTuTQq/pUxopP29BNDMIX+4JazjaEXUwBmdCDFpLSEUVFJQ== ARC-Message-Signature: i=1; d=osuosl.org; s=arc; a=rsa-sha256; c=relaxed/relaxed; t=1796306351; 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=iTL0vO7EYdo9tosw/Thg7EKMpx6I6Vb5FgG9sWuxWq4=; b=kFbKpkjr5QzNwaOSPZRrH6bg5+3XKL8eRfQ3mRmVjpPWjFzJ/KcMJVVracSeRk1jLeP3 70S9/Rlk3kEtSIBz19O/30qXdzCUjPEzZm4C6acuVnNrvTjbRvQ4doXXsQdcsjWV1wQhJ JGbkAzjUfCwWB7G67toIOyLcIoCnk9bRczw8YUVj9CmX9BrNgrQmKyPEzXtNTLc838GGw AlJoC0DdbqO1wnuwmPc2wJpNIQVc8C6FkJFdwlD2wpE3NdnRfwwizpAvMEvKurxMsnKTd rBX1eSmltz7uUxDSXMv+TQw39QpgP0gQ698d6sQiwa7Sn6hQt+NudvSNZjAxrkIThRw== ARC-Authentication-Results: i=1; smtp3.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=1796306351; bh=iTL0vO7EYdo9tosw/Thg7EKMpx6I6Vb5FgG9sWuxWq4=; h=Date:Subject:To:Cc:References:From:In-Reply-To:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=UgyIs11/g5UEkEMkxx7tw0vJ2bFKya2tgQJ925J2BhYa58OFw0wtFp+B/nGxooBgK DMJ1HxsAQhUuiMM8mHoG0ppoVTkwMq5PfnAcqlm1+H3sfIOV+yuTHSOwWG2Zy1RHIA LW1QJFpeMwgoT2Ysqw80+CQqKK+ETbJtXLtnDTQiI9ciZfhE7ELIsx8Fqmu37QCghK 15aPjdQzMcaD9HiCrwZo4FuH9iVTEeY7Yz9WJlZKdp0TyYGmaRp08L8us2yMXICHMc CVc0kYY1w5TfV3jUq16cTOWR0Ye+qms9thefEVQuOzCZ+Vwg4aVSVh4BODTCCMpl3Q xDh+HLAo3ahVA== Received: from lists1.osuosl.org (lists1.osuosl.org [140.211.166.142]) by smtp3.osuosl.org (Postfix) with ESMTP id 58E8B61495; Thu, 3 Dec 2026 13:59:11 +0000 (UTC) Received: from smtp1.osuosl.org (smtp1.osuosl.org [IPv6:2605:bc80:3010::138]) by lists1.osuosl.org (Postfix) with ESMTP id 0BB7F3DB for ; Thu, 3 Dec 2026 13:59:10 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp1.osuosl.org (Postfix) with ESMTP id CC31285F07 for ; Thu, 3 Dec 2026 13:59:09 +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 zfSRXF4YbCFH for ; Thu, 3 Dec 2026 13:59:09 +0000 (UTC) ARC-Filter: OpenARC Filter v1.3.2 smtp1.osuosl.org EFE8385EE8 Authentication-Results: smtp1.osuosl.org; arc=none smtp.remote-ip=172.234.252.31 Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.252.31; helo=sea.source.kernel.org; envelope-from=hawk@kernel.org; receiver= Authentication-Results: smtp1.osuosl.org; dmarc=pass (p=quarantine dis=none) header.from=kernel.org Authentication-Results: smtp1.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=WcvGyWtR Received: from sea.source.kernel.org (sea.source.kernel.org [172.234.252.31]) by smtp1.osuosl.org (Postfix) with ESMTPS id EFE8385EE8 for ; Thu, 3 Dec 2026 13:59:08 +0000 (UTC) Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) by sea.source.kernel.org (Postfix) with ESMTP id C3C1943694; Thu, 3 Dec 2026 13:59:07 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 963B21F00893; Thu, 3 Dec 2026 13:58:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796306347; bh=iTL0vO7EYdo9tosw/Thg7EKMpx6I6Vb5FgG9sWuxWq4=; h=Date:Subject:To:Cc:References:From:In-Reply-To; b=WcvGyWtRlWlvfkKmOgwrGsMneMseY/TQsYXYeAyXSFS3kUfU3yu5kYhAY/TYjmOj9 psbx6BM7OHYgh+WTtR/M3bwTktBTU0c/CmRbkzZMVA64iuHXFCDdOmiMgKLl6SDs3E mRUj9IevN73fAFfoP2t066n+tXTeq/+o7voSFQXdBZcK6SvJ4MIB7YYrt16Z38COVB PYQLOOALF0sbVxD+CxcK6VefutENHILtcFP7T28ffcsnAsfqtizo++RI9Sxd+EljxH L0afSAeucsxnquS1BHehHQHFTh4a1HJ0sJx5iudwc0O46B28ertinsGBtBmpuCHm9k YpABqcaQuXC+A== Message-ID: Date: Thu, 3 Dec 2026 14:58:56 +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: Jakub Kicinski , Tianyi Gao Cc: Stanislav Fomichev , 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, Tianyi Gao References: <20261115113902.4834dda6@kernel.org> <20261116142710.347e8571@kernel.org> <20261117161856.6f6c2ce9@kernel.org> Content-Language: en-US From: Jesper Dangaard Brouer In-Reply-To: <20261117161856.6f6c2ce9@kernel.org> 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/18/26 01:18, Jakub Kicinski wrote: > On Mon, 16 Nov 2026 23:55:42 +0000 Tianyi Gao wrote: [...] >> On the setup we want to build: an XDP program on the NIC does the >> decap for all traffic. The services run in namespaces, so the packets >> must be delivered into them. Some services attach their own XDP >> program to the veth, and some do not. The host does not control the >> service's program. > > The host doesn't have to control the program, just know whether the > program will be attached, and therefore whether to use TC or XDP. True, the host can know. But TC does not fit our setup, because it builds the skb on the isolated RX CPU. The reason why we avoid that is in [1]. With bpf_redirect_peer() it is even more work: the RX CPU also runs the whole receive path into the netns, up to the socket. bpf_redirect_peer() is great in a micro-benchmark, where one CPU does all the work. In production we handle much more concurrent traffic. There we split the netstack processing into pipeline stages: XDP on the RX CPUs, the skb and the netns stack on other CPUs. This scales to more CPUs. [...] >> In a minimal benchmark, pktgen sends UDP, and perf stat counts the >> cycles on the RX CPU. bpf_redirect_peer() from tc costs 3% more >> cycles per packet than XDP_REDIRECT with the checksum status kept >> (mlx5, one extra __netif_receive_skb_core()). So one XDP_REDIRECT path >> for all namespaces is both simpler and cheaper. > > That's noise. Agreed, but the test measured the wrong thing. veth runs its NAPI on the sending CPU unless NAPI is threaded. So both paths did all the work on the RX CPU, and the test compared two ways to do the same work on one CPU. The number that matters is the cost on the RX CPU, with veth NAPI threaded on a CPU outside the RX set. I will work with Tianyi on a better test that shows this. I answered the rest of your mail in [2]. --Jesper [1] https://lore.kernel.org/all/f4bc8388-e4b9-4451-bbd1-9f5d0a86256f@kernel.org/ [2] https://lore.kernel.org/all/b3e67ffc-5610-4598-9291-ee0264983a4a@kernel.org/