[v8,10/12] test: enable bpf autotest

Message ID 20210913181510.46058-11-stephen@networkplumber.org (mailing list archive)
State Superseded, archived
Delegated to: Thomas Monjalon
Headers
Series Packet capture framework enhancements |

Checks

Context Check Description
ci/checkpatch success coding style OK

Commit Message

Stephen Hemminger Sept. 13, 2021, 6:15 p.m. UTC
  The BPF autotest is defined but not run automatically.
Since it is short, it should be added to the autotest suite.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 app/test/meson.build | 2 ++
 1 file changed, 2 insertions(+)
  

Comments

Ananyev, Konstantin Sept. 15, 2021, 11:27 a.m. UTC | #1
> The BPF autotest is defined but not run automatically.
> Since it is short, it should be added to the autotest suite.
> 
> Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
> ---
>  app/test/meson.build | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/app/test/meson.build b/app/test/meson.build
> index 0d551ac9c2b2..cd18484bb73a 100644
> --- a/app/test/meson.build
> +++ b/app/test/meson.build
> @@ -194,6 +194,8 @@ test_deps = [
>  fast_tests = [
>          ['acl_autotest', true],
>          ['atomic_autotest', false],
> +        ['bpf_autotest', true],
> +        ['bpf_convert_autotest', true],
>          ['bitops_autotest', true],
>          ['byteorder_autotest', true],
>          ['cksum_autotest', true],
> --

Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>

> 2.30.2
  
Stephen Hemminger Sept. 15, 2021, 11:36 p.m. UTC | #2
On Wed, 15 Sep 2021 11:27:15 +0000
"Ananyev, Konstantin" <konstantin.ananyev@intel.com> wrote:

> > The BPF autotest is defined but not run automatically.
> > Since it is short, it should be added to the autotest suite.
> > 
> > Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
> > ---
> >  app/test/meson.build | 2 ++
> >  1 file changed, 2 insertions(+)
> > 
> > diff --git a/app/test/meson.build b/app/test/meson.build
> > index 0d551ac9c2b2..cd18484bb73a 100644
> > --- a/app/test/meson.build
> > +++ b/app/test/meson.build
> > @@ -194,6 +194,8 @@ test_deps = [
> >  fast_tests = [
> >          ['acl_autotest', true],
> >          ['atomic_autotest', false],
> > +        ['bpf_autotest', true],
> > +        ['bpf_convert_autotest', true],
> >          ['bitops_autotest', true],
> >          ['byteorder_autotest', true],
> >          ['cksum_autotest', true],
> > --  
> 
> Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
> 
> > 2.30.2  
> 

One oddity of original BPF test is that it constructs an mbuf where there
is no Ethernet header.  Didn't want to change that since not only
would the constructor have to be changed but also the hand written
BPF programs as well.

Not necessarily a bug, but the test is not doing what any application
using BPF on incoming mbuf's would expect to do.
  
Stephen Hemminger Sept. 16, 2021, 3:09 a.m. UTC | #3
On Mon, 13 Sep 2021 11:15:08 -0700
Stephen Hemminger <stephen@networkplumber.org> wrote:

> The BPF autotest is defined but not run automatically.
> Since it is short, it should be added to the autotest suite.
> 
> Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
> ---
>  app/test/meson.build | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/app/test/meson.build b/app/test/meson.build
> index 0d551ac9c2b2..cd18484bb73a 100644
> --- a/app/test/meson.build
> +++ b/app/test/meson.build
> @@ -194,6 +194,8 @@ test_deps = [
>  fast_tests = [
>          ['acl_autotest', true],
>          ['atomic_autotest', false],
> +        ['bpf_autotest', true],
> +        ['bpf_convert_autotest', true],
>          ['bitops_autotest', true],
>          ['byteorder_autotest', true],
>          ['cksum_autotest', true],

Note: this patch exposes a pre-existing bug in DPDK:
https://bugs.dpdk.org/show_bug.cgi?id=811

The BPF code does not work if built with Clang.
The test was just being ignored by the CI before!
  

Patch

diff --git a/app/test/meson.build b/app/test/meson.build
index 0d551ac9c2b2..cd18484bb73a 100644
--- a/app/test/meson.build
+++ b/app/test/meson.build
@@ -194,6 +194,8 @@  test_deps = [
 fast_tests = [
         ['acl_autotest', true],
         ['atomic_autotest', false],
+        ['bpf_autotest', true],
+        ['bpf_convert_autotest', true],
         ['bitops_autotest', true],
         ['byteorder_autotest', true],
         ['cksum_autotest', true],