From: Stanislav Fomichev Subject: Re: [PATCH bpf-next 1/2] selftests/bpf: skip verifier tests that depend on CONFIG_CGROUP_BPF Date: Wed, 12 Dec 2018 10:59:13 -0800 Message-ID: <20181212185913.GD9107@mini-arch.hsd1.ca.comcast.net> References: <20181212182725.106418-1-sdf@google.com> <20181212185131.yz7bxscdokfavna3@ast-mbp.dhcp.thefacebook.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Stanislav Fomichev , netdev@vger.kernel.org, davem@davemloft.net, ast@kernel.org, daniel@iogearbox.net To: Alexei Starovoitov Return-path: Received: from mail-pf1-f196.google.com ([209.85.210.196]:45036 "EHLO mail-pf1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726880AbeLLS7P (ORCPT ); Wed, 12 Dec 2018 13:59:15 -0500 Received: by mail-pf1-f196.google.com with SMTP id u6so9289947pfh.11 for ; Wed, 12 Dec 2018 10:59:15 -0800 (PST) Content-Disposition: inline In-Reply-To: <20181212185131.yz7bxscdokfavna3@ast-mbp.dhcp.thefacebook.com> Sender: netdev-owner@vger.kernel.org List-ID: On 12/12, Alexei Starovoitov wrote: > On Wed, Dec 12, 2018 at 10:27:24AM -0800, Stanislav Fomichev wrote: > > The following prog types don't make sense without bpf cgroup: > > * BPF_PROG_TYPE_CGROUP_SKB > > * BPF_PROG_TYPE_CGROUP_SOCK > > * BPF_PROG_TYPE_CGROUP_SOCK_ADDR > > > > Skip running verifier tests that exercise these prog types if > > kernel is built without proper support. > > > > See commit e5c504858a18 ("selftests/bpf: skip verifier sockmap tests > > on kernels without support") for original motivation. > > > > Signed-off-by: Stanislav Fomichev > > --- > > tools/testing/selftests/bpf/test_verifier.c | 35 +++++++++++++++++++++ > > 1 file changed, 35 insertions(+) > > > > diff --git a/tools/testing/selftests/bpf/test_verifier.c b/tools/testing/selftests/bpf/test_verifier.c > > index f5015566ae1b..b5470a399996 100644 > > --- a/tools/testing/selftests/bpf/test_verifier.c > > +++ b/tools/testing/selftests/bpf/test_verifier.c > > @@ -44,6 +44,7 @@ > > /* fallback to all features enabled */ > > # define CONFIG_BPF_STREAM_PARSER 1 > > # define CONFIG_XDP_SOCKETS 1 > > +# define CONFIG_CGROUP_BPF 1 > > I really don't like where these is going. > I think previous set should be reverted. > This is not a scalable approach. > Use libbpf probing approach to check whether feature is present instead. I can probably add runtime probing instead of depending on compile-time config, but I think that we would still need some per-test mechanism to say that it depends on feature X (per-test .config_disabled or similar). Will moving these checks to runtime address your concern? (there is sill a scalability issue though)