> -----Original Message-----
> From: Richardson, Bruce <[email protected]>
> Sent: Thursday, July 2, 2020 7:29 PM
> To: Pai G, Sunil <[email protected]>; [email protected]
> Cc: Stokes, Ian <[email protected]>; [email protected];
> [email protected]; Tummala, Sivaprasad
> <[email protected]>
> Subject: RE: [PATCH RFC dpdk-latest] build: Add support for DPDK meson build.
> 
> 
> 
> > -----Original Message-----
> > From: Pai G, Sunil <[email protected]>
> > Sent: Thursday, July 2, 2020 2:14 PM
> > To: [email protected]
> > Cc: Stokes, Ian <[email protected]>; [email protected];
> > [email protected]; Richardson, Bruce
> > <[email protected]>; Pai G, Sunil <[email protected]>;
> > Tummala, Sivaprasad <[email protected]>
> > Subject: [PATCH RFC dpdk-latest] build: Add support for DPDK meson build.
> >
> > Make based build is deprecated in DPDK. Meson based build to be used
> > for future DPDK releases.
> >
> > This updates travis, configure script and documentation for using DPDK
> > Meson with OVS.
> >
> > Signed-off-by: Sunil Pai G <[email protected]>
> 
> Thanks for this, a couple of comments from the DPDK build side inline below.
> 
> Regards,
> /Bruce
> 
> > ---
> >  .travis.yml                           |  3 ++
> >  .travis/linux-build.sh                | 37 +++++++++-------
> >  .travis/linux-prepare.sh              |  1 +
> >  Documentation/intro/install/afxdp.rst |  2 +-
> > Documentation/intro/install/dpdk.rst  | 56 ++++++++++++++++++++----
> >  Makefile.am                           |  3 +-
> >  acinclude.m4                          | 42 ++++++++++++------
> >  parse_pkg_cfg.py                      | 62 +++++++++++++++++++++++++++
> >  8 files changed, 167 insertions(+), 39 deletions(-)  create mode
> > 100644 parse_pkg_cfg.py
> >
> > diff --git a/.travis.yml b/.travis.yml index 97249c1ce..46d7ad9bb
> > 100644
> > --- a/.travis.yml
> > +++ b/.travis.yml
> > @@ -27,6 +27,9 @@ addons:
> >        - selinux-policy-dev
> >        - libunbound-dev
> >        - libunwind-dev
> > +      - python3-setuptools
> > +      - python3-wheel
> > +      - ninja-build
> >
> >  before_install: ./.travis/${TRAVIS_OS_NAME}-prepare.sh
> >
> > diff --git a/.travis/linux-build.sh b/.travis/linux-build.sh index
> > 33b359a61..7fa7e738c 100755
> > --- a/.travis/linux-build.sh
> > +++ b/.travis/linux-build.sh
> > @@ -85,17 +85,21 @@ function install_dpdk()  {
> >      local DPDK_VER=$1
> >      local VERSION_FILE="dpdk-dir/travis-dpdk-cache-version"
> > +    local DPDK_OPTS=""
> >
> > -    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
> > +    if [ "$TRAVIS_ARCH" == "aarch64" ]; then
> > +        DPDK_OPTS="$DPDK_OPTS --cross-file
> > config/arm/arm64_armv8_linux_gcc"
> > +    elif [ "$TRAVIS_ARCH" != "amd64" ] && [ -n "$TRAVIS_ARCH" ]; then
> >          echo "Target is unknown"
> >          exit 1
> >      fi
> >
> > +    if [ "$DPDK_SHARED" ]; then
> > +        EXTRA_OPTS="$EXTRA_OPTS --with-dpdk=shared"
> > +    else
> > +        EXTRA_OPTS="$EXTRA_OPTS --with-dpdk=static"
> > +    fi
> > +
> >      if [ "${DPDK_VER##refs/*/}" != "${DPDK_VER}" ]; then
> >          # Avoid using cache for git tree build.
> >          rm -rf dpdk-dir
> > @@ -108,7 +112,8 @@ function install_dpdk()
> >          if [ -f "${VERSION_FILE}" ]; then
> >              VER=$(cat ${VERSION_FILE})
> >              if [ "${VER}" = "${DPDK_VER}" ]; then
> > -                EXTRA_OPTS="${EXTRA_OPTS} --with-dpdk=$(pwd)/dpdk-
> > dir/build"
> > +                sudo ninja -C $(pwd)/dpdk-dir/build install
> > +                sudo ldconfig
> >                  echo "Found cached DPDK ${VER} build in $(pwd)/dpdk-dir"
> >                  return
> >              fi
> > @@ -122,16 +127,18 @@ function install_dpdk()
> >          pushd dpdk-dir
> >      fi
> >
> > -    make config CC=gcc T=$TARGET
> > +    # Disable building DPDK kernel modules. Not needed for OVS build
> > + or
> > tests.
> > +    DPDK_OPTS="$DPDK_OPTS -Denable_kmods=false"
> >
> 
> NOTE: enable_kmods=false is the default in DPDK, so should not need to be
> specified, unless you want to be doubly sure they are not build, or for 
> clarity.

Understood. Shall address this in the next version.

> 
> > -    if [ "$DPDK_SHARED" ]; then
> > -        sed -i '/CONFIG_RTE_BUILD_SHARED_LIB=n/s/=n/=y/' build/.config
> > -        export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$(pwd)/$TARGET/lib
> > -    fi
> > +    DPDK_OPTS="$DPDK_OPTS -Dc_args=-fPIC"
> 
> Since meson build for DPDK always links the objects into both static and 
> shared
> libs, all objects are already built with -fPIC, so this should not be 
> necessary.

Sure , will address this in the next patch as well.

> > +    CC=gcc meson $DPDK_OPTS build
> > +    ninja -C build
> > +    sudo ninja -C build install
> > +
> > +    # Update the library paths.
> > +    sudo ldconfig
> >
> > -    make -j4 CC=gcc EXTRA_CFLAGS='-fPIC'
> > -    EXTRA_OPTS="$EXTRA_OPTS --with-dpdk=$(pwd)/build"
> > -    echo "Installed DPDK source in $(pwd)"
> > +    echo "Installed DPDK source"
> >      popd
> >      echo "${DPDK_VER}" > ${VERSION_FILE}  } diff --git
> > a/.travis/linux- prepare.sh b/.travis/linux-prepare.sh index
> > 8cbbd5623..682f6234b 100755
> > --- a/.travis/linux-prepare.sh
> > +++ b/.travis/linux-prepare.sh
> > @@ -16,6 +16,7 @@ cd ..
> >
> >  pip3 install --disable-pip-version-check --user flake8 hacking
> >  pip3 install --user --upgrade docutils
> > +pip3 install --user  'meson==0.47.1'
> >
> 
> Is there a reason for forcing this to the oldest supported version?

Yes , quoting David's commit message from DPDK travis, 
which is a concise explanation of why (Thanks David! :)):
"
    meson 0.53.0 has a compatibility issue [1] with the python 3.5.2 that comes
    in Ubuntu 16.04.
    On the other hand, the minimal version supported in dpdk is 0.47.1.

    Stick to this version to avoid getting hit by regressions in meson latest
    shiny release.

    1: https://github.com/mesonbuild/meson/issues/6427
"

> 
> >  if [ "$M32" ]; then
> >      # Installing 32-bit libraries.
> <snip for brevity>

Hi Bruce , Thank you for the review.
Please find my response inline.
Thanks and regards,
Sunil

_______________________________________________
dev mailing list
[email protected]
https://mail.openvswitch.org/mailman/listinfo/ovs-dev

Reply via email to