Message ID | e35bf393128407bf75e9d2fb9dca6c8e31c2a677.1701193577.git.dxu@dxuuu.xyz |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:ce62:0:b0:403:3b70:6f57 with SMTP id o2csp4111746vqx; Tue, 28 Nov 2023 09:56:35 -0800 (PST) X-Google-Smtp-Source: AGHT+IE4qV0UK5fMei/ZDiDyY+s0qjpTms1DmekxZ2vCfPmyi8t8GM5P1pOv7AXuBXuEnT6iA3w4 X-Received: by 2002:a17:90a:a08e:b0:280:3650:382a with SMTP id r14-20020a17090aa08e00b002803650382amr17065735pjp.16.1701194195051; Tue, 28 Nov 2023 09:56:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701194195; cv=none; d=google.com; s=arc-20160816; b=kEKw4N44iFnUTJCylYehMrpAu3Y1jORj4DnBGT+b0aLmjqxfKpDnd0JfDNHkeTqv/e bvs5gvF4ytaTMBUigJIhNQZxcXBBSN+3QJjWciOMI1lNrzRfepb6Vn4n77vgzjvnAprX /rLl6OU1ULXhGt6JJ1zj9rvhJ53ZjYvEiCHtnRY9ABLr5o8yNv5/m8fY7XQrluPOzjU6 uO79jBXQhKdpeR+rwbKc79YCu3EakKC4k9MBtIezz2nETlrm6g00IwZNYIaf0PI6BcXR 99FXOlOTcQUwqpEpirGxDcWTlxfb9iVz9mrTOvePr95YJfSn60qYwfwjJb5P8pGk0NgW lwxw== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :feedback-id:dkim-signature:dkim-signature; bh=gTC80DkbSwec6++klwVY+AjSyF2q8Jrio27MwPjAqCs=; fh=iAYcSdWuAUr6+TNz994QM/lgTJGPcAUkMsKb/QAvXHU=; b=iqHGVxvhNDrSqCqyoT9Ke8lDIH0OXrUlS1koWD+wdE54AYAjiKrMiHU/4jYkF248m0 wOjVR8bRrI+Wxvg9MxN2rYxG3nOcwwq8eSdLYUdQPPVZZijsJanKN7YdqsrnF+FE0ZQD a6RSH49R30sqc2/bnj06VRLL2NrbrDdYcxeqQjCO8/dd2o0rHbcKLSNVbn/33oeVNVPi /Q7rbgyruBgDpy8mq9V1o4pdPxu9lUK4Nj5lKtlt19FvXNBaD3FVDNKFdNRVcleiENWM eAIfYsGbSfovzi+1anMzJYoww4WWIZkrV1ACMjk2cwc++otC5nIH3vFIe2Eiea1nLxU+ ipoA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@dxuuu.xyz header.s=fm3 header.b=CaGi8k5s; dkim=pass header.i=@messagingengine.com header.s=fm1 header.b="WJ3Q6IC/"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from groat.vger.email (groat.vger.email. [2620:137:e000::3:5]) by mx.google.com with ESMTPS id ot16-20020a17090b3b5000b00285baead549si6498482pjb.157.2023.11.28.09.56.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 Nov 2023 09:56:35 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) client-ip=2620:137:e000::3:5; Authentication-Results: mx.google.com; dkim=pass header.i=@dxuuu.xyz header.s=fm3 header.b=CaGi8k5s; dkim=pass header.i=@messagingengine.com header.s=fm1 header.b="WJ3Q6IC/"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 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 groat.vger.email (Postfix) with ESMTP id C26678052BE1; Tue, 28 Nov 2023 09:55:23 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346600AbjK1RzC (ORCPT <rfc822;toshivichauhan@gmail.com> + 99 others); Tue, 28 Nov 2023 12:55:02 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57408 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346550AbjK1Rys (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Tue, 28 Nov 2023 12:54:48 -0500 Received: from out4-smtp.messagingengine.com (out4-smtp.messagingengine.com [66.111.4.28]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 317EB1707; Tue, 28 Nov 2023 09:54:54 -0800 (PST) Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id 90CFA5C00CC; Tue, 28 Nov 2023 12:54:53 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute1.internal (MEProxy); Tue, 28 Nov 2023 12:54:53 -0500 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:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to; s=fm3; t=1701194093; x= 1701280493; bh=gTC80DkbSwec6++klwVY+AjSyF2q8Jrio27MwPjAqCs=; b=C aGi8k5sHfniVuQkeLjNo+EwdelKOnWfBnyMb/NMRdFN2srfwApTVGpdTK/n3qohb eMw/JDKfn8ZfPFNy3nCGUuarKaN1cjpuIxbTJ/adrtrwGs3rlCv8pL4dHkcsZsjY SqSZsBm3a9UO2Vz47jVh/1TuvUgD5kOn6PsJFBFHCyGn6aWwDb/k1sKqF9E7cvn2 4F60FeOpMXQ2au9hMVsWUDnojnzpa60ZJLi2muhcXN7J99UxGVA7oK1Hy1dTyczu WnrHI0Uecqqj4K/WuwloljYHPOb+DmHTlBTFl/XMMUkN73DrxfqXxgxcnc0xMHxx naRv7BF5NU0P/VbphyTIw== 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: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=1701194093; x= 1701280493; bh=gTC80DkbSwec6++klwVY+AjSyF2q8Jrio27MwPjAqCs=; b=W J3Q6IC/dJzA+vWKAxn4aHyxUbT/H9FEqv/g2vfQYbo/zy1gS5pVTBZF0LYuP18LN R6dMSn66K4WVmofy+pKRKy6F18e4UXBpTdm4wO/mlzfL027XpYQx5e4bzUN9x+75 ENITXXqyEplY3QWT0LJ0cDppvGaKWs5+VMsISd9eJcYZtZcxOI2Cx6Mp5RW7lF9e enHuDaCjkAlhIEJob6S/uwr/FbT/5u1WmI/mTXDQmymriX657vRhtMo4z14sM+mO uIUtCwcNVvp+pXurm+Y4+73YsXkWM7kPIAsplqsbc2lNNxn9B3zUf/mQqpmctW96 glw8nkjQd2iACwE17d1HQ== X-ME-Sender: <xms:bSlmZXrPPg9OnaCbB9vV6xdlnzdGXQH5TM2wD_knaBmFNUHHyC_vhg> <xme:bSlmZRoPlERZG1qyogHD3jh0DM7HvscMSFh-OkMSlMdg61zYvrKw7pZIgbUvVVavM RnHzMOIxBTCE2V4_w> X-ME-Received: <xmr:bSlmZUMi9Kfe7wVDHNIQJyHiYW8HqfWMKBlua0dty464FDmvGbo-yXaDhvN27oqOaq1UgFjFNzflreXKFeYH5eC7BFTWBWBPbHb5YMUPYboDFw> X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvkedrudeifedguddthecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd enfghrlhcuvffnffculdefhedmnecujfgurhephffvvefufffkofgjfhgggfestdekredt redttdenucfhrhhomhepffgrnhhivghlucgiuhcuoegugihusegugihuuhhurdighiiiqe enucggtffrrghtthgvrhhnpefgfefggeejhfduieekvdeuteffleeifeeuvdfhheejleej jeekgfffgefhtddtteenucevlhhushhtvghrufhiiigvpedunecurfgrrhgrmhepmhgrih hlfhhrohhmpegugihusegugihuuhhurdighiii X-ME-Proxy: <xmx:bSlmZa40Ys6YEShiJHy4rTmHLl7drkMbF8UUTnCBot5QZNAGLgoyVA> <xmx:bSlmZW6G0Mvnu9gXdvlHB1fJXfJN230_hosPrcrCOrscQP9mSZYqGQ> <xmx:bSlmZSit3vI8K24uzFDCSx73Rgdc0SBzY0AC_9ArRuu739ery1Opzg> <xmx:bSlmZSoSY62OWJ70MT40QjqEiAhZumABMgcvxdSMVu6Uu9d9BqSnpA> Feedback-ID: i6a694271:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 28 Nov 2023 12:54:52 -0500 (EST) From: Daniel Xu <dxu@dxuuu.xyz> To: kuba@kernel.org, steffen.klassert@secunet.com, john.fastabend@gmail.com, Herbert Xu <herbert@gondor.apana.org.au>, davem@davemloft.net, hawk@kernel.org, daniel@iogearbox.net, pabeni@redhat.com, edumazet@google.com, ast@kernel.org, antony.antony@secunet.com, alexei.starovoitov@gmail.com, yonghong.song@linux.dev, eddyz87@gmail.com Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, bpf@vger.kernel.org, devel@linux-ipsec.org Subject: [PATCH ipsec-next v2 2/6] bpf: xfrm: Add bpf_xdp_xfrm_state_release() kfunc Date: Tue, 28 Nov 2023 10:54:22 -0700 Message-ID: <e35bf393128407bf75e9d2fb9dca6c8e31c2a677.1701193577.git.dxu@dxuuu.xyz> X-Mailer: git-send-email 2.42.1 In-Reply-To: <cover.1701193577.git.dxu@dxuuu.xyz> References: <cover.1701193577.git.dxu@dxuuu.xyz> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 groat.vger.email Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (groat.vger.email [0.0.0.0]); Tue, 28 Nov 2023 09:55:24 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1783831404244777741 X-GMAIL-MSGID: 1783831404244777741 |
Series |
Add bpf_xdp_get_xfrm_state() kfunc
|
|
Commit Message
Daniel Xu
Nov. 28, 2023, 5:54 p.m. UTC
This kfunc releases a previously acquired xfrm_state from bpf_xdp_get_xfrm_state(). Co-developed-by: Antony Antony <antony.antony@secunet.com> Signed-off-by: Antony Antony <antony.antony@secunet.com> Signed-off-by: Daniel Xu <dxu@dxuuu.xyz> --- net/xfrm/xfrm_state_bpf.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+)
diff --git a/net/xfrm/xfrm_state_bpf.c b/net/xfrm/xfrm_state_bpf.c index 1681825db506..1485b9da9425 100644 --- a/net/xfrm/xfrm_state_bpf.c +++ b/net/xfrm/xfrm_state_bpf.c @@ -94,10 +94,26 @@ bpf_xdp_get_xfrm_state(struct xdp_md *ctx, struct bpf_xfrm_state_opts *opts, u32 return x; } +/* bpf_xdp_xfrm_state_release - Release acquired xfrm_state object + * + * This must be invoked for referenced PTR_TO_BTF_ID, and the verifier rejects + * the program if any references remain in the program in all of the explored + * states. + * + * Parameters: + * @x - Pointer to referenced xfrm_state object, obtained using + * bpf_xdp_get_xfrm_state. + */ +__bpf_kfunc void bpf_xdp_xfrm_state_release(struct xfrm_state *x) +{ + xfrm_state_put(x); +} + __bpf_kfunc_end_defs(); BTF_SET8_START(xfrm_state_kfunc_set) BTF_ID_FLAGS(func, bpf_xdp_get_xfrm_state, KF_RET_NULL | KF_ACQUIRE) +BTF_ID_FLAGS(func, bpf_xdp_xfrm_state_release, KF_RELEASE) BTF_SET8_END(xfrm_state_kfunc_set) static const struct btf_kfunc_id_set xfrm_state_xdp_kfunc_set = {