Received: by 2002:a05:7412:f589:b0:e2:908c:2ebd with SMTP id eh9csp734308rdb; Wed, 1 Nov 2023 00:26:34 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHcu9xD7/DBzUPhXzs/ozME5DW6RVUH+W66a1rVjTpBNOd69FQJ2lWu1dnWklDd1HoR1ein X-Received: by 2002:a05:6a20:8f03:b0:13d:5b8e:db83 with SMTP id b3-20020a056a208f0300b0013d5b8edb83mr16052952pzk.9.1698823593886; Wed, 01 Nov 2023 00:26:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698823593; cv=none; d=google.com; s=arc-20160816; b=BtmSOiLwHFBPrbAsc6He6B99GWAn1fcnAowV6HG9EaDkl9fvvFRaUPVesJUy8Mq7uH GDHyQrWafN2sH4phiLRIGASzw8sbTDBcCn6x0d0iKmYW+Gah3hv+79q4NrFCaEPIkLvm Ty9Aq7bmEP2UhI01GShy+B3wBaL9DRsCZWsSbDBpNkH+sq1tbETuQFqV+LJjfQDW2/rS Q9azQBOsUtbns6/VQNXaZRzbkcr7GTajAZCrCt6PbsXek8KYehG/8vQz0zZsVtQKSPUP vKzCo5to5VO430wPapONsHKlTmMdO/P4caAnW/UkTL9P5HIs0SZ6JhH7zNo310Kx43mT Z65g== 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:date:from:dkim-signature; bh=0B6t64iTbqlkXV8vHqQhKtKlN8kObrIwOhWS9YPxd2c=; fh=uK4XHtX8q4srOcN5WExtvNw1/lC7uMXqGBS4vxVsD6k=; b=Fv866m8ngLW0H/LPUZ8NHPWw8SmOTx2uQVYbgPtfNAop+9uJdP9Pq+Tx0I/ao3mmeC GzydJIow0NkGhRC2QRgQKc49MGsHfqKutrLBauFjtVTb8EIB0veuCdYT/qkw04O29Qxg rCHynziwMFbbjk6O5LVlS3xeXTnUGJ8CZBfP1LNWbTsRjM/yZybfwQZ/xcJ8gsmh9RXq JoboVxjI2w4wif3IAgUnYyhnQYXQpjxZxTh4B/ynsFvSiFkFjpEDGNZHC0dh0NLXr3eH c8ctwfOfUYqdYVQaY1oLq50mHsbdvW+jKPJ0s46Q6PW66AJSE+NFTPKAWoWnR5iQN9sj HB4Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=itjQTJf0; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id h4-20020a170902f54400b001c9c89fd36dsi2544100plf.203.2023.11.01.00.26.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 Nov 2023 00:26:33 -0700 (PDT) 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=@gmail.com header.s=20230601 header.b=itjQTJf0; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id E3D638092DB6; Wed, 1 Nov 2023 00:26:17 -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 S231138AbjKAHZw (ORCPT + 99 others); Wed, 1 Nov 2023 03:25:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50096 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230206AbjKAHZq (ORCPT ); Wed, 1 Nov 2023 03:25:46 -0400 Received: from mail-ed1-x533.google.com (mail-ed1-x533.google.com [IPv6:2a00:1450:4864:20::533]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DC639107; Wed, 1 Nov 2023 00:25:42 -0700 (PDT) Received: by mail-ed1-x533.google.com with SMTP id 4fb4d7f45d1cf-5437d60fb7aso2219826a12.3; Wed, 01 Nov 2023 00:25:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1698823541; x=1699428341; darn=vger.kernel.org; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:date:from:from:to :cc:subject:date:message-id:reply-to; bh=0B6t64iTbqlkXV8vHqQhKtKlN8kObrIwOhWS9YPxd2c=; b=itjQTJf0hPtSeKP0359/n8uA0SC/CXw5AdojH8UUBlJ8dH4/wKV7IPshyOu3y7Il9C XOQdoy429xJNqsVi/uCaClMB62/p08AOxw1o4A1LYufbmjwWyqMftl9tqtkAnkVpPsn6 zPiQ9s+TiUEXFbdBj+Mxypk0iCGihFQhD2jlyhEKjVbu7yt0uyXO8bZX0mw9DSSgAnBl vnO9YMe3Nq06zk0q2rAfPrhY+yKMvbmxtjDa4pxFTrl2NpAtx+yPL+RjYqK5ym3Ag8qR guBJc1uzzcecgPMOap2jOudzdDSiy0TIWHST+Oftj8xEv8G7BCq4cOf3w96GeF/zshcC 4rnw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698823541; x=1699428341; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:date:from :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=0B6t64iTbqlkXV8vHqQhKtKlN8kObrIwOhWS9YPxd2c=; b=lgwAfpBXQPznVu4Jn3Iwo7a6z1Vt1xGDZ3iiKEFonm1bE1xzQOhIw47X4S9KVW6YcD aSghrd7ixmZGe766Wx4tACcs3KI96QSgUH0KFR8yJnvNkmThAyzRWA0c5sVwb5eQZSfd rSYJzEf6LsLadI+3liVDV/HBOyXnqMJ6GMwN+sAUaJ1Adko3fG5KOjUfu+9ZLY+sGy0h OqUi9OdhU7cA4BHLg3WZzr2MRcMI8POP1fhV32aDdCfQxwhn6+r5MlrmQUDtkvTa4lgP B3qN5M/V4v0r5fSdqxr12n4+vtluU4rj7i0+aDBJa3cIk8R86DkKEjvf1fmZR1IXhML/ 7ZYA== X-Gm-Message-State: AOJu0YxDBIdEzg9eCCgCWj+Do/cpQQFOLXHB8HM/yLBw0xnsyPCwQW4Z SJcQkw7hUN0eEjMQIVdNHDM= X-Received: by 2002:a17:907:d21:b0:9c0:eb3e:b070 with SMTP id gn33-20020a1709070d2100b009c0eb3eb070mr1204779ejc.69.1698823540960; Wed, 01 Nov 2023 00:25:40 -0700 (PDT) Received: from krava (2001-1ae9-1c2-4c00-726e-c10f-8833-ff22.ip6.tmcz.cz. [2001:1ae9:1c2:4c00:726e:c10f:8833:ff22]) by smtp.gmail.com with ESMTPSA id k12-20020a1709065fcc00b009ce03057c48sm2067069ejv.214.2023.11.01.00.25.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 Nov 2023 00:25:40 -0700 (PDT) From: Jiri Olsa X-Google-Original-From: Jiri Olsa Date: Wed, 1 Nov 2023 08:25:38 +0100 To: Alexei Starovoitov Cc: Jiri Olsa , Matthieu Baerts , Yonghong Song , Alexei Starovoitov , Daniel Borkmann , Andrii Nakryiko , Martin KaFai Lau , Song Liu , John Fastabend , KP Singh , Stanislav Fomichev , Hao Luo , Chuyi Zhou , Tejun Heo , bpf , LKML , MPTCP Upstream , kernel test robot Subject: Re: [PATCH bpf-next] bpf: fix compilation error without CGROUPS Message-ID: References: <20231031-bpf-compil-err-css-v1-1-e2244c637835@kernel.org> 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=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,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]); Wed, 01 Nov 2023 00:26:18 -0700 (PDT) On Tue, Oct 31, 2023 at 08:54:56PM -0700, Alexei Starovoitov wrote: > On Tue, Oct 31, 2023 at 10:05 AM Jiri Olsa wrote: > > > > On Tue, Oct 31, 2023 at 04:49:34PM +0100, Matthieu Baerts wrote: > > > 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 > > > > Acked/Tested-by: Jiri Olsa > > I believe this patch has the same issue as Arnd's patch: > https://lore.kernel.org/all/CAADnVQL-zoFPPOVu3nM981gKxRu7Q3G3LTRsKstJEeahpoR1RQ@mail.gmail.com/ > > I'd like to merge the fix asap. Please make it a complete fix. ugh, it won't fail the build, it just warns.. I think we should fail the build in that case, I'll check jirka