BPF List
 help / color / mirror / Atom feed
From: "Toke Høiland-Jørgensen" <toke@redhat.com>
To: Alexei Starovoitov <alexei.starovoitov@gmail.com>
Cc: Alexei Starovoitov <ast@kernel.org>,
	Daniel Borkmann <daniel@iogearbox.net>,
	John Fastabend <john.fastabend@gmail.com>,
	Andrii Nakryiko <andrii@kernel.org>,
	Martin KaFai Lau <martin.lau@linux.dev>,
	Eduard Zingerman <eddyz87@gmail.com>, Song Liu <song@kernel.org>,
	Yonghong Song <yonghong.song@linux.dev>,
	KP Singh <kpsingh@kernel.org>,
	Stanislav Fomichev <sdf@fomichev.me>, Hao Luo <haoluo@google.com>,
	Jiri Olsa <jolsa@kernel.org>,
	Kumar Kartikeya Dwivedi <memxor@gmail.com>,
	Simon Sundberg <simon.sundberg@kau.se>, bpf <bpf@vger.kernel.org>,
	Network Development <netdev@vger.kernel.org>
Subject: Re: [PATCH bpf 2/4] selftests/bpf: Consolidate kernel modules into common directory
Date: Thu, 10 Oct 2024 10:59:48 +0200	[thread overview]
Message-ID: <875xq0s58b.fsf@toke.dk> (raw)
In-Reply-To: <CAADnVQKuw=HqtzRok5NyxMDLoe=AHQfwtBxpe9hs3G1HDRJmfA@mail.gmail.com>

Alexei Starovoitov <alexei.starovoitov@gmail.com> writes:

> On Wed, Oct 9, 2024 at 12:39 AM Toke Høiland-Jørgensen <toke@redhat.com> wrote:
>>
>> Alexei Starovoitov <alexei.starovoitov@gmail.com> writes:
>>
>> > On Tue, Oct 8, 2024 at 3:35 AM Toke Høiland-Jørgensen <toke@redhat.com> wrote:
>> >>
>> >> The selftests build two kernel modules (bpf_testmod.ko and
>> >> bpf_test_no_cfi.ko) which use copy-pasted Makefile targets. This is a
>> >> bit messy, and doesn't scale so well when we add more modules, so let's
>> >> consolidate these rules into a single rule generated for each module
>> >> name, and move the module sources into a single directory.
>> >>
>> >> To avoid parallel builds of the different modules stepping on each
>> >> other's toes during the 'modpost' phase of the Kbuild 'make modules', we
>> >> create a single target for all the defined modules, which contains the
>> >> recursive 'make' call into the modules directory. The Makefile in the
>> >> subdirectory building the modules is modified to also touch a
>> >> 'modules.built' file, which we can add as a dependency on the top-level
>> >> selftests Makefile, thus ensuring that the modules are always rebuilt if
>> >> any of the dependencies in the selftests change.
>> >
>> > Nice cleanup, but looks unrelated to the fix and hence
>> > not a bpf material.
>> > Why combine them?
>>
>> Because the selftest adds two more kernel modules to the selftest build,
>> so we'd have to add two more directories with a single module in each
>> and copy-pasted Makefile rules. It seemed simpler to just refactor the
>> build of the two existing modules first, after which adding the two new
>> modules means just dropping two more source files into the modules
>> directory.
>>
>> I guess we could technically do the single-directory-per-module, and
>> then send this patch as a follow-up once bpf gets merged back into
>> bpf-next, but it seems a bit of a hassle, TBH. WDYT?
>
> The way it is right it's certainly not going into bpf tree.
> So if you don't want to split then the whole thing is bpf-next then.

ACK. Will see how cumbersome it is to split, and otherwise resubmit the
whole thing against bpf-next.

-Toke


  reply	other threads:[~2024-10-10  8:59 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-08 10:35 [PATCH bpf 0/4] Fix caching of BTF for kfuncs in the verifier Toke Høiland-Jørgensen
2024-10-08 10:35 ` [PATCH bpf 1/4] bpf: fix kfunc btf caching for modules Toke Høiland-Jørgensen
2024-10-08 17:46   ` Jiri Olsa
2024-10-09  1:43   ` Kumar Kartikeya Dwivedi
2024-10-08 10:35 ` [PATCH bpf 2/4] selftests/bpf: Consolidate kernel modules into common directory Toke Høiland-Jørgensen
2024-10-08 17:46   ` Jiri Olsa
2024-10-08 17:55     ` Toke Høiland-Jørgensen
2024-10-08 18:18       ` Jiri Olsa
2024-10-08 18:23         ` Toke Høiland-Jørgensen
2024-10-09  2:08   ` Alexei Starovoitov
2024-10-09  7:39     ` Toke Høiland-Jørgensen
2024-10-09 23:36       ` Alexei Starovoitov
2024-10-10  8:59         ` Toke Høiland-Jørgensen [this message]
2024-10-08 10:35 ` [PATCH bpf 3/4] selftests/bpf: Provide a generic [un]load_module helper Toke Høiland-Jørgensen
2024-10-08 17:54   ` Jiri Olsa
2024-10-09  1:44   ` Kumar Kartikeya Dwivedi
2024-10-08 10:35 ` [PATCH bpf 4/4] selftests/bpf: Add test for kfunc module order Toke Høiland-Jørgensen
2024-10-08 17:46   ` Jiri Olsa
2024-10-08 18:05     ` Toke Høiland-Jørgensen
2024-10-09  2:09   ` Kumar Kartikeya Dwivedi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=875xq0s58b.fsf@toke.dk \
    --to=toke@redhat.com \
    --cc=alexei.starovoitov@gmail.com \
    --cc=andrii@kernel.org \
    --cc=ast@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=eddyz87@gmail.com \
    --cc=haoluo@google.com \
    --cc=john.fastabend@gmail.com \
    --cc=jolsa@kernel.org \
    --cc=kpsingh@kernel.org \
    --cc=martin.lau@linux.dev \
    --cc=memxor@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=sdf@fomichev.me \
    --cc=simon.sundberg@kau.se \
    --cc=song@kernel.org \
    --cc=yonghong.song@linux.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox