diff mbox series

[ovs-dev,3/3] ci: Run DPDK tests in GitHub Actions.

Message ID 20230123121425.916262-3-david.marchand@redhat.com
State Changes Requested
Headers show
Series [ovs-dev,1/3] system-dpdk: Introduce helpers for testpmd. | expand

Checks

Context Check Description
ovsrobot/apply-robot success apply and check: success
ovsrobot/github-robot-_Build_and_Test success github build: passed
ovsrobot/intel-ovs-compilation success test: success

Commit Message

David Marchand Jan. 23, 2023, 12:14 p.m. UTC
Let's enhance our coverage in the CI and run DPDK system tests.

A few DPDK drivers are enabled in DPDK compilation.

Put DPDK build in $PATH for dpdk-testpmd to be available.
sudo drops PATH= updates and -E does not seem to preserve this variable.
Pass PATH=$PATH when running the tests, as a workaround.
Since those tests are run as root, the collection of logs is updated
accordingly.

In GHA, only two cores are available but some test rely on testpmd using
three lcores.
Add a DPDK_EAL_OPTIONS environment variable and use it to map all
testpmd lcores to core 1 (and leave core 0 alone for OVS).

Signed-off-by: David Marchand <david.marchand@redhat.com>
---
 .ci/linux-build.sh                   | 22 ++++++++++++++++++----
 .github/workflows/build-and-test.yml |  7 ++++---
 tests/system-dpdk-macros.at          |  2 +-
 3 files changed, 23 insertions(+), 8 deletions(-)

Comments

Aaron Conole Jan. 26, 2023, 10:30 p.m. UTC | #1
David Marchand <david.marchand@redhat.com> writes:

> Let's enhance our coverage in the CI and run DPDK system tests.
>
> A few DPDK drivers are enabled in DPDK compilation.
>
> Put DPDK build in $PATH for dpdk-testpmd to be available.
> sudo drops PATH= updates and -E does not seem to preserve this variable.
> Pass PATH=$PATH when running the tests, as a workaround.
> Since those tests are run as root, the collection of logs is updated
> accordingly.
>
> In GHA, only two cores are available but some test rely on testpmd using
> three lcores.
> Add a DPDK_EAL_OPTIONS environment variable and use it to map all
> testpmd lcores to core 1 (and leave core 0 alone for OVS).
>
> Signed-off-by: David Marchand <david.marchand@redhat.com>
> ---

Nice - I even checked some of the results on github actions.

I guess our next steps should be to try and get some kind of
coveralls.io / cobertura like solution so that we can read a fancy
report of the code we have actually tested with the suites.

I did a quick look, and there are some github actions that will sortof
do the trick - but needs more research.

Meanwhile,

Acked-by: Aaron Conole <aconole@redhat.com>
David Marchand Jan. 27, 2023, 10:29 a.m. UTC | #2
On Thu, Jan 26, 2023 at 11:30 PM Aaron Conole <aconole@redhat.com> wrote:
>
> David Marchand <david.marchand@redhat.com> writes:
>
> > Let's enhance our coverage in the CI and run DPDK system tests.
> >
> > A few DPDK drivers are enabled in DPDK compilation.
> >
> > Put DPDK build in $PATH for dpdk-testpmd to be available.
> > sudo drops PATH= updates and -E does not seem to preserve this variable.
> > Pass PATH=$PATH when running the tests, as a workaround.
> > Since those tests are run as root, the collection of logs is updated
> > accordingly.
> >
> > In GHA, only two cores are available but some test rely on testpmd using
> > three lcores.
> > Add a DPDK_EAL_OPTIONS environment variable and use it to map all
> > testpmd lcores to core 1 (and leave core 0 alone for OVS).
> >
> > Signed-off-by: David Marchand <david.marchand@redhat.com>
> > ---
>
> Nice - I even checked some of the results on github actions.
>
> I guess our next steps should be to try and get some kind of
> coveralls.io / cobertura like solution so that we can read a fancy
> report of the code we have actually tested with the suites.

It seems to be a nice tool.
I am just a bit cautious as it is yet again a tool "free for
opensource projects" (for now? :-)).


>
> I did a quick look, and there are some github actions that will sortof
> do the trick - but needs more research.
>
> Meanwhile,
>
> Acked-by: Aaron Conole <aconole@redhat.com>
>

Another thing to enhance coverage, I was thinking of adding
system-traffic as part of the system-dpdk testsuite.
I did a small PoC that hacks ADD_VETH and uses net/tap DPDK driver:
one "side" of the veth is the tap netdev, the other "side" is a DPDK
port plugged in OVS bridge.

I am considering adding this for v2... :-).
Thoughts?
Ilya Maximets Jan. 27, 2023, 11:13 a.m. UTC | #3
On 1/23/23 13:14, David Marchand wrote:
> Let's enhance our coverage in the CI and run DPDK system tests.
> 
> A few DPDK drivers are enabled in DPDK compilation.
> 
> Put DPDK build in $PATH for dpdk-testpmd to be available.
> sudo drops PATH= updates and -E does not seem to preserve this variable.
> Pass PATH=$PATH when running the tests, as a workaround.
> Since those tests are run as root, the collection of logs is updated
> accordingly.
> 
> In GHA, only two cores are available but some test rely on testpmd using
> three lcores.
> Add a DPDK_EAL_OPTIONS environment variable and use it to map all
> testpmd lcores to core 1 (and leave core 0 alone for OVS).

This is a very tight packing.  In the past we had issues running tests
when PMD threads didn't allow other threads to do their job causing
test stalls and warnings/errors in logs.  Do you think it's not a problem
for dpdk testsuite?

Maybe we should use Cirrus CI instead?  We can request more cores there.

> 
> Signed-off-by: David Marchand <david.marchand@redhat.com>
> ---
>  .ci/linux-build.sh                   | 22 ++++++++++++++++++----
>  .github/workflows/build-and-test.yml |  7 ++++---
>  tests/system-dpdk-macros.at          |  2 +-
>  3 files changed, 23 insertions(+), 8 deletions(-)
> 
> diff --git a/.ci/linux-build.sh b/.ci/linux-build.sh
> index 10021fddb2..c9937103fa 100755
> --- a/.ci/linux-build.sh
> +++ b/.ci/linux-build.sh
> @@ -38,6 +38,8 @@ function install_dpdk()
>              if [ "${VER}" = "${DPDK_VER}" ]; then
>                  # Update the library paths.
>                  sudo ldconfig
> +                # Expose dpdk binaries.
> +                export PATH=$(pwd)/dpdk-dir/build/bin:$PATH
>                  echo "Found cached DPDK ${VER} build in $(pwd)/dpdk-dir"
>                  return
>              fi
> @@ -64,8 +66,10 @@ function install_dpdk()
>  
>      # OVS compilation and "normal" unit tests (run in the CI) do not depend on
>      # any DPDK driver being present.
> -    # We can disable all drivers to save compilation time.
> -    DPDK_OPTS="$DPDK_OPTS -Ddisable_drivers=*/*"
> +    # check-dpdk unit tests requires testpmd and some net/ driver.
> +    # We can disable all drivers but them, in order to save compilation time.
> +    DPDK_OPTS="$DPDK_OPTS -Denable_apps=test-pmd"
> +    DPDK_OPTS="$DPDK_OPTS -Denable_drivers=net/null,net/tap,net/virtio"
>  
>      # Install DPDK using prefix.
>      DPDK_OPTS="$DPDK_OPTS --prefix=$(pwd)/build"
> @@ -76,7 +80,8 @@ function install_dpdk()
>  
>      # Update the library paths.
>      sudo ldconfig
> -
> +    # Expose dpdk binaries.
> +    export PATH=$(pwd)/build/bin:$PATH
>  
>      echo "Installed DPDK source in $(pwd)"
>      popd
> @@ -163,7 +168,7 @@ fi
>  
>  OPTS="${EXTRA_OPTS} ${OPTS} $*"
>  
> -if [ "$TESTSUITE" ]; then
> +if [ "$TESTSUITE" = 'test' ]; then
>      # 'distcheck' will reconfigure with required options.
>      # Now we only need to prepare the Makefile without sparse-wrapped CC.
>      configure_ovs
> @@ -173,6 +178,15 @@ if [ "$TESTSUITE" ]; then
>          TESTSUITEFLAGS=-j4 RECHECK=yes
>  else
>      build_ovs
> +    if [ -n "$TESTSUITE" ]; then
> +        if [ "${TESTSUITE##*dpdk}" != "$TESTSUITE" ]; then
> +            sudo sh -c 'echo 1024 > /proc/sys/vm/nr_hugepages' || true
> +            [ "$(cat /proc/sys/vm/nr_hugepages)" = '1024' ]
> +            export DPDK_EAL_OPTIONS="--lcores 0@1,1@1,2@1"
> +        fi
> +        sudo -E PATH=$PATH make $TESTSUITE \
> +            TESTSUITEFLAGS=-j4 RECHECK=yes
> +    fi
>  fi
>  
>  exit 0
> diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml
> index 82675b9734..e5eeacd718 100644
> --- a/.github/workflows/build-and-test.yml
> +++ b/.github/workflows/build-and-test.yml
> @@ -49,10 +49,10 @@ jobs:
>              opts:         --enable-shared
>  
>            - compiler:     gcc
> -            testsuite:    test
> +            testsuite:    check-dpdk
>              dpdk:         dpdk
>            - compiler:     clang
> -            testsuite:    test
> +            testsuite:    check-dpdk

The point of these tests was to run a full suite with a different
implementation of dp_packet.  I'm afraid, this change actually
reduces the coverage.

>              dpdk:         dpdk
>  
>            - compiler:     gcc
> @@ -152,7 +152,8 @@ jobs:
>          mkdir logs
>          cp config.log ./logs/
>          cp -r ./*/_build/sub/tests/testsuite.* ./logs/ || true
> -        tar -czvf logs.tgz logs/
> +        sudo cp -r ./tests/*testsuite.* ./logs/ || true
> +        sudo tar -czvf logs.tgz logs/
>  
>      - name: upload logs on failure
>        if: failure() || cancelled()
> diff --git a/tests/system-dpdk-macros.at b/tests/system-dpdk-macros.at
> index 9f13f8ec20..0715f2f5cf 100644
> --- a/tests/system-dpdk-macros.at
> +++ b/tests/system-dpdk-macros.at
> @@ -90,7 +90,7 @@ m4_define([OVS_DPDK_CHECK_TESTPMD],
>  # Start dpdk-testpmd in background.
>  #
>  m4_define([OVS_DPDK_START_TESTPMD],
> -  [eal_options="--in-memory --single-file-segments --no-pci"
> +  [eal_options="$DPDK_EAL_OPTIONS --in-memory --single-file-segments --no-pci"
>     options="$@"
>     [ "$options" != "${options%% -- *}" ] || options="$options -- "
>     eal_options="$eal_options ${options%% -- *}"
Ilya Maximets Jan. 27, 2023, 11:15 a.m. UTC | #4
On 1/27/23 11:29, David Marchand wrote:
> On Thu, Jan 26, 2023 at 11:30 PM Aaron Conole <aconole@redhat.com> wrote:
>>
>> David Marchand <david.marchand@redhat.com> writes:
>>
>>> Let's enhance our coverage in the CI and run DPDK system tests.
>>>
>>> A few DPDK drivers are enabled in DPDK compilation.
>>>
>>> Put DPDK build in $PATH for dpdk-testpmd to be available.
>>> sudo drops PATH= updates and -E does not seem to preserve this variable.
>>> Pass PATH=$PATH when running the tests, as a workaround.
>>> Since those tests are run as root, the collection of logs is updated
>>> accordingly.
>>>
>>> In GHA, only two cores are available but some test rely on testpmd using
>>> three lcores.
>>> Add a DPDK_EAL_OPTIONS environment variable and use it to map all
>>> testpmd lcores to core 1 (and leave core 0 alone for OVS).
>>>
>>> Signed-off-by: David Marchand <david.marchand@redhat.com>
>>> ---
>>
>> Nice - I even checked some of the results on github actions.
>>
>> I guess our next steps should be to try and get some kind of
>> coveralls.io / cobertura like solution so that we can read a fancy
>> report of the code we have actually tested with the suites.
> 
> It seems to be a nice tool.
> I am just a bit cautious as it is yet again a tool "free for
> opensource projects" (for now? :-)).
> 
> 
>>
>> I did a quick look, and there are some github actions that will sortof
>> do the trick - but needs more research.
>>
>> Meanwhile,
>>
>> Acked-by: Aaron Conole <aconole@redhat.com>
>>
> 
> Another thing to enhance coverage, I was thinking of adding
> system-traffic as part of the system-dpdk testsuite.
> I did a small PoC that hacks ADD_VETH and uses net/tap DPDK driver:
> one "side" of the veth is the tap netdev, the other "side" is a DPDK
> port plugged in OVS bridge.
> 
> I am considering adding this for v2... :-).
> Thoughts?

The main concern is that system tests are slow and not particularly stable.
Not sure how much time they will actually take in GHA.

Best regards, Ilya Maximets.
David Marchand Feb. 2, 2023, 12:29 p.m. UTC | #5
On Fri, Jan 27, 2023 at 12:13 PM Ilya Maximets <i.maximets@ovn.org> wrote:
>
> On 1/23/23 13:14, David Marchand wrote:
> > Let's enhance our coverage in the CI and run DPDK system tests.
> >
> > A few DPDK drivers are enabled in DPDK compilation.
> >
> > Put DPDK build in $PATH for dpdk-testpmd to be available.
> > sudo drops PATH= updates and -E does not seem to preserve this variable.
> > Pass PATH=$PATH when running the tests, as a workaround.
> > Since those tests are run as root, the collection of logs is updated
> > accordingly.
> >
> > In GHA, only two cores are available but some test rely on testpmd using
> > three lcores.
> > Add a DPDK_EAL_OPTIONS environment variable and use it to map all
> > testpmd lcores to core 1 (and leave core 0 alone for OVS).
>
> This is a very tight packing.  In the past we had issues running tests
> when PMD threads didn't allow other threads to do their job causing
> test stalls and warnings/errors in logs.  Do you think it's not a problem
> for dpdk testsuite?

I would be interested in some examples about such issues.
I hit none while writing / testing this series.


>
> Maybe we should use Cirrus CI instead?  We can request more cores there.

That could be an option.


>
> >
> > Signed-off-by: David Marchand <david.marchand@redhat.com>
> > ---
> >  .ci/linux-build.sh                   | 22 ++++++++++++++++++----
> >  .github/workflows/build-and-test.yml |  7 ++++---
> >  tests/system-dpdk-macros.at          |  2 +-
> >  3 files changed, 23 insertions(+), 8 deletions(-)
> >
> > diff --git a/.ci/linux-build.sh b/.ci/linux-build.sh
> > index 10021fddb2..c9937103fa 100755
> > --- a/.ci/linux-build.sh
> > +++ b/.ci/linux-build.sh
> > @@ -38,6 +38,8 @@ function install_dpdk()
> >              if [ "${VER}" = "${DPDK_VER}" ]; then
> >                  # Update the library paths.
> >                  sudo ldconfig
> > +                # Expose dpdk binaries.
> > +                export PATH=$(pwd)/dpdk-dir/build/bin:$PATH
> >                  echo "Found cached DPDK ${VER} build in $(pwd)/dpdk-dir"
> >                  return
> >              fi
> > @@ -64,8 +66,10 @@ function install_dpdk()
> >
> >      # OVS compilation and "normal" unit tests (run in the CI) do not depend on
> >      # any DPDK driver being present.
> > -    # We can disable all drivers to save compilation time.
> > -    DPDK_OPTS="$DPDK_OPTS -Ddisable_drivers=*/*"
> > +    # check-dpdk unit tests requires testpmd and some net/ driver.
> > +    # We can disable all drivers but them, in order to save compilation time.
> > +    DPDK_OPTS="$DPDK_OPTS -Denable_apps=test-pmd"
> > +    DPDK_OPTS="$DPDK_OPTS -Denable_drivers=net/null,net/tap,net/virtio"
> >
> >      # Install DPDK using prefix.
> >      DPDK_OPTS="$DPDK_OPTS --prefix=$(pwd)/build"
> > @@ -76,7 +80,8 @@ function install_dpdk()
> >
> >      # Update the library paths.
> >      sudo ldconfig
> > -
> > +    # Expose dpdk binaries.
> > +    export PATH=$(pwd)/build/bin:$PATH
> >
> >      echo "Installed DPDK source in $(pwd)"
> >      popd
> > @@ -163,7 +168,7 @@ fi
> >
> >  OPTS="${EXTRA_OPTS} ${OPTS} $*"
> >
> > -if [ "$TESTSUITE" ]; then
> > +if [ "$TESTSUITE" = 'test' ]; then
> >      # 'distcheck' will reconfigure with required options.
> >      # Now we only need to prepare the Makefile without sparse-wrapped CC.
> >      configure_ovs
> > @@ -173,6 +178,15 @@ if [ "$TESTSUITE" ]; then
> >          TESTSUITEFLAGS=-j4 RECHECK=yes
> >  else
> >      build_ovs
> > +    if [ -n "$TESTSUITE" ]; then
> > +        if [ "${TESTSUITE##*dpdk}" != "$TESTSUITE" ]; then
> > +            sudo sh -c 'echo 1024 > /proc/sys/vm/nr_hugepages' || true
> > +            [ "$(cat /proc/sys/vm/nr_hugepages)" = '1024' ]
> > +            export DPDK_EAL_OPTIONS="--lcores 0@1,1@1,2@1"
> > +        fi
> > +        sudo -E PATH=$PATH make $TESTSUITE \
> > +            TESTSUITEFLAGS=-j4 RECHECK=yes
> > +    fi
> >  fi
> >
> >  exit 0
> > diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml
> > index 82675b9734..e5eeacd718 100644
> > --- a/.github/workflows/build-and-test.yml
> > +++ b/.github/workflows/build-and-test.yml
> > @@ -49,10 +49,10 @@ jobs:
> >              opts:         --enable-shared
> >
> >            - compiler:     gcc
> > -            testsuite:    test
> > +            testsuite:    check-dpdk
> >              dpdk:         dpdk
> >            - compiler:     clang
> > -            testsuite:    test
> > +            testsuite:    check-dpdk
>
> The point of these tests was to run a full suite with a different
> implementation of dp_packet.  I'm afraid, this change actually
> reduces the coverage.

Ok, I had neglicted the change in dp-packet layout.

I can restore running the normal "check" and add "check-dpdk" after it.
Though, we would lose the distributions check part (I tried but failed
to hook check-dpdk into make distcheck).


>
> >              dpdk:         dpdk
> >
> >            - compiler:     gcc
> > @@ -152,7 +152,8 @@ jobs:
> >          mkdir logs
> >          cp config.log ./logs/
> >          cp -r ./*/_build/sub/tests/testsuite.* ./logs/ || true
> > -        tar -czvf logs.tgz logs/
> > +        sudo cp -r ./tests/*testsuite.* ./logs/ || true
> > +        sudo tar -czvf logs.tgz logs/
> >
> >      - name: upload logs on failure
> >        if: failure() || cancelled()
> > diff --git a/tests/system-dpdk-macros.at b/tests/system-dpdk-macros.at
> > index 9f13f8ec20..0715f2f5cf 100644
> > --- a/tests/system-dpdk-macros.at
> > +++ b/tests/system-dpdk-macros.at
> > @@ -90,7 +90,7 @@ m4_define([OVS_DPDK_CHECK_TESTPMD],
> >  # Start dpdk-testpmd in background.
> >  #
> >  m4_define([OVS_DPDK_START_TESTPMD],
> > -  [eal_options="--in-memory --single-file-segments --no-pci"
> > +  [eal_options="$DPDK_EAL_OPTIONS --in-memory --single-file-segments --no-pci"
> >     options="$@"
> >     [ "$options" != "${options%% -- *}" ] || options="$options -- "
> >     eal_options="$eal_options ${options%% -- *}"
>
David Marchand Feb. 2, 2023, 12:38 p.m. UTC | #6
On Fri, Jan 27, 2023 at 12:15 PM Ilya Maximets <i.maximets@ovn.org> wrote:
>
> On 1/27/23 11:29, David Marchand wrote:
> > On Thu, Jan 26, 2023 at 11:30 PM Aaron Conole <aconole@redhat.com> wrote:
> >>
> >> David Marchand <david.marchand@redhat.com> writes:
> >>
> >>> Let's enhance our coverage in the CI and run DPDK system tests.
> >>>
> >>> A few DPDK drivers are enabled in DPDK compilation.
> >>>
> >>> Put DPDK build in $PATH for dpdk-testpmd to be available.
> >>> sudo drops PATH= updates and -E does not seem to preserve this variable.
> >>> Pass PATH=$PATH when running the tests, as a workaround.
> >>> Since those tests are run as root, the collection of logs is updated
> >>> accordingly.
> >>>
> >>> In GHA, only two cores are available but some test rely on testpmd using
> >>> three lcores.
> >>> Add a DPDK_EAL_OPTIONS environment variable and use it to map all
> >>> testpmd lcores to core 1 (and leave core 0 alone for OVS).
> >>>
> >>> Signed-off-by: David Marchand <david.marchand@redhat.com>
> >>> ---
> >>
> >> Nice - I even checked some of the results on github actions.
> >>
> >> I guess our next steps should be to try and get some kind of
> >> coveralls.io / cobertura like solution so that we can read a fancy
> >> report of the code we have actually tested with the suites.
> >
> > It seems to be a nice tool.
> > I am just a bit cautious as it is yet again a tool "free for
> > opensource projects" (for now? :-)).
> >
> >
> >>
> >> I did a quick look, and there are some github actions that will sortof
> >> do the trick - but needs more research.
> >>
> >> Meanwhile,
> >>
> >> Acked-by: Aaron Conole <aconole@redhat.com>
> >>
> >
> > Another thing to enhance coverage, I was thinking of adding
> > system-traffic as part of the system-dpdk testsuite.
> > I did a small PoC that hacks ADD_VETH and uses net/tap DPDK driver:
> > one "side" of the veth is the tap netdev, the other "side" is a DPDK
> > port plugged in OVS bridge.
> >
> > I am considering adding this for v2... :-).
> > Thoughts?
>
> The main concern is that system tests are slow and not particularly stable.
> Not sure how much time they will actually take in GHA.

If they are unstable, that's a bug (and I can see Eelco has been
working on fixing a few).

As for the time it takes, a build + check-dpdk with system-traffic.at
in my PoC takes 10-15 minutes.
I would have to retest once I restore the "normal" testsuite as part
of the dpdk jobs.
Aaron Conole Feb. 2, 2023, 3:10 p.m. UTC | #7
Ilya Maximets <i.maximets@ovn.org> writes:

> On 1/23/23 13:14, David Marchand wrote:
>> Let's enhance our coverage in the CI and run DPDK system tests.
>> 
>> A few DPDK drivers are enabled in DPDK compilation.
>> 
>> Put DPDK build in $PATH for dpdk-testpmd to be available.
>> sudo drops PATH= updates and -E does not seem to preserve this variable.
>> Pass PATH=$PATH when running the tests, as a workaround.
>> Since those tests are run as root, the collection of logs is updated
>> accordingly.
>> 
>> In GHA, only two cores are available but some test rely on testpmd using
>> three lcores.
>> Add a DPDK_EAL_OPTIONS environment variable and use it to map all
>> testpmd lcores to core 1 (and leave core 0 alone for OVS).
>
> This is a very tight packing.  In the past we had issues running tests
> when PMD threads didn't allow other threads to do their job causing
> test stalls and warnings/errors in logs.  Do you think it's not a problem
> for dpdk testsuite?

I seem to remember this issue - but I think it was something that was
specific to travis-ci?  I don't recall the exact details - it was a very
long time ago.  If we hit such case we can probably investigate it.

> Maybe we should use Cirrus CI instead?  We can request more cores there.
>
>> 
>> Signed-off-by: David Marchand <david.marchand@redhat.com>
>> ---
>>  .ci/linux-build.sh                   | 22 ++++++++++++++++++----
>>  .github/workflows/build-and-test.yml |  7 ++++---
>>  tests/system-dpdk-macros.at          |  2 +-
>>  3 files changed, 23 insertions(+), 8 deletions(-)
>> 
>> diff --git a/.ci/linux-build.sh b/.ci/linux-build.sh
>> index 10021fddb2..c9937103fa 100755
>> --- a/.ci/linux-build.sh
>> +++ b/.ci/linux-build.sh
>> @@ -38,6 +38,8 @@ function install_dpdk()
>>              if [ "${VER}" = "${DPDK_VER}" ]; then
>>                  # Update the library paths.
>>                  sudo ldconfig
>> +                # Expose dpdk binaries.
>> +                export PATH=$(pwd)/dpdk-dir/build/bin:$PATH
>>                  echo "Found cached DPDK ${VER} build in $(pwd)/dpdk-dir"
>>                  return
>>              fi
>> @@ -64,8 +66,10 @@ function install_dpdk()
>>  
>>      # OVS compilation and "normal" unit tests (run in the CI) do not depend on
>>      # any DPDK driver being present.
>> -    # We can disable all drivers to save compilation time.
>> -    DPDK_OPTS="$DPDK_OPTS -Ddisable_drivers=*/*"
>> +    # check-dpdk unit tests requires testpmd and some net/ driver.
>> +    # We can disable all drivers but them, in order to save compilation time.
>> +    DPDK_OPTS="$DPDK_OPTS -Denable_apps=test-pmd"
>> +    DPDK_OPTS="$DPDK_OPTS -Denable_drivers=net/null,net/tap,net/virtio"
>>  
>>      # Install DPDK using prefix.
>>      DPDK_OPTS="$DPDK_OPTS --prefix=$(pwd)/build"
>> @@ -76,7 +80,8 @@ function install_dpdk()
>>  
>>      # Update the library paths.
>>      sudo ldconfig
>> -
>> +    # Expose dpdk binaries.
>> +    export PATH=$(pwd)/build/bin:$PATH
>>  
>>      echo "Installed DPDK source in $(pwd)"
>>      popd
>> @@ -163,7 +168,7 @@ fi
>>  
>>  OPTS="${EXTRA_OPTS} ${OPTS} $*"
>>  
>> -if [ "$TESTSUITE" ]; then
>> +if [ "$TESTSUITE" = 'test' ]; then
>>      # 'distcheck' will reconfigure with required options.
>>      # Now we only need to prepare the Makefile without sparse-wrapped CC.
>>      configure_ovs
>> @@ -173,6 +178,15 @@ if [ "$TESTSUITE" ]; then
>>          TESTSUITEFLAGS=-j4 RECHECK=yes
>>  else
>>      build_ovs
>> +    if [ -n "$TESTSUITE" ]; then
>> +        if [ "${TESTSUITE##*dpdk}" != "$TESTSUITE" ]; then
>> +            sudo sh -c 'echo 1024 > /proc/sys/vm/nr_hugepages' || true
>> +            [ "$(cat /proc/sys/vm/nr_hugepages)" = '1024' ]
>> +            export DPDK_EAL_OPTIONS="--lcores 0@1,1@1,2@1"
>> +        fi
>> +        sudo -E PATH=$PATH make $TESTSUITE \
>> +            TESTSUITEFLAGS=-j4 RECHECK=yes
>> +    fi
>>  fi
>>  
>>  exit 0
>> diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml
>> index 82675b9734..e5eeacd718 100644
>> --- a/.github/workflows/build-and-test.yml
>> +++ b/.github/workflows/build-and-test.yml
>> @@ -49,10 +49,10 @@ jobs:
>>              opts:         --enable-shared
>>  
>>            - compiler:     gcc
>> -            testsuite:    test
>> +            testsuite:    check-dpdk
>>              dpdk:         dpdk
>>            - compiler:     clang
>> -            testsuite:    test
>> +            testsuite:    check-dpdk
>
> The point of these tests was to run a full suite with a different
> implementation of dp_packet.  I'm afraid, this change actually
> reduces the coverage.
>
>>              dpdk:         dpdk
>>  
>>            - compiler:     gcc
>> @@ -152,7 +152,8 @@ jobs:
>>          mkdir logs
>>          cp config.log ./logs/
>>          cp -r ./*/_build/sub/tests/testsuite.* ./logs/ || true
>> -        tar -czvf logs.tgz logs/
>> +        sudo cp -r ./tests/*testsuite.* ./logs/ || true
>> +        sudo tar -czvf logs.tgz logs/
>>  
>>      - name: upload logs on failure
>>        if: failure() || cancelled()
>> diff --git a/tests/system-dpdk-macros.at b/tests/system-dpdk-macros.at
>> index 9f13f8ec20..0715f2f5cf 100644
>> --- a/tests/system-dpdk-macros.at
>> +++ b/tests/system-dpdk-macros.at
>> @@ -90,7 +90,7 @@ m4_define([OVS_DPDK_CHECK_TESTPMD],
>>  # Start dpdk-testpmd in background.
>>  #
>>  m4_define([OVS_DPDK_START_TESTPMD],
>> -  [eal_options="--in-memory --single-file-segments --no-pci"
>> +  [eal_options="$DPDK_EAL_OPTIONS --in-memory --single-file-segments --no-pci"
>>     options="$@"
>>     [ "$options" != "${options%% -- *}" ] || options="$options -- "
>>     eal_options="$eal_options ${options%% -- *}"
diff mbox series

Patch

diff --git a/.ci/linux-build.sh b/.ci/linux-build.sh
index 10021fddb2..c9937103fa 100755
--- a/.ci/linux-build.sh
+++ b/.ci/linux-build.sh
@@ -38,6 +38,8 @@  function install_dpdk()
             if [ "${VER}" = "${DPDK_VER}" ]; then
                 # Update the library paths.
                 sudo ldconfig
+                # Expose dpdk binaries.
+                export PATH=$(pwd)/dpdk-dir/build/bin:$PATH
                 echo "Found cached DPDK ${VER} build in $(pwd)/dpdk-dir"
                 return
             fi
@@ -64,8 +66,10 @@  function install_dpdk()
 
     # OVS compilation and "normal" unit tests (run in the CI) do not depend on
     # any DPDK driver being present.
-    # We can disable all drivers to save compilation time.
-    DPDK_OPTS="$DPDK_OPTS -Ddisable_drivers=*/*"
+    # check-dpdk unit tests requires testpmd and some net/ driver.
+    # We can disable all drivers but them, in order to save compilation time.
+    DPDK_OPTS="$DPDK_OPTS -Denable_apps=test-pmd"
+    DPDK_OPTS="$DPDK_OPTS -Denable_drivers=net/null,net/tap,net/virtio"
 
     # Install DPDK using prefix.
     DPDK_OPTS="$DPDK_OPTS --prefix=$(pwd)/build"
@@ -76,7 +80,8 @@  function install_dpdk()
 
     # Update the library paths.
     sudo ldconfig
-
+    # Expose dpdk binaries.
+    export PATH=$(pwd)/build/bin:$PATH
 
     echo "Installed DPDK source in $(pwd)"
     popd
@@ -163,7 +168,7 @@  fi
 
 OPTS="${EXTRA_OPTS} ${OPTS} $*"
 
-if [ "$TESTSUITE" ]; then
+if [ "$TESTSUITE" = 'test' ]; then
     # 'distcheck' will reconfigure with required options.
     # Now we only need to prepare the Makefile without sparse-wrapped CC.
     configure_ovs
@@ -173,6 +178,15 @@  if [ "$TESTSUITE" ]; then
         TESTSUITEFLAGS=-j4 RECHECK=yes
 else
     build_ovs
+    if [ -n "$TESTSUITE" ]; then
+        if [ "${TESTSUITE##*dpdk}" != "$TESTSUITE" ]; then
+            sudo sh -c 'echo 1024 > /proc/sys/vm/nr_hugepages' || true
+            [ "$(cat /proc/sys/vm/nr_hugepages)" = '1024' ]
+            export DPDK_EAL_OPTIONS="--lcores 0@1,1@1,2@1"
+        fi
+        sudo -E PATH=$PATH make $TESTSUITE \
+            TESTSUITEFLAGS=-j4 RECHECK=yes
+    fi
 fi
 
 exit 0
diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml
index 82675b9734..e5eeacd718 100644
--- a/.github/workflows/build-and-test.yml
+++ b/.github/workflows/build-and-test.yml
@@ -49,10 +49,10 @@  jobs:
             opts:         --enable-shared
 
           - compiler:     gcc
-            testsuite:    test
+            testsuite:    check-dpdk
             dpdk:         dpdk
           - compiler:     clang
-            testsuite:    test
+            testsuite:    check-dpdk
             dpdk:         dpdk
 
           - compiler:     gcc
@@ -152,7 +152,8 @@  jobs:
         mkdir logs
         cp config.log ./logs/
         cp -r ./*/_build/sub/tests/testsuite.* ./logs/ || true
-        tar -czvf logs.tgz logs/
+        sudo cp -r ./tests/*testsuite.* ./logs/ || true
+        sudo tar -czvf logs.tgz logs/
 
     - name: upload logs on failure
       if: failure() || cancelled()
diff --git a/tests/system-dpdk-macros.at b/tests/system-dpdk-macros.at
index 9f13f8ec20..0715f2f5cf 100644
--- a/tests/system-dpdk-macros.at
+++ b/tests/system-dpdk-macros.at
@@ -90,7 +90,7 @@  m4_define([OVS_DPDK_CHECK_TESTPMD],
 # Start dpdk-testpmd in background.
 #
 m4_define([OVS_DPDK_START_TESTPMD],
-  [eal_options="--in-memory --single-file-segments --no-pci"
+  [eal_options="$DPDK_EAL_OPTIONS --in-memory --single-file-segments --no-pci"
    options="$@"
    [ "$options" != "${options%% -- *}" ] || options="$options -- "
    eal_options="$eal_options ${options%% -- *}"