[ovs-dev,v3] travis: Enable OvS Travis CI for arm.
diff mbox series

Message ID 1584604298-25962-1-git-send-email-Lance.Yang@arm.com
State New
Headers show
Series
  • [ovs-dev,v3] travis: Enable OvS Travis CI for arm.
Related show

Commit Message

Lance Yang March 19, 2020, 7:51 a.m. UTC
Enable part of travis jobs with gcc compiler for arm64 architecture

1. Add arm jobs into the matrix in .travis.yml configuration file
2. To enable OVS-DPDK jobs, set the build target according to
different CPU architectures
3. Temporarily disable sparse checker because of static code checking
failure on arm64

Considering the balance of the CI coverage and running time, some kernel
and DPDK jobs are removed from Arm CI. The running time increases around
by 7 minutes to 47 minutes in all.

Successful travis build jobs report:
https://travis-ci.org/github/yzyuestc/ovs/builds/663833478

Reviewed-by: Yanqin Wei <Yanqin.Wei@arm.com>
Reviewed-by: Ruifeng Wang <Ruifeng.Wang@arm.com>
Reviewed-by: JingZhao Ni <JingZhao.Ni@arm.com>
Reviewed-by: Gavin Hu <Gavin.Hu@arm.com>
Signed-off-by: Lance Yang <Lance.Yang@arm.com>
---
v3: 
   - Remove some kernel jobs: 4.18, 4.17, 4.16, 4.15, 4.14, and 4.3.
   - Remove one OvS-DPDK shared library job.
---
 .travis.yml            | 15 +++++++++++++++
 .travis/linux-build.sh | 16 ++++++++++++++--
 2 files changed, 29 insertions(+), 2 deletions(-)

Comments

Ilya Maximets March 23, 2020, 5:25 p.m. UTC | #1
On 3/19/20 8:51 AM, Lance Yang wrote:
> Enable part of travis jobs with gcc compiler for arm64 architecture
> 
> 1. Add arm jobs into the matrix in .travis.yml configuration file
> 2. To enable OVS-DPDK jobs, set the build target according to
> different CPU architectures
> 3. Temporarily disable sparse checker because of static code checking
> failure on arm64
> 
> Considering the balance of the CI coverage and running time, some kernel
> and DPDK jobs are removed from Arm CI. The running time increases around
> by 7 minutes to 47 minutes in all.
> 
> Successful travis build jobs report:
> https://travis-ci.org/github/yzyuestc/ovs/builds/663833478
> 
> Reviewed-by: Yanqin Wei <Yanqin.Wei@arm.com>
> Reviewed-by: Ruifeng Wang <Ruifeng.Wang@arm.com>
> Reviewed-by: JingZhao Ni <JingZhao.Ni@arm.com>
> Reviewed-by: Gavin Hu <Gavin.Hu@arm.com>
> Signed-off-by: Lance Yang <Lance.Yang@arm.com>
> ---
> v3: 
>    - Remove some kernel jobs: 4.18, 4.17, 4.16, 4.15, 4.14, and 4.3.
>    - Remove one OvS-DPDK shared library job.
> ---
>  .travis.yml            | 15 +++++++++++++++
>  .travis/linux-build.sh | 16 ++++++++++++++--
>  2 files changed, 29 insertions(+), 2 deletions(-)

This version seems OK.  We can give it a try.
Couple of minor comments inline.

> 
> diff --git a/.travis.yml b/.travis.yml
> index ef9f867..1149758 100644
> --- a/.travis.yml
> +++ b/.travis.yml
> @@ -51,6 +51,21 @@ matrix:
>      - os: osx
>        compiler: clang
>        env: OPTS="--disable-ssl"
> +    - arch: arm64
> +      compiler: gcc
> +      env: OPTS="--disable-ssl"
> +    - arch: arm64
> +      compiler: gcc
> +      env: KERNEL_LIST="5.5 4.19"
> +    - arch: arm64
> +      compiler: gcc
> +      env: KERNEL_LIST="4.9 3.16"
> +    - arch: arm64
> +      compiler: gcc
> +      env: DPDK=1 OPTS="--enable-shared"
> +    - arch: arm64
> +      compiler: gcc
> +      env: DPDK_SHARED=1
>  
>  script: ./.travis/${TRAVIS_OS_NAME}-build.sh $OPTS
>  
> diff --git a/.travis/linux-build.sh b/.travis/linux-build.sh
> index 359f777..3140ec9 100755
> --- a/.travis/linux-build.sh
> +++ b/.travis/linux-build.sh
> @@ -6,7 +6,7 @@ set -x
>  CFLAGS_FOR_OVS="-g -O2"
>  SPARSE_FLAGS=""
>  EXTRA_OPTS="--enable-Werror"
> -TARGET="x86_64-native-linuxapp-gcc"
> +TARGET=""

We could just remove this line.  We're not using it anywhere
beside install_dpdk().

>  
>  function install_kernel()
>  {
> @@ -87,6 +87,16 @@ function install_dpdk()
>      local DPDK_VER=$1
>      local VERSION_FILE="dpdk-dir/travis-dpdk-cache-version"
>  
> +    if [ -z "$TRAVIS_ARCH" ] ||
> +       [ "$TRAVIS_ARCH" == "amd64" ]; then
> +        TARGET="x86_64-native-linuxapp-gcc"
> +    elif [ "$TRAVIS_ARCH" == "aarch64" ]; then
> +        TARGET="arm64-armv8a-linuxapp-gcc"
> +    else
> +        echo "Target is unknown"
> +        exit 1
> +    fi
> +
>      if [ "${DPDK_VER##refs/*/}" != "${DPDK_VER}" ]; then
>          # Avoid using cache for git tree build.
>          rm -rf dpdk-dir
> @@ -178,7 +188,9 @@ elif [ "$M32" ]; then
>      # difference on 'configure' and 'make' stages.
>      export CC="$CC -m32"
>  else
> -    OPTS="--enable-sparse"
> +    if [ "$TRAVIS_ARCH" != "aarch64" ]; then
> +        OPTS="--enable-sparse"
> +    fi

This should be:

elif [ "$TRAVIS_ARCH" != "aarch64" ]; then
    OPTS="--enable-sparse"
    if [ "$AFXDP" ]; then
        ...

As we don't need to add SPARSE_FLAGS to CFLAGS_FOR_OVS if sparse is
not enabled.

Best regards, Ilya Maximets.
Lance Yang March 24, 2020, 7:07 a.m. UTC | #2
Hi Ilya,

Thanks for your comments. We applied your suggestions and sent patch v4. Please see the new patch.

Thanks for your time.

Best regards,
Lance Yang

> -----Original Message-----
> From: Ilya Maximets <i.maximets@ovn.org>
> Sent: Tuesday, March 24, 2020 1:25 AM
> To: Lance Yang <Lance.Yang@arm.com>; ovs-dev@openvswitch.org
> Cc: nd <nd@arm.com>; i.maximets@ovn.org; Yanqin Wei <Yanqin.Wei@arm.com>; Ruifeng
> Wang <Ruifeng.Wang@arm.com>; Gavin Hu <Gavin.Hu@arm.com>; i.maximets@ovn.org
> Subject: Re: [ovs-dev] [PATCH v3]travis: Enable OvS Travis CI for arm.
>
> On 3/19/20 8:51 AM, Lance Yang wrote:
> > Enable part of travis jobs with gcc compiler for arm64 architecture
> >
> > 1. Add arm jobs into the matrix in .travis.yml configuration file 2.
> > To enable OVS-DPDK jobs, set the build target according to different
> > CPU architectures 3. Temporarily disable sparse checker because of
> > static code checking failure on arm64
> >
> > Considering the balance of the CI coverage and running time, some
> > kernel and DPDK jobs are removed from Arm CI. The running time
> > increases around by 7 minutes to 47 minutes in all.
> >
> > Successful travis build jobs report:
> > https://travis-ci.org/github/yzyuestc/ovs/builds/663833478
> >
> > Reviewed-by: Yanqin Wei <Yanqin.Wei@arm.com>
> > Reviewed-by: Ruifeng Wang <Ruifeng.Wang@arm.com>
> > Reviewed-by: JingZhao Ni <JingZhao.Ni@arm.com>
> > Reviewed-by: Gavin Hu <Gavin.Hu@arm.com>
> > Signed-off-by: Lance Yang <Lance.Yang@arm.com>
> > ---
> > v3:
> >    - Remove some kernel jobs: 4.18, 4.17, 4.16, 4.15, 4.14, and 4.3.
> >    - Remove one OvS-DPDK shared library job.
> > ---
> >  .travis.yml            | 15 +++++++++++++++
> >  .travis/linux-build.sh | 16 ++++++++++++++--
> >  2 files changed, 29 insertions(+), 2 deletions(-)
>
> This version seems OK.  We can give it a try.
> Couple of minor comments inline.
>
> >
> > diff --git a/.travis.yml b/.travis.yml index ef9f867..1149758 100644
> > --- a/.travis.yml
> > +++ b/.travis.yml
> > @@ -51,6 +51,21 @@ matrix:
> >      - os: osx
> >        compiler: clang
> >        env: OPTS="--disable-ssl"
> > +    - arch: arm64
> > +      compiler: gcc
> > +      env: OPTS="--disable-ssl"
> > +    - arch: arm64
> > +      compiler: gcc
> > +      env: KERNEL_LIST="5.5 4.19"
> > +    - arch: arm64
> > +      compiler: gcc
> > +      env: KERNEL_LIST="4.9 3.16"
> > +    - arch: arm64
> > +      compiler: gcc
> > +      env: DPDK=1 OPTS="--enable-shared"
> > +    - arch: arm64
> > +      compiler: gcc
> > +      env: DPDK_SHARED=1
> >
> >  script: ./.travis/${TRAVIS_OS_NAME}-build.sh $OPTS
> >
> > diff --git a/.travis/linux-build.sh b/.travis/linux-build.sh index
> > 359f777..3140ec9 100755
> > --- a/.travis/linux-build.sh
> > +++ b/.travis/linux-build.sh
> > @@ -6,7 +6,7 @@ set -x
> >  CFLAGS_FOR_OVS="-g -O2"
> >  SPARSE_FLAGS=""
> >  EXTRA_OPTS="--enable-Werror"
> > -TARGET="x86_64-native-linuxapp-gcc"
> > +TARGET=""
>
> We could just remove this line.  We're not using it anywhere beside install_dpdk().
>
> >
> >  function install_kernel()
> >  {
> > @@ -87,6 +87,16 @@ function install_dpdk()
> >      local DPDK_VER=$1
> >      local VERSION_FILE="dpdk-dir/travis-dpdk-cache-version"
> >
> > +    if [ -z "$TRAVIS_ARCH" ] ||
> > +       [ "$TRAVIS_ARCH" == "amd64" ]; then
> > +        TARGET="x86_64-native-linuxapp-gcc"
> > +    elif [ "$TRAVIS_ARCH" == "aarch64" ]; then
> > +        TARGET="arm64-armv8a-linuxapp-gcc"
> > +    else
> > +        echo "Target is unknown"
> > +        exit 1
> > +    fi
> > +
> >      if [ "${DPDK_VER##refs/*/}" != "${DPDK_VER}" ]; then
> >          # Avoid using cache for git tree build.
> >          rm -rf dpdk-dir
> > @@ -178,7 +188,9 @@ elif [ "$M32" ]; then
> >      # difference on 'configure' and 'make' stages.
> >      export CC="$CC -m32"
> >  else
> > -    OPTS="--enable-sparse"
> > +    if [ "$TRAVIS_ARCH" != "aarch64" ]; then
> > +        OPTS="--enable-sparse"
> > +    fi
>
> This should be:
>
> elif [ "$TRAVIS_ARCH" != "aarch64" ]; then
>     OPTS="--enable-sparse"
>     if [ "$AFXDP" ]; then
>         ...
>
> As we don't need to add SPARSE_FLAGS to CFLAGS_FOR_OVS if sparse is not enabled.
>
> Best regards, Ilya Maximets.
IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Thank you.

Patch
diff mbox series

diff --git a/.travis.yml b/.travis.yml
index ef9f867..1149758 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -51,6 +51,21 @@  matrix:
     - os: osx
       compiler: clang
       env: OPTS="--disable-ssl"
+    - arch: arm64
+      compiler: gcc
+      env: OPTS="--disable-ssl"
+    - arch: arm64
+      compiler: gcc
+      env: KERNEL_LIST="5.5 4.19"
+    - arch: arm64
+      compiler: gcc
+      env: KERNEL_LIST="4.9 3.16"
+    - arch: arm64
+      compiler: gcc
+      env: DPDK=1 OPTS="--enable-shared"
+    - arch: arm64
+      compiler: gcc
+      env: DPDK_SHARED=1
 
 script: ./.travis/${TRAVIS_OS_NAME}-build.sh $OPTS
 
diff --git a/.travis/linux-build.sh b/.travis/linux-build.sh
index 359f777..3140ec9 100755
--- a/.travis/linux-build.sh
+++ b/.travis/linux-build.sh
@@ -6,7 +6,7 @@  set -x
 CFLAGS_FOR_OVS="-g -O2"
 SPARSE_FLAGS=""
 EXTRA_OPTS="--enable-Werror"
-TARGET="x86_64-native-linuxapp-gcc"
+TARGET=""
 
 function install_kernel()
 {
@@ -87,6 +87,16 @@  function install_dpdk()
     local DPDK_VER=$1
     local VERSION_FILE="dpdk-dir/travis-dpdk-cache-version"
 
+    if [ -z "$TRAVIS_ARCH" ] ||
+       [ "$TRAVIS_ARCH" == "amd64" ]; then
+        TARGET="x86_64-native-linuxapp-gcc"
+    elif [ "$TRAVIS_ARCH" == "aarch64" ]; then
+        TARGET="arm64-armv8a-linuxapp-gcc"
+    else
+        echo "Target is unknown"
+        exit 1
+    fi
+
     if [ "${DPDK_VER##refs/*/}" != "${DPDK_VER}" ]; then
         # Avoid using cache for git tree build.
         rm -rf dpdk-dir
@@ -178,7 +188,9 @@  elif [ "$M32" ]; then
     # difference on 'configure' and 'make' stages.
     export CC="$CC -m32"
 else
-    OPTS="--enable-sparse"
+    if [ "$TRAVIS_ARCH" != "aarch64" ]; then
+        OPTS="--enable-sparse"
+    fi
     if [ "$AFXDP" ]; then
         # netdev-afxdp uses memset for 64M for umem initialization.
         SPARSE_FLAGS="${SPARSE_FLAGS} -Wno-memcpy-max-count"