Received: by 2002:a05:7412:b10a:b0:f3:1519:9f41 with SMTP id az10csp1410440rdb; Fri, 1 Dec 2023 16:16:55 -0800 (PST) X-Google-Smtp-Source: AGHT+IF+KWrNVHc6WHt6ZKJVQRmm5mcRqOvodtPfejIkBgJgA4qxot9GYY27G74q0r3rLZt80+bK X-Received: by 2002:a05:6a00:2e8e:b0:6ce:2732:585 with SMTP id fd14-20020a056a002e8e00b006ce27320585mr502794pfb.54.1701476215256; Fri, 01 Dec 2023 16:16:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701476215; cv=none; d=google.com; s=arc-20160816; b=zZQmHjk1LdsIix6h+dNrjGNZiGrgHfIIRrHiRxsunbceaC/zBcn3DY1p1RpAkAFg82 oC3HxyTYGtEzo4FJz0t6VGMT2GUJ3m2aKaUygs25KHZPLn4tOxLisJ6LEoZiw3Q0V1v0 qPhCdCAWMDBA4DJVnHIfkJpFymwI70xtjohr5budq7jNLM0TAZjLWHD/dS/ja4573w+C KhIDYpccn9cLsZqAa2L9kE3Qg+vV21kzsSZNGmbtFyfmIru1pUg7lXF07bYehaZGC4m+ NPykSTdTO0XrUBwMQX1u6AdHd3vZKASHAJvJmD04XN2sY01YgNwmWC6jWr5nVoHe2eZL mCJQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:feedback-id:dkim-signature:dkim-signature; bh=NnvmqJQAxazHvzMLPYJJMCWR3fPVZJKgp3PiGTQFF9M=; fh=jvOou9Pkg6gUBZ3QeLM7yNGRvYBn4u12Za57AFAdKgI=; b=Zrw7CRhLhK5CZAeVagf5KTcD/D0nlyiTPBdhfvnqmOryQyTQEoip4VnteMdlblOM4Y 7w5AYPgaoekuKskWTsqmbJpMY7SapWljOCOod+yc2F2wST07tA+NPyspPjM2qwtnXAz5 Xb3pLQw/+gIafWrQv7qJpPyJVS+ZztSPPKCAv27BDfsY7+aMQBDIazPY5rbkymXs/SJW qwPLaj2f9Vh6uu3ssuA0HNPZZGKI3BSYjTpq7GhYD2ZBLIoAKh9dusuFyBXO4AecZZr7 sYsbEWLdshGcGn7cdAscXlg1zcno0jHW6xrIshP8WfjgvFGKbbu4fnCJxGTU9GIC+pAQ Rv0Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@dxuuu.xyz header.s=fm3 header.b=GnkBaMMh; dkim=pass header.i=@messagingengine.com header.s=fm1 header.b=njnExw1a; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from lipwig.vger.email (lipwig.vger.email. [23.128.96.33]) by mx.google.com with ESMTPS id bm9-20020a656e89000000b005bdd76219edsi4262091pgb.675.2023.12.01.16.16.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 Dec 2023 16:16:55 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) client-ip=23.128.96.33; Authentication-Results: mx.google.com; dkim=pass header.i=@dxuuu.xyz header.s=fm3 header.b=GnkBaMMh; dkim=pass header.i=@messagingengine.com header.s=fm1 header.b=njnExw1a; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id F0FBA806934A; Fri, 1 Dec 2023 16:16:21 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1441924AbjLBAQD (ORCPT + 99 others); Fri, 1 Dec 2023 19:16:03 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54444 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229456AbjLBAQB (ORCPT ); Fri, 1 Dec 2023 19:16:01 -0500 Received: from out4-smtp.messagingengine.com (out4-smtp.messagingengine.com [66.111.4.28]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 210D7DD; Fri, 1 Dec 2023 16:16:08 -0800 (PST) Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id 4C5D75C01D5; Fri, 1 Dec 2023 19:16:07 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute4.internal (MEProxy); Fri, 01 Dec 2023 19:16:07 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=dxuuu.xyz; h=cc :cc:content-transfer-encoding:content-type:content-type:date :date:from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:sender:subject:subject:to:to; s=fm3; t= 1701476167; x=1701562567; bh=NnvmqJQAxazHvzMLPYJJMCWR3fPVZJKgp3P iGTQFF9M=; b=GnkBaMMh4C6+HCWh8gY282XFYkUbCQKqHStiMvQKIbmzT1hstvE kKIkOnm4nmyyjDCRtMwmNzLUgYtn4Mo6kJHPFPweAeuAi4Nu/pWxgGu4bjJD/bIm N2ellqNdcMk6JilhPiPREjR2EbA26NOnogWh9WKPSqOGjH/0S6Pi4SiKbbcTQCjw eAzYKwle2XIV8dzjnLE8kn4pvf7VMNsF4rAbd9mmz5CHIwwINmwguVvOaDQBZzHK +l3ZOr2f6jWzkObSx/eA3ceBV+VRStx2qrbiH1zKZ62kNvtT5D45N44Fy5INL45l aGM/0HGXZBaTfwXeUVBwMcUpAbEF8yYiNLw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:sender:subject:subject:to:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t= 1701476167; x=1701562567; bh=NnvmqJQAxazHvzMLPYJJMCWR3fPVZJKgp3P iGTQFF9M=; b=njnExw1aJ9gx5YelQLM8f2uDV52Uhf3pJ0EDd9aCnL0k3c/4F59 n1h+Q97jaQFTYxabcrbyEd9I2Xp+g7gcgm8pXYz8Zm4NW95OjVmGYx4FA9MWGDwh jOyMRdjXCghnzStcHG5Zh/BHQZ2TalLty2ps4LNcUZGVEtoky/YP09+aA9S2iSIr J6Hl4YUTjTw62tJwB+c90eDZsxrPSaMEyk1CVla8TNmiiLLKV5d+P62lgkxn/ljv W90Hu5FKtWecRA7ChWSOxDn6BoMqlZVzECtfUU7dr10y7LglMBAYz1UQm2u15Kf7 5SXqqiAjk3QCl0mRYUZa0shmWmuj4wFWemQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvkedrudejtddgudelucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne gfrhhlucfvnfffucdlvdefmdenucfjughrpeffhffvvefukfhfgggtugfgjgestheksfdt tddtjeenucfhrhhomhepffgrnhhivghlucgiuhcuoegugihusegugihuuhhurdighiiiqe enucggtffrrghtthgvrhhnpefggfdvfffhiedvieeuuddvudfffffggeeugedtkeehffeh jefgheejiedtledtfeenucffohhmrghinhepihgvthhfrdhorhhgpdhgihhthhhusgdrtg homhenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpegu gihusegugihuuhhurdighiii X-ME-Proxy: Feedback-ID: i6a694271:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Fri, 1 Dec 2023 19:16:05 -0500 (EST) Date: Fri, 1 Dec 2023 17:16:04 -0700 From: Daniel Xu To: Alexei Starovoitov Cc: Network Development , LKML , bpf , clang-built-linux , "open list:KERNEL SELFTEST FRAMEWORK" , Steffen Klassert , antony.antony@secunet.com, Yonghong Song , Eddy Z , devel@linux-ipsec.org Subject: Re: [PATCH ipsec-next v3 0/9] Add bpf_xdp_get_xfrm_state() kfunc Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (lipwig.vger.email [0.0.0.0]); Fri, 01 Dec 2023 16:16:22 -0800 (PST) On Fri, Dec 01, 2023 at 04:10:18PM -0800, Alexei Starovoitov wrote: > On Fri, Dec 1, 2023 at 12:23 PM Daniel Xu wrote: > > > > This patchset adds two kfunc helpers, bpf_xdp_get_xfrm_state() and > > bpf_xdp_xfrm_state_release() that wrap xfrm_state_lookup() and > > xfrm_state_put(). The intent is to support software RSS (via XDP) for > > the ongoing/upcoming ipsec pcpu work [0]. Recent experiments performed > > on (hopefully) reproducible AWS testbeds indicate that single tunnel > > pcpu ipsec can reach line rate on 100G ENA nics. > > > > Note this patchset only tests/shows generic xfrm_state access. The > > "secret sauce" (if you can really even call it that) involves accessing > > a soon-to-be-upstreamed pcpu_num field in xfrm_state. Early example is > > available here [1]. > > > > [0]: https://datatracker.ietf.org/doc/draft-ietf-ipsecme-multi-sa-performance/03/ > > [1]: https://github.com/danobi/xdp-tools/blob/e89a1c617aba3b50d990f779357d6ce2863ecb27/xdp-bench/xdp_redirect_cpumap.bpf.c#L385-L406 > > > > Changes from v2: > > * Fix/simplify BPF_CORE_WRITE_BITFIELD() algorithm > > * Added verifier tests for bitfield writes > > * Fix state leakage across test_tunnel subtests > > > > Changes from v1: > > * Move xfrm tunnel tests to test_progs > > * Fix writing to opts->error when opts is invalid > > * Use __bpf_kfunc_start_defs() > > * Remove unused vxlanhdr definition > > * Add and use BPF_CORE_WRITE_BITFIELD() macro > > * Make series bisect clean > > > > Changes from RFCv2: > > * Rebased to ipsec-next > > * Fix netns leak > > > > Changes from RFCv1: > > * Add Antony's commit tags > > * Add KF_ACQUIRE and KF_RELEASE semantics > > > > Daniel Xu (9): > > bpf: xfrm: Add bpf_xdp_get_xfrm_state() kfunc > > bpf: xfrm: Add bpf_xdp_xfrm_state_release() kfunc > > libbpf: Add BPF_CORE_WRITE_BITFIELD() macro > > bpf: selftests: test_loader: Support __btf_path() annotation > > libbpf: selftests: Add verifier tests for CO-RE bitfield writes > > bpf: selftests: test_tunnel: Setup fresh topology for each subtest > > bpf: selftests: test_tunnel: Use vmlinux.h declarations > > bpf: selftests: Move xfrm tunnel test to test_progs > > bpf: xfrm: Add selftest for bpf_xdp_get_xfrm_state() > > > > include/net/xfrm.h | 9 + > > net/xfrm/Makefile | 1 + > > net/xfrm/xfrm_policy.c | 2 + > > net/xfrm/xfrm_state_bpf.c | 128 ++++++++++++++ > > tools/lib/bpf/bpf_core_read.h | 34 ++++ > > .../selftests/bpf/prog_tests/test_tunnel.c | 162 +++++++++++++++++- > > .../selftests/bpf/prog_tests/verifier.c | 2 + > > tools/testing/selftests/bpf/progs/bpf_misc.h | 1 + > > .../selftests/bpf/progs/bpf_tracing_net.h | 1 + > > .../selftests/bpf/progs/test_tunnel_kern.c | 138 ++++++++------- > > .../bpf/progs/verifier_bitfield_write.c | 100 +++++++++++ > > tools/testing/selftests/bpf/test_loader.c | 7 + > > tools/testing/selftests/bpf/test_tunnel.sh | 92 ---------- > > 13 files changed, 522 insertions(+), 155 deletions(-) > > I really think this should go via bpf-next tree. > The bpf changes are much bigger than ipsec. Ack. Ended up picking up a lot of stuff along the way.