All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH] package/linux-tools: selftests: add numactl dependency for net tests
@ 2020-03-25 16:42 Vadym Kochan
  2020-04-11 13:26 ` Thomas Petazzoni
  0 siblings, 1 reply; 6+ messages in thread
From: Vadym Kochan @ 2020-03-25 16:42 UTC (permalink / raw)
  To: buildroot

Linux selftests/net/reuseport_bpf_numa.c requires numa.h header which
is provided by numactl package. Otherwise net tests are failed to
install.

Signed-off-by: Vadym Kochan <vadim4j@gmail.com>
---
 package/linux-tools/Config.in                  | 1 +
 package/linux-tools/linux-tool-selftests.mk.in | 2 +-
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/package/linux-tools/Config.in b/package/linux-tools/Config.in
index ceb58c668a..eda17440fe 100644
--- a/package/linux-tools/Config.in
+++ b/package/linux-tools/Config.in
@@ -91,6 +91,7 @@ config BR2_PACKAGE_LINUX_TOOLS_SELFTESTS
 	select BR2_PACKAGE_KMOD_TOOLS # runtime (modprobe -n)
 	select BR2_PACKAGE_POPT
 	select BR2_PACKAGE_LIBCAP_NG
+	select BR2_PACKAGE_NUMACTL # required by net tests
 	select BR2_PACKAGE_UTIL_LINUX
 	select BR2_PACKAGE_UTIL_LINUX_SCHEDUTILS # runtime (taskset)
 	help
diff --git a/package/linux-tools/linux-tool-selftests.mk.in b/package/linux-tools/linux-tool-selftests.mk.in
index c4e5bf0fea..48849c5b52 100644
--- a/package/linux-tools/linux-tool-selftests.mk.in
+++ b/package/linux-tools/linux-tool-selftests.mk.in
@@ -16,7 +16,7 @@ SELFTESTS_ARCH=$(KERNEL_ARCH)
 endif
 endif
 
-SELFTESTS_DEPENDENCIES = libcap-ng popt
+SELFTESTS_DEPENDENCIES = libcap-ng popt numactl
 
 SELFTESTS_MAKE_FLAGS = \
 	$(LINUX_MAKE_FLAGS) \
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [Buildroot] [PATCH] package/linux-tools: selftests: add numactl dependency for net tests
  2020-03-25 16:42 [Buildroot] [PATCH] package/linux-tools: selftests: add numactl dependency for net tests Vadym Kochan
@ 2020-04-11 13:26 ` Thomas Petazzoni
  2020-04-21 17:51   ` Vadim Kochan
  0 siblings, 1 reply; 6+ messages in thread
From: Thomas Petazzoni @ 2020-04-11 13:26 UTC (permalink / raw)
  To: buildroot

Hello Vadym,

On Wed, 25 Mar 2020 18:42:40 +0200
Vadym Kochan <vadim4j@gmail.com> wrote:

> Linux selftests/net/reuseport_bpf_numa.c requires numa.h header which
> is provided by numactl package. Otherwise net tests are failed to
> install.
> 
> Signed-off-by: Vadym Kochan <vadim4j@gmail.com>

Thanks for your patch. However, I think this is not going in the right
direction. Indeed, the selftests have many more dependencies:

 - The BPF tests need libcap and libelf

 - The gpio tests require libmount from util-linux

 - The memfd tests require fuse

 - The netfilter tests require libmnl

etc.

So, I think we should:

 - Pass FORCE_TARGETS=1 during the build so that the build aborts if a
   required dependency is not found.

 - Switch to using more optional dependencies, and disable the TARGETS
   that we cannot build by passing the appropriate SKIP_TARGETS value
   to the Makefile.

Could you work on this ? We probably need to make libcap-ng optional,
but also popt. The other options that are selected by
BR2_PACKAGE_LINUX_TOOLS_SELFTESTS might also need to be revisited.

An alternative is to just say that we don't care about making all of
that optional, and simply unconditionally enable all the dependencies
that selftests need, to build everything. Easier, but that's not the
normal Buildroot design principle.

Best regards,

Thomas
-- 
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Buildroot] [PATCH] package/linux-tools: selftests: add numactl dependency for net tests
  2020-04-21 17:51   ` Vadim Kochan
@ 2020-04-21 14:55     ` Thomas Petazzoni
  2020-04-22 11:23       ` Vadim Kochan
  0 siblings, 1 reply; 6+ messages in thread
From: Thomas Petazzoni @ 2020-04-21 14:55 UTC (permalink / raw)
  To: buildroot

Hello,

On Tue, 21 Apr 2020 20:51:40 +0300
Vadim Kochan <vadim4j@gmail.com> wrote:

> > So, I think we should:
> > 
> >  - Pass FORCE_TARGETS=1 during the build so that the build aborts if a
> >    required dependency is not found.
> > 
> >  - Switch to using more optional dependencies, and disable the TARGETS
> >    that we cannot build by passing the appropriate SKIP_TARGETS value
> >    to the Makefile.
> > 
> > Could you work on this ? We probably need to make libcap-ng optional,
> > but also popt. The other options that are selected by
> > BR2_PACKAGE_LINUX_TOOLS_SELFTESTS might also need to be revisited.
> > 
> > An alternative is to just say that we don't care about making all of
> > that optional, and simply unconditionally enable all the dependencies
> > that selftests need, to build everything. Easier, but that's not the
> > normal Buildroot design principle.
> > 
> > Best regards,
> > 
> > Thomas  
> 
> Yes, I understand your point. I think it would be useful to add config
> options per each selftests subsystem to easy turn it on.

I don't know if we really want to add one sub-option for each selftest
subsystem, that would be quite a lot.

However, we should properly enable/disable selftest subsystems
depending on the availability of the necessary dependencies. For
example, if numactl is enabled, then we enable the network-related
selftests, otherwise we disable them.

Best regards,

Thomas
-- 
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Buildroot] [PATCH] package/linux-tools: selftests: add numactl dependency for net tests
  2020-04-11 13:26 ` Thomas Petazzoni
@ 2020-04-21 17:51   ` Vadim Kochan
  2020-04-21 14:55     ` Thomas Petazzoni
  0 siblings, 1 reply; 6+ messages in thread
From: Vadim Kochan @ 2020-04-21 17:51 UTC (permalink / raw)
  To: buildroot

Hi Thomas,

On Sat, Apr 11, 2020 at 03:26:49PM +0200, Thomas Petazzoni wrote:
> Hello Vadym,
> 
> On Wed, 25 Mar 2020 18:42:40 +0200
> Vadym Kochan <vadim4j@gmail.com> wrote:
> 
> > Linux selftests/net/reuseport_bpf_numa.c requires numa.h header which
> > is provided by numactl package. Otherwise net tests are failed to
> > install.
> > 
> > Signed-off-by: Vadym Kochan <vadim4j@gmail.com>
> 
> Thanks for your patch. However, I think this is not going in the right
> direction. Indeed, the selftests have many more dependencies:
> 
>  - The BPF tests need libcap and libelf
> 
>  - The gpio tests require libmount from util-linux
> 
>  - The memfd tests require fuse
> 
>  - The netfilter tests require libmnl
> 
> etc.
> 
> So, I think we should:
> 
>  - Pass FORCE_TARGETS=1 during the build so that the build aborts if a
>    required dependency is not found.
> 
>  - Switch to using more optional dependencies, and disable the TARGETS
>    that we cannot build by passing the appropriate SKIP_TARGETS value
>    to the Makefile.
> 
> Could you work on this ? We probably need to make libcap-ng optional,
> but also popt. The other options that are selected by
> BR2_PACKAGE_LINUX_TOOLS_SELFTESTS might also need to be revisited.
> 
> An alternative is to just say that we don't care about making all of
> that optional, and simply unconditionally enable all the dependencies
> that selftests need, to build everything. Easier, but that's not the
> normal Buildroot design principle.
> 
> Best regards,
> 
> Thomas

Yes, I understand your point. I think it would be useful to add config
options per each selftests subsystem to easy turn it on.

Regards,
Vadym Kochan

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Buildroot] [PATCH] package/linux-tools: selftests: add numactl dependency for net tests
  2020-04-22 11:23       ` Vadim Kochan
@ 2020-04-22  8:24         ` Thomas Petazzoni
  0 siblings, 0 replies; 6+ messages in thread
From: Thomas Petazzoni @ 2020-04-22  8:24 UTC (permalink / raw)
  To: buildroot

On Wed, 22 Apr 2020 14:23:36 +0300
Vadim Kochan <vadim4j@gmail.com> wrote:

> My only concern is that user should guess which packages are needed for
> particular test suites (I mean at least per sub-system), or document it
> somewhere ?

This is pretty common in Buildroot that we have automatic optional
dependencies: we enable a feature if the necessary dependencies are
available. Having sub-options for everything would be a nightmare.

In addition, if a user had to build the selftests manually, he would
also have to figure out "aaah, I need numactl to build the network
tests".

In any case, the Buildroot .mk clearly documents the fact that package
ABC is needed to get a given feature in package XYZ.

Best regards,

Thomas
-- 
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Buildroot] [PATCH] package/linux-tools: selftests: add numactl dependency for net tests
  2020-04-21 14:55     ` Thomas Petazzoni
@ 2020-04-22 11:23       ` Vadim Kochan
  2020-04-22  8:24         ` Thomas Petazzoni
  0 siblings, 1 reply; 6+ messages in thread
From: Vadim Kochan @ 2020-04-22 11:23 UTC (permalink / raw)
  To: buildroot

Hi,

On Tue, Apr 21, 2020 at 04:55:10PM +0200, Thomas Petazzoni wrote:
> Hello,
> 
> On Tue, 21 Apr 2020 20:51:40 +0300
> Vadim Kochan <vadim4j@gmail.com> wrote:
> 
> > > So, I think we should:
> > > 
> > >  - Pass FORCE_TARGETS=1 during the build so that the build aborts if a
> > >    required dependency is not found.
> > > 
> > >  - Switch to using more optional dependencies, and disable the TARGETS
> > >    that we cannot build by passing the appropriate SKIP_TARGETS value
> > >    to the Makefile.
> > > 
> > > Could you work on this ? We probably need to make libcap-ng optional,
> > > but also popt. The other options that are selected by
> > > BR2_PACKAGE_LINUX_TOOLS_SELFTESTS might also need to be revisited.
> > > 
> > > An alternative is to just say that we don't care about making all of
> > > that optional, and simply unconditionally enable all the dependencies
> > > that selftests need, to build everything. Easier, but that's not the
> > > normal Buildroot design principle.
> > > 
> > > Best regards,
> > > 
> > > Thomas  
> > 
> > Yes, I understand your point. I think it would be useful to add config
> > options per each selftests subsystem to easy turn it on.
> 
> I don't know if we really want to add one sub-option for each selftest
> subsystem, that would be quite a lot.
> 
> However, we should properly enable/disable selftest subsystems
> depending on the availability of the necessary dependencies. For
> example, if numactl is enabled, then we enable the network-related
> selftests, otherwise we disable them.
> 
> Best regards,
> 
> Thomas

My only concern is that user should guess which packages are needed for
particular test suites (I mean at least per sub-system), or document it
somewhere ?

Regards,
Vadym Kochan

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2020-04-22 11:23 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-03-25 16:42 [Buildroot] [PATCH] package/linux-tools: selftests: add numactl dependency for net tests Vadym Kochan
2020-04-11 13:26 ` Thomas Petazzoni
2020-04-21 17:51   ` Vadim Kochan
2020-04-21 14:55     ` Thomas Petazzoni
2020-04-22 11:23       ` Vadim Kochan
2020-04-22  8:24         ` Thomas Petazzoni

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.