diff mbox

[ODP-CHECK,PATCHv2] odp-linux: add dpdk pktio testing

Message ID 1460750127-6119-1-git-send-email-maxim.uvarov@linaro.org
State New
Headers show

Commit Message

Maxim Uvarov April 15, 2016, 7:55 p.m. UTC
Add dpdk pktio compilation and run under native make check.
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

make check should pass without dpdk hardware and loaded dpdk modules
using pcap PMD.

Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
---
 apply-and-build.sh      |  7 +++----
 helper/platform/generic | 16 +++++++++++++++-
 2 files changed, 18 insertions(+), 5 deletions(-)

Comments

Anders Roxell April 23, 2016, 11:06 p.m. UTC | #1
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.uvarov@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
diff mbox

Patch

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"
     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}"
     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"
-
 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
+	. helper/platform/dpdk
+fi
 
 generic_usage() {
     echo -e "\tENABLE_NETMAP:\t enable build with netmap, default: ${ENABLE_NETMAP}"
@@ -14,6 +17,10 @@  generic_prepare() {
         export NETMAP_DIR=${NETMAP_SRCDIR}
         export CONFIGURE_FLAGS="${CONFIGURE_FLAGS} --with-netmap-path=${NETMAP_DIR}"
     fi
+
+    if [[ ${ENABLE_DPDK} -eq 1 ]]; then
+	export CONFIGURE_FLAGS="${CONFIGURE_FLAGS} --with-dpdk-path=${ROOT_DIR_DPDK}/x86_64-native-linuxapp-gcc"
+    fi
 }
 
 generic_get() {
@@ -26,14 +33,21 @@  generic_get() {
         git reset --hard $NETMAP_REV
         popd > /dev/null
     fi
+
+    if [[ ${ENABLE_DPDK} -eq 1 ]]; then
+	dpdk_get
+    fi
 }
 
 generic_build() {
-    :
+     if [[ ${ENABLE_DPDK} -eq 1 ]]; then
+	dpdk_build
+    fi
 }
 
 generic_cleanup() {
     rm -rf ${NETMAP_SRCDIR}
+    dpdk_cleanup
 }
 
 ## vim: set ft=sh sw=4 sts=4 et foldmethod=syntax : ##