On 2016-04-15 22:55, Maxim Uvarov wrote:
> Add dpdk pktio compilation and run under native make check.

Great, this should be a new variable, because apply-and-build.sh should
be able to verify patches on the odp-dpdk project as well, see
explanation below [1].

> Huge pages have to be mounted:
> echo 1000 >  /proc/sys/vm/nr_hugepages
> mount -t hugetlbfs nodev /mnt/huge
> also no other mount points for hugepages, in my case I need to do:
> umount /sys/fs/cgroup/hugetlb

Either fail with an error if hugetlb is mounted, or do the above
automatically.  This should be runnable from f.ex. Lava, or from a
user-system with hugetlb already mounted. 
If hugetlb is already mounted, error out, as stated before.
Recommended to be placed in a helper script of some kind that is only
run from scripts requiring Huge Pages.

> 
> make check should pass without dpdk hardware and loaded dpdk modules
> using pcap PMD.
> 
> Signed-off-by: Maxim Uvarov <maxim.uva...@linaro.org>
> ---
>  apply-and-build.sh      |  7 +++----
>  helper/platform/generic | 16 +++++++++++++++-
>  2 files changed, 18 insertions(+), 5 deletions(-)
> 
> diff --git a/apply-and-build.sh b/apply-and-build.sh
> index 99f3d45..6168e29 100755
> --- a/apply-and-build.sh
> +++ b/apply-and-build.sh
> @@ -8,6 +8,7 @@ source ${ROOT_DIR}/helper/toolchain
>  source ${ROOT_DIR}/helper/openssl
>  source ${ROOT_DIR}/helper/cunit
>  
> +export PLATFORM=${PLATFORM:-linux-generic}
>  export GIT_BRANCH="${GIT_BRANCH:-master}"
>  export PATCH_DIR=${PATCH_DIR:-"$HOME/incoming"}
>  export CLEANUP="${CLEANUP:-1}"
> @@ -29,6 +30,7 @@ usage() {
>      tc_usage
>      cunit_usage
>      openssl_usage
> +    echo -e "\tPLATFORM=linux-generic\t export platfrom to tested platform"

Not needed, already printed below.

>      echo -e "\tPATCH_DIR:\t where to look for patches, default: 
> $HOME/incoming"
>      echo -e "\tCLEANUP:\t set to 0 to save *.log files, default: ${CLEANUP}"
>      echo -e "\tCHECKPATCH:\t set to 0 to disable checkpatch test, default: 
> ${CHECKPATCH}"
> @@ -36,7 +38,7 @@ usage() {
>      echo -e "\tPLATFORM:\t set platform, default: ${PLATFORM}"
>      echo -e "\tDRYRUN:\t\t set to 1 to enable a dryrun, default: ${DRYRUN}"
>      echo -e "\tENABLE_NETMAP:\t set to 1 to enable netmap build, default: 
> ${ENABLE_NETMAP}"
> -    echo -e "\tENABLE_DPDK:\t set to 1 to enable DPDK build, default: 0"
> +    echo -e "\tENABLE_DPDK:\t set to 1 to enable dpdk build, default: 
> ${ENABLE_DPDK}"

Why change this?
Default changes in when environment variables changes.

We should change this to maybe DEFAULT_VARIABLE=0 so we only specify
them once (f.ex., DEFAULT_ENABLE_DPDK=0).

Help text for ENABLE_DPDK should be added to generic_usage (in
helper/platform/generic) instead of here.

>      echo -e "\tNUM_CPUS:\t add parallel make, default: _NPROCESSORS_ONLN"
>      echo -e "\tFILE_EXT:\t supported extensions in patch file names, 
> default: ${FILE_EXT}"
>      echo -e "\tM32_ON_64:\t enable 32 bit builds on a 64 bit host, default: 
> 0"
> @@ -54,9 +56,6 @@ if [[ ${M32_ON_64} -eq 1 ]]; then
>      CUNIT_BUILD=1
>  fi
>  
> -PLATFORM=${PLATFORM:-linux-generic}
> -[[ ${ENABLE_DPDK} -eq 1 ]] && PLATFORM="linux-dpdk"
> -

[1] this invalidates checking of the odp-dpdk project.
This should only be set when you want to build the entire odp-dpdk
project, but not when you build linux-generic with dpdk-pktio.

>  display_os
>  
>  prepare_platform
> diff --git a/helper/platform/generic b/helper/platform/generic
> index 49ddd65..560e694 100644
> --- a/helper/platform/generic
> +++ b/helper/platform/generic
> @@ -1,6 +1,9 @@
>  [ -n "$GENERIC_PLATFORM_HELPER" ] && return || readonly 
> GENERIC_PLATFORM_HELPER=1
>  
>  export NETMAP_SRCDIR=${ROOT_DIR}/netmap
> +if [[ ${ENABLE_DPDK} -eq 1 ]]; then

This should be ENABLE_DPDK_PKTIO or something similar right?
Similar for all the places where you typed ENABLE_DPDK.

> +     . helper/platform/dpdk

Never use relative paths, and use source instead of "." please.


Cheers,
Anders
_______________________________________________
lng-odp mailing list
lng-odp@lists.linaro.org
https://lists.linaro.org/mailman/listinfo/lng-odp

Reply via email to