From patchwork Mon Dec 4 20:56:21 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Xu X-Patchwork-Id: 173556 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:bcd1:0:b0:403:3b70:6f57 with SMTP id r17csp3033151vqy; Mon, 4 Dec 2023 12:57:08 -0800 (PST) X-Google-Smtp-Source: AGHT+IFCSsmCClT7GPJ0bWh4Q4t15JPVLPQWJLgqfm/cdY5HQ42DjH+U0TIU9aCOqz+TKH2y5z4c X-Received: by 2002:a17:90b:33c7:b0:286:9b69:a0f6 with SMTP id lk7-20020a17090b33c700b002869b69a0f6mr193950pjb.39.1701723428546; Mon, 04 Dec 2023 12:57:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701723428; cv=none; d=google.com; s=arc-20160816; b=WnSJhHZQFN7yrNN1ItJHC7Lb+2GkRg7u9/tHVTzACuWugK/GdCRtBzzRZE7amOs0T4 d0/xvyMMXh1Q4C91H043bfss1Iuq30aJweb/YUFSzS7mSwrDhciI5nUQz+FeR1iz+Rm1 gNZ8MAKba6raaqLirds8gUPjmL2mPK7vWy1CDafJ34AsGEuazpkIT7+xFisYegYLcCYw 6bw2oJe4spzUb48tYfnnx+8HQY2cBPLCY0CgnpDopU59ccT3m0LYEG8Arbv3ob0gY5W0 O/o6v7Z0H8KChPN9JqCdyelUtUk8TMxLmrNp15R9g3j2i7eQkBtILZ+6k6NndqawyZBf eTHA== 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=ODyk+ttANQamRuubWNRCDO8I/D2JxBDiCAh0nttU7d0=; fh=JT3DbXCycnDgjng2egvIc916cuzoOMwYuenI3anQzBw=; b=gVSuQtFQLe7mIVpl7cAd8vhZvGrYoZhdmAmEWSA0/UH5HLJRUlOv4o2axkDlaNwtGQ s90lMKZfebIGwN6EtnOn6VaNBuwDnKMPQkfFfIV5hIuwGSmHeZjKC7IfNcrRyR5NO901 n6kudbVn5IjSx3K0gAsPhlBkEOp9/6Cc08tpaVXd5kaCfv5xW2gehGvYUhokoljPZWGB OVpSClpGQQ4xt96iEUB7yTjI2QxJiZ9+VUcVsXig+LJygjgMDlfKXj2CZl8XxUh18IZj YzMirRDJd701Ejk1dfXb7nIalke4Er2QhMc1yaY1B257ioQZGLX+EJ8Zu4wMjrQxt6bT jtKA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@dxuuu.xyz header.s=fm3 header.b=r4oVnJbK; dkim=pass header.i=@messagingengine.com header.s=fm1 header.b=0epMzhcX; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id kb2-20020a17090ae7c200b0028676beec1bsi4084488pjb.152.2023.12.04.12.57.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 04 Dec 2023 12:57:08 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) client-ip=23.128.96.37; Authentication-Results: mx.google.com; dkim=pass header.i=@dxuuu.xyz header.s=fm3 header.b=r4oVnJbK; dkim=pass header.i=@messagingengine.com header.s=fm1 header.b=0epMzhcX; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 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 543E080ADF3F; Mon, 4 Dec 2023 12:57:07 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233697AbjLDU45 (ORCPT + 99 others); Mon, 4 Dec 2023 15:56:57 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36414 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233753AbjLDU4w (ORCPT ); Mon, 4 Dec 2023 15:56:52 -0500 Received: from out5-smtp.messagingengine.com (out5-smtp.messagingengine.com [66.111.4.29]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B965C109; Mon, 4 Dec 2023 12:56:55 -0800 (PST) Received: from compute2.internal (compute2.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id DB9615C022F; Mon, 4 Dec 2023 15:56:54 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute2.internal (MEProxy); Mon, 04 Dec 2023 15:56:54 -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=1701723414; x= 1701809814; bh=ODyk+ttANQamRuubWNRCDO8I/D2JxBDiCAh0nttU7d0=; b=r 4oVnJbKuvQFHQYEX8R56ZVtXrlkgzIKKVAXWi8AlDWZHZKFL8p/mnFE5y5wV+eK+ 9lOOSI2esM4aFE0BbGS+7tnSOFL+m4vzr8yDkEMwTSD2pPfCEVIpYPlT9ziUuffn AHS8Ww/tjVQFKDK7/+WCPd9NT/sVUjbECVwj6yFz5F7+DDNVHBK0ozgNQ1b8UXD7 HfqcPnc7d0/60iP1zeAHUz15pZSzCg0qDt6ChLSwMzsWqsWLQbafj5MZi/4d+U9M QRPeT4rc6NUiahJWVStSkybkfJTxRFH8iu27phHt1pKSxOr3z9YqslbyUFFZ2jjT Fprwp2xUClTWgZg2SqHvQ== 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=1701723414; x= 1701809814; bh=ODyk+ttANQamRuubWNRCDO8I/D2JxBDiCAh0nttU7d0=; b=0 epMzhcXlEAJh9hIhfZQNfzrbBwP6o7+vnL+hC48PCUaQtGZI2fOrXx/8caIwa5wq htQ/sixbVUcrurbCJzWkg9TxH7N/3+9CQ0eK3LIDRTlO4CdjM9kQDTzzNgULXWwx M/DiIVflIr3aKq2z8cQzheaYTDb9wVzOKr9qWw5VdbGItrnQnekMKpMbOqOUtpk5 ueNwd33L0Fwj40BKvK6X5TT2/uw07ldQO2fs86DAt9mavAqB0CAeoPPnGcQUPGTe 5vL4nb14Kp7jOvdr0dcwiIRMxmjO4u0asiV0FyIxCAGO0Z5rfl91H/fXU9U3Ie38 VZSe4IM+U6iZECSED1QdQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvkedrudejiedgudeggecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd enfghrlhcuvffnffculdejtddmnecujfgurhephffvvefufffkofgjfhgggfestdekredt redttdenucfhrhhomhepffgrnhhivghlucgiuhcuoegugihusegugihuuhhurdighiiiqe enucggtffrrghtthgvrhhnpefgfefggeejhfduieekvdeuteffleeifeeuvdfhheejleej jeekgfffgefhtddtteenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrih hlfhhrohhmpegugihusegugihuuhhurdighiii X-ME-Proxy: Feedback-ID: i6a694271:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 4 Dec 2023 15:56:52 -0500 (EST) From: Daniel Xu To: davem@davemloft.net, Herbert Xu , steffen.klassert@secunet.com, pabeni@redhat.com, kuba@kernel.org, edumazet@google.com, 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 bpf-next v4 01/10] xfrm: bpf: Move xfrm_interface_bpf.c to xfrm_bpf.c Date: Mon, 4 Dec 2023 13:56:21 -0700 Message-ID: X-Mailer: git-send-email 2.42.1 In-Reply-To: References: MIME-Version: 1.0 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_H5,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS,SPF_PASS, T_SCC_BODY_TEXT_LINE 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]); Mon, 04 Dec 2023 12:57:07 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1784386345729761579 X-GMAIL-MSGID: 1784386345729761579 This commit moves the contents of xfrm_interface_bpf.c into a new file, xfrm_bpf.c This is in preparation for adding more xfrm kfuncs. We'd like to keep all the bpf integrations in a single file. Signed-off-by: Daniel Xu Acked-by: Steffen Klassert --- net/xfrm/Makefile | 7 +------ net/xfrm/{xfrm_interface_bpf.c => xfrm_bpf.c} | 12 ++++++++---- 2 files changed, 9 insertions(+), 10 deletions(-) rename net/xfrm/{xfrm_interface_bpf.c => xfrm_bpf.c} (88%) diff --git a/net/xfrm/Makefile b/net/xfrm/Makefile index cd47f88921f5..29fff452280d 100644 --- a/net/xfrm/Makefile +++ b/net/xfrm/Makefile @@ -5,12 +5,6 @@ xfrm_interface-$(CONFIG_XFRM_INTERFACE) += xfrm_interface_core.o -ifeq ($(CONFIG_XFRM_INTERFACE),m) -xfrm_interface-$(CONFIG_DEBUG_INFO_BTF_MODULES) += xfrm_interface_bpf.o -else ifeq ($(CONFIG_XFRM_INTERFACE),y) -xfrm_interface-$(CONFIG_DEBUG_INFO_BTF) += xfrm_interface_bpf.o -endif - obj-$(CONFIG_XFRM) := xfrm_policy.o xfrm_state.o xfrm_hash.o \ xfrm_input.o xfrm_output.o \ xfrm_sysctl.o xfrm_replay.o xfrm_device.o @@ -21,3 +15,4 @@ obj-$(CONFIG_XFRM_USER_COMPAT) += xfrm_compat.o obj-$(CONFIG_XFRM_IPCOMP) += xfrm_ipcomp.o obj-$(CONFIG_XFRM_INTERFACE) += xfrm_interface.o obj-$(CONFIG_XFRM_ESPINTCP) += espintcp.o +obj-$(CONFIG_DEBUG_INFO_BTF) += xfrm_bpf.o diff --git a/net/xfrm/xfrm_interface_bpf.c b/net/xfrm/xfrm_bpf.c similarity index 88% rename from net/xfrm/xfrm_interface_bpf.c rename to net/xfrm/xfrm_bpf.c index 7d5e920141e9..3d3018b87f96 100644 --- a/net/xfrm/xfrm_interface_bpf.c +++ b/net/xfrm/xfrm_bpf.c @@ -1,9 +1,8 @@ // SPDX-License-Identifier: GPL-2.0-only -/* Unstable XFRM Helpers for TC-BPF hook +/* Unstable XFRM BPF helpers. * - * These are called from SCHED_CLS BPF programs. Note that it is - * allowed to break compatibility for these functions since the interface they - * are exposed through to BPF programs is explicitly unstable. + * Note that it is allowed to break compatibility for these functions since the + * interface they are exposed through to BPF programs is explicitly unstable. */ #include @@ -12,6 +11,9 @@ #include #include +#if IS_BUILTIN(CONFIG_XFRM_INTERFACE) || \ + (IS_MODULE(CONFIG_XFRM_INTERFACE) && IS_ENABLED(CONFIG_DEBUG_INFO_BTF_MODULES)) + /* bpf_xfrm_info - XFRM metadata information * * Members: @@ -108,3 +110,5 @@ int __init register_xfrm_interface_bpf(void) return register_btf_kfunc_id_set(BPF_PROG_TYPE_SCHED_CLS, &xfrm_interface_kfunc_set); } + +#endif /* xfrm interface */