Received: by 2002:a05:7412:f589:b0:e2:908c:2ebd with SMTP id eh9csp336776rdb; Tue, 31 Oct 2023 08:50:11 -0700 (PDT) X-Google-Smtp-Source: AGHT+IG/cQe43RdamBq9t93js7VEzSsHog5JyNX6aZbs/fL7845Ut0KtenzCzdd14PiqPQDDfxNe X-Received: by 2002:a05:6358:2908:b0:168:e7a8:e02f with SMTP id y8-20020a056358290800b00168e7a8e02fmr16412305rwb.21.1698767411385; Tue, 31 Oct 2023 08:50:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698767411; cv=none; d=google.com; s=arc-20160816; b=CXk5h8orvngUe7BOvEft2hubJ23gKDpWti4gxaRDmfu4L457KO6C+T8I4vAK8won8V 5ANWIS64Kx+bd0b72DdpcPo2ocq8u7urZqcPdCDTdbCp8O3c5duYEbu8hBMTxA/i0vKn VAg2BkoOIDV8HSMOSnghWWVYjFfc/9E5o4Ma28lIWU+AoItGLZV0tFo73J9+347jyTSm 3D/0+83wrKycYQv6QghoVeirVX7n2YASdfZAI/9649+zZwaMIFp4rualE0S7xWH2W69G SCgk2SqzUTZDufhUFEkC7UlNPJbnwor9B/HOeRUoNdyBOkKUipQeU+nJ9MTSsmyppTuL VNSA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:message-id:content-transfer-encoding :mime-version:subject:date:from:dkim-signature; bh=VEnwsDQeif3ip0hY3A2AJz8dUPO6O2PrfPQl0hQvJj8=; fh=d4nVIjNk4WLpmzVfiL66WAFuQoPudIJkbPmmGcraD7Y=; b=g2MkNX1nvEnYh88GVJ0FgsY2eb6NVLcjDVaLnaZ9vBpkLlwCVknnT9q4c3AeGjSjZQ /0fQmFEiKmqxBdopuzSuWSI7kb2iE+LIerh2stsTD7PmICw+YPsou3Nki77aJgxA0/po xrKdYs/kNSSsWXuX0E/1HsqkS9Z3L3pZ+fw0REyQciOcFXISj+2dO0l1fC/2wrepnKZW WaMgNXyoNhSRW4uUso0vFpNHKiH5fZs/+GilmDqz8Vh34rLM+Djla3LwDzLIjTyGiRyX gXhe6n8cjztqw7cNHh6OhD2thEHwd8dE4y66Ol41wlbyzQ/v0SKGfSwZD4dZrNuu4SnC V7Vg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=ACAIAmlp; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from agentk.vger.email (agentk.vger.email. [2620:137:e000::3:2]) by mx.google.com with ESMTPS id 11-20020a63020b000000b005b3b889619asi1166744pgc.606.2023.10.31.08.50.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 31 Oct 2023 08:50:11 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) client-ip=2620:137:e000::3:2; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=ACAIAmlp; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id B94C880BA97F; Tue, 31 Oct 2023 08:50:08 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345115AbjJaPt7 (ORCPT + 99 others); Tue, 31 Oct 2023 11:49:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34470 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231131AbjJaPt6 (ORCPT ); Tue, 31 Oct 2023 11:49:58 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EB2398F for ; Tue, 31 Oct 2023 08:49:55 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 82F1AC433C8; Tue, 31 Oct 2023 15:49:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1698767395; bh=ptwLXdCn0ccaumT/kPopEMDLG2wWUx3Jgvu71frbDck=; h=From:Date:Subject:To:Cc:From; b=ACAIAmlpCE0abUrhPB/XsWgklzKUtZcCk/HO7TSB3qnrzQE9WhOAzVMluqEAhTSZc ckAyIOAYCUFJbVmbU5x+/e8NZfTPVZXfzeoPb19uz68m1lSemaSwm4H2K0MN7LtHLb CwIliDkHgt1jToW4EezZvA/QOA5+KWd/k3xoNtxgRhfcsUzKwvLFRcHi6QsIs7QQOJ y19uudAIQ9QSz60WGNBXNrIL3tqvQ3isjKMJBFxKPUwayzxWB0hok9K7rgSphsJq79 ZvRxJKBq/AZYw+p9ddgFkhI78DdBNPZqqqePL4A1w2ChMNQHXL/34bbAubvWhZXv9L VKI5xbRcLAijg== From: Matthieu Baerts Date: Tue, 31 Oct 2023 16:49:34 +0100 Subject: [PATCH bpf-next] bpf: fix compilation error without CGROUPS MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20231031-bpf-compil-err-css-v1-1-e2244c637835@kernel.org> X-B4-Tracking: v=1; b=H4sIAA0iQWUC/x2M0QqDMAwAf0XyvEBqVWS/MvYwa+oCs5ZEhiD+u 9XHg7vbwViFDZ7VDsp/MVlSAfeoIHw/aWKUsTDUVHtH3uGQI4ZlzvJDVsVghtR20Y8DNX1HUMK sHGW7py+4/MTbCu/jOAGEKaWIbgAAAA== To: Yonghong Song , Alexei Starovoitov , Daniel Borkmann , Andrii Nakryiko , Martin KaFai Lau , Song Liu , John Fastabend , KP Singh , Stanislav Fomichev , Hao Luo , Jiri Olsa , Chuyi Zhou , Tejun Heo Cc: bpf@vger.kernel.org, linux-kernel@vger.kernel.org, mptcp@lists.linux.dev, kernel test robot , Matthieu Baerts X-Mailer: b4 0.12.4 X-Developer-Signature: v=1; a=openpgp-sha256; l=3822; i=matttbe@kernel.org; h=from:subject:message-id; bh=ptwLXdCn0ccaumT/kPopEMDLG2wWUx3Jgvu71frbDck=; b=owEBbQKS/ZANAwAIAfa3gk9CaaBzAcsmYgBlQSIf7JzITS5yigKSmkjBEojx4ObevveToHbTO HbhWN3Vsy6JAjMEAAEIAB0WIQToy4X3aHcFem4n93r2t4JPQmmgcwUCZUEiHwAKCRD2t4JPQmmg c693EADmVd/miwyt3lQhaFzmnmadovlFUo9fUa0ZqvDwzTRA3eiqY1LYjMou+syLNJndFI/e9u/ 1jtiqO+vJ6WvInqW6lJPyhK9Gazo9/+DaSgq+exeB5GFcDDgwU7Ar97dUIvC/kXNKFNucFFsItX 2ORKGxVnWScKW0e0Sq+csK6DcKrNV4258dB6l8ZULB/7WP7AEBZEMgTxltfFfogNxTS5JtisUFH xoWIaW5zpCxJgJ54kcJ5wvDy/OmLMkuNHhTPVbaerFNnqj5peDMQpEwks1226XUq10nMK03Z75/ HgChOn+Yp8BUYJUh1ZLRHYmn/97bLIYAb8bpSPpwdqe8/A68eIYkCJSXR8+1jkmJqjKfrMCkCQV l5Pc0Xg64eQTGVjI0vCeOqIXYTHib62t34yoOGWozvjFq0DH45YmyqVu0WllKyCbrJlw/ZWjyUl aCP02+UlApolXNJhrei2wk7/rVCOY16F39LFhqVu4O/g3vwP0LRXeEQkd4MiwLmEpAbTeEN/DCP bvNgLKcO8wAqC8XFoP7TV/eVwanwTk+fpHfstswWxmMNn7BjC2GsqSFPQYj+6yjb76WhJbIPObJ 4os5PrT/QpWmaWvGxA3URiUOJ4i/wsFmKsCpgvV7Cy8MkrpGs9cvhAY+l8zoiFV7ScQp1Xz5DjH b4nh7Z2GUs86WCQ== X-Developer-Key: i=matttbe@kernel.org; a=openpgp; fpr=E8CB85F76877057A6E27F77AF6B7824F4269A073 X-Spam-Status: No, score=-1.7 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,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 agentk.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 (agentk.vger.email [0.0.0.0]); Tue, 31 Oct 2023 08:50:08 -0700 (PDT) Our MPTCP CI complained [1] -- and KBuild too -- that it was no longer possible to build the kernel without CONFIG_CGROUPS: kernel/bpf/task_iter.c: In function 'bpf_iter_css_task_new': kernel/bpf/task_iter.c:919:14: error: 'CSS_TASK_ITER_PROCS' undeclared (first use in this function) 919 | case CSS_TASK_ITER_PROCS | CSS_TASK_ITER_THREADED: | ^~~~~~~~~~~~~~~~~~~ kernel/bpf/task_iter.c:919:14: note: each undeclared identifier is reported only once for each function it appears in kernel/bpf/task_iter.c:919:36: error: 'CSS_TASK_ITER_THREADED' undeclared (first use in this function) 919 | case CSS_TASK_ITER_PROCS | CSS_TASK_ITER_THREADED: | ^~~~~~~~~~~~~~~~~~~~~~ kernel/bpf/task_iter.c:927:60: error: invalid application of 'sizeof' to incomplete type 'struct css_task_iter' 927 | kit->css_it = bpf_mem_alloc(&bpf_global_ma, sizeof(struct css_task_iter)); | ^~~~~~ kernel/bpf/task_iter.c:930:9: error: implicit declaration of function 'css_task_iter_start'; did you mean 'task_seq_start'? [-Werror=implicit-function-declaration] 930 | css_task_iter_start(css, flags, kit->css_it); | ^~~~~~~~~~~~~~~~~~~ | task_seq_start kernel/bpf/task_iter.c: In function 'bpf_iter_css_task_next': kernel/bpf/task_iter.c:940:16: error: implicit declaration of function 'css_task_iter_next'; did you mean 'class_dev_iter_next'? [-Werror=implicit-function-declaration] 940 | return css_task_iter_next(kit->css_it); | ^~~~~~~~~~~~~~~~~~ | class_dev_iter_next kernel/bpf/task_iter.c:940:16: error: returning 'int' from a function with return type 'struct task_struct *' makes pointer from integer without a cast [-Werror=int-conversion] 940 | return css_task_iter_next(kit->css_it); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ kernel/bpf/task_iter.c: In function 'bpf_iter_css_task_destroy': kernel/bpf/task_iter.c:949:9: error: implicit declaration of function 'css_task_iter_end' [-Werror=implicit-function-declaration] 949 | css_task_iter_end(kit->css_it); | ^~~~~~~~~~~~~~~~~ This patch simply surrounds with a #ifdef the new code requiring CGroups support. It seems enough for the compiler and this is similar to bpf_iter_css_{new,next,destroy}() functions where no other #ifdef have been added in kernel/bpf/helpers.c and in the selftests. Fixes: 9c66dc94b62a ("bpf: Introduce css_task open-coded iterator kfuncs") Link: https://github.com/multipath-tcp/mptcp_net-next/actions/runs/6665206927 Reported-by: kernel test robot Closes: https://lore.kernel.org/oe-kbuild-all/202310260528.aHWgVFqq-lkp@intel.com/ Signed-off-by: Matthieu Baerts --- kernel/bpf/task_iter.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/kernel/bpf/task_iter.c b/kernel/bpf/task_iter.c index 59e747938bdb..e0d313114a5b 100644 --- a/kernel/bpf/task_iter.c +++ b/kernel/bpf/task_iter.c @@ -894,6 +894,8 @@ __bpf_kfunc void bpf_iter_task_vma_destroy(struct bpf_iter_task_vma *it) __diag_pop(); +#ifdef CONFIG_CGROUPS + struct bpf_iter_css_task { __u64 __opaque[1]; } __attribute__((aligned(8))); @@ -952,6 +954,8 @@ __bpf_kfunc void bpf_iter_css_task_destroy(struct bpf_iter_css_task *it) __diag_pop(); +#endif /* CONFIG_CGROUPS */ + struct bpf_iter_task { __u64 __opaque[3]; } __attribute__((aligned(8))); --- base-commit: f1c73396133cb3d913e2075298005644ee8dfade change-id: 20231031-bpf-compil-err-css-056f3db04860 Best regards, -- Matthieu Baerts