Received: by 2002:a05:7412:a9a2:b0:e2:908c:2ebd with SMTP id o34csp1360970rdh; Fri, 27 Oct 2023 11:47:42 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHtxKvq7GwMBo9oknWh64hJswefK51t+BbZmtIFUWvwW+Qc7tm0sP/yc0Uwq1IPIFrMX6w2 X-Received: by 2002:a81:e207:0:b0:5b0:4055:73dc with SMTP id p7-20020a81e207000000b005b0405573dcmr1750958ywl.14.1698432461789; Fri, 27 Oct 2023 11:47:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698432461; cv=none; d=google.com; s=arc-20160816; b=Strp3ZIhCSqQ4m4lbmyHF1tvHvbkt9BZdBcBJzRKgt/6X99LH0W+OWJRHDQl6MliLq AG1A/2zq1cbBzJEPtn/SilU0TpzsbGcFNxmva6CnRRfpUozLJzts+owLk9wQTXE0MMnn kvc8uIpSvlU+Guk5E6LEOHAb4ihzNBJuzTCn/pp256USykWSXVZtpVq5nOvr9vQ+cWmB dcnzizeTlb3R1a7nm0NyfCffYK4NZZKwd50n1cY+BICm7rUotHJ0E+Ux2BknQSIvl5zX sENHm8+3HPFGcCLkvKnL4AUXQYNJ3h7Dzsc2W9SoAKEdeMMCGx3QyzIYHlM4mUqdvHvg eVVg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:feedback-id:dkim-signature :dkim-signature; bh=fE8aPn/CJu9lfh+4IEv0xtQPK1N/8Cxiy2mXzOknwuI=; fh=ZQDb896vMVP/TG6m3v7SBb0vf6Uz4iKj0mYXQYVUE0o=; b=gPHRGFxgf3q+2qVkvsMUPRtI9g7YlT9UjpWfApBmcZ3xtbg5W3feLb1zJrNPUjM8K1 buSaEteeEtn1hXux4Mc7Wq0MeQVg/t+YHmFERnX84oK3pIfCmmWZDF56p9RlAAiMtACw ZLw970cgmx8l+nyHAjbgs+EeKhDLxvFqEDWDFZvUP0GAp5kf8cntJr7kTs0vJNDp+rGt zVci10gafD30r5QeDfQJm5vyr+tm+CJzNzqinAvaWJSu01bbupjWiUhkkb9fnMS351kQ 1Qa10WiytMXszjNXNMShVKmxEz8sSviBnOkCBYtq9T00CKCR0vWsBNvGRhUIhyJ6GT/a lGnw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@dxuuu.xyz header.s=fm2 header.b=mlYiwLF7; dkim=pass header.i=@messagingengine.com header.s=fm3 header.b=Lsnjiq5v; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id g13-20020a81520d000000b0059f57af3be5si3374922ywb.46.2023.10.27.11.47.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 27 Oct 2023 11:47:41 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; dkim=pass header.i=@dxuuu.xyz header.s=fm2 header.b=mlYiwLF7; dkim=pass header.i=@messagingengine.com header.s=fm3 header.b=Lsnjiq5v; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 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 snail.vger.email (Postfix) with ESMTP id 08194826C0FD; Fri, 27 Oct 2023 11:47:16 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346468AbjJ0SrK (ORCPT + 99 others); Fri, 27 Oct 2023 14:47:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34400 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346360AbjJ0Squ (ORCPT ); Fri, 27 Oct 2023 14:46:50 -0400 Received: from out2-smtp.messagingengine.com (out2-smtp.messagingengine.com [66.111.4.26]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 96C681724; Fri, 27 Oct 2023 11:46:45 -0700 (PDT) Received: from compute7.internal (compute7.nyi.internal [10.202.2.48]) by mailout.nyi.internal (Postfix) with ESMTP id 7C1575C01F2; Fri, 27 Oct 2023 14:46:44 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute7.internal (MEProxy); Fri, 27 Oct 2023 14:46:44 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=dxuuu.xyz; h=cc :cc:content-transfer-encoding:content-type:date:date:from:from :in-reply-to:message-id:mime-version:reply-to:sender:subject :subject:to:to; s=fm2; t=1698432404; x=1698518804; bh=fE8aPn/CJu 9lfh+4IEv0xtQPK1N/8Cxiy2mXzOknwuI=; b=mlYiwLF7RHnbWML4Rr8Ls5McjN tiGAGjjQnU3A15hmBnuQM/P685zvygXrb/AjZyhkQCEGQ1F7ap/T2CJnu69p6OyR n0q8Ji2XXKdU4UVTfO8sDg8w/vqDTKUt7oKFPu3Pt9RFF1TP85xGIuxTRUlywbSH lTC9keM4GzeAmnKMR5QO0kOinTSsC0YAebyRPJULbp9iOmzIn7H/1Dhy7PQ+d7dr 3y6AK9w3Cx/Nh/JO6qgE+wrwmIfbrHom3vCSP0AocrCzXmM0vL4DGYY2p35TOATE ji2/RBOUpCqgqqYXfXcVhfbU6koM6yADojlSTOWVfM+jxjJMRqnAIITlDqbg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:message-id:mime-version:reply-to:sender:subject :subject:to:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm3; t=1698432404; x=1698518804; bh=fE8aPn/CJu9lf h+4IEv0xtQPK1N/8Cxiy2mXzOknwuI=; b=Lsnjiq5vQmSWeIynoGatmxHUaZtZQ LqbylnmiHt4owGwBl5afnsLsVJkEpBsrwDIdlqNV5Y7dmwYePUlAbW3XdTCgUv2y ixBPSyF6XB7xWxRAJ3Zs3wabqTgQAnVE2nsvgPElgO99PEmI3wuD+reMdPZavUR6 QOgsG7+J4+2loRx0fI8z4LUVOiU+/CtxyBsTjor7uOF5lmJk6+xacn7JN3TZnU2e CeHWv6zHXGG2GiutciF9WqeH0KmBC3MSb4EOxNF7r+I1uyUEk+yH0v99Nwy9eGHU iKfdOrcHd6FNtYAGLuQKuG2cD/R3w6vA+aZIp9t9gensxusgQCHHwcKYw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvkedrleeggddufedtucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucgfrhhlucfvnfffucdlvdefmdenucfjughrpefhvf evufffkffoggfgsedtkeertdertddtnecuhfhrohhmpeffrghnihgvlhcuighuuceougig uhesugiguhhuuhdrgiihiieqnecuggftrfgrthhtvghrnhephffgtefgkeelteevhefftd egjeevfeevuddtfedvvedutdeiffevhefghffgjeeknecuffhomhgrihhnpehivghtfhdr ohhrghdpnhgvthguvghvtghonhhfrdhinhhfohenucevlhhushhtvghrufhiiigvpedtne curfgrrhgrmhepmhgrihhlfhhrohhmpegugihusegugihuuhhurdighiii X-ME-Proxy: Feedback-ID: i6a694271:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Fri, 27 Oct 2023 14:46:43 -0400 (EDT) From: Daniel Xu To: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, bpf@vger.kernel.org, linux-kselftest@vger.kernel.org, steffen.klassert@secunet.com, antony.antony@secunet.com Cc: devel@linux-ipsec.org Subject: [RFC bpf-next 0/6] Add bpf_xdp_get_xfrm_state() kfunc Date: Fri, 27 Oct 2023 12:46:16 -0600 Message-ID: X-Mailer: git-send-email 2.42.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS,SPF_PASS, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net 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 (snail.vger.email [0.0.0.0]); Fri, 27 Oct 2023 11:47:16 -0700 (PDT) This patchset adds a kfunc helper, bpf_xdp_get_xfrm_state(), that wraps xfrm_state_lookup(). 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. More details about that will be presented at netdev next week [1]. Antony did the initial stable bpf helper - I later ported it to unstable kfuncs. So for the series, please apply a Co-developed-by for Antony, provided he acks and signs off on this. [0]: https://datatracker.ietf.org/doc/html/draft-ietf-ipsecme-multi-sa-performance-02 [1]: https://netdevconf.info/0x17/sessions/workshop/security-workshop.html Daniel Xu (6): bpf: xfrm: Add bpf_xdp_get_xfrm_state() kfunc bpf: selftests: test_tunnel: Use ping -6 over ping6 bpf: selftests: test_tunnel: Mount bpffs if necessary bpf: selftests: test_tunnel: Use vmlinux.h declarations bpf: selftests: test_tunnel: Disable CO-RE relocations 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 | 105 ++++++++++++++++++ .../selftests/bpf/progs/bpf_tracing_net.h | 1 + .../selftests/bpf/progs/test_tunnel_kern.c | 95 +++++++++------- tools/testing/selftests/bpf/test_tunnel.sh | 43 ++++--- 7 files changed, 202 insertions(+), 54 deletions(-) create mode 100644 net/xfrm/xfrm_state_bpf.c -- 2.42.0