Hello Matias,
for me that test fails for some reason:
EAL: Ask a virtual area of 0x200000 bytes
EAL: Virtual area found at 0x2b581c800000 (size = 0x200000)
EAL: Ask a virtual area of 0x200000 bytes
EAL: Virtual area found at 0x2b581ca00000 (size = 0x200000)
EAL: Ask a virtual area of 0x200000 bytes
EAL: Virtual area found at 0x2b581cc00000 (size = 0x200000)
EAL: Ask a virtual area of 0x600000 bytes
EAL: Virtual area found at 0x2b581ce00000 (size = 0x600000)
EAL: Ask a virtual area of 0x600000 bytes
EAL: Virtual area found at 0x2b581d400000 (size = 0x600000)
EAL: Requesting 256 pages of size 2MB from socket 0
EAL: TSC frequency is ~2494211 KHz
EAL: Master lcore 0 is ready (tid=a6716440;cpuset=[0])
PMD: Initializing pmd_pcap for eth_pcap0
PMD: Creating pcap-backed ethdev on numa socket 0
PMD: Initializing pmd_pcap for eth_pcap1
PMD: Creating pcap-backed ethdev on numa socket 0
pktio/dpdk.c:404:dpdk_pktio_init():rte_eal_init OK
pktio/dpdk.c:566:dpdk_open():Cannot init mbuf packet pool
pktio/socket.c:112:mac_addr_get_fd():ioctl(SIOCGIFHWADDR): No such
device: "0".
pktio/socket.c:519:sock_setup_pkt():ioctl(SIOCGIFINDEX): No such device:
"0".
odp_packet_io.c:227:setup_pktio_entry():Unable to init any I/O type.
pktio_check_send_failure: failed t
I do:
cat /sys/kernel/mm/hugepages/hugepages-2048kB/nr_hugepages
955
t# mount -t hugetlbfs nodev /mnt/huge
then I run make check.
I think that this script should check all dependencies.
Maxim.
On 03/23/16 16:14, Matias Elo wrote:
Add support for running pktio validation tests with pcap
vdev interfaces without any physical interfaces.
Test script copied from odp-dpdk.
Signed-off-by: Matias Elo <matias....@nokia.com>
---
configure.ac | 2 +
platform/linux-generic/m4/odp_dpdk.m4 | 8 +--
platform/linux-generic/test/Makefile.am | 3 +
platform/linux-generic/test/pktio/Makefile.am | 3 +
platform/linux-generic/test/pktio/pktio_run_dpdk | 80 ++++++++++++++++++++++++
5 files changed, 92 insertions(+), 4 deletions(-)
create mode 100755 platform/linux-generic/test/pktio/pktio_run_dpdk
diff --git a/configure.ac b/configure.ac
index 6ad1bfc..bcd3ae3 100644
--- a/configure.ac
+++ b/configure.ac
@@ -85,6 +85,7 @@ AC_SUBST([platform_with_platform_test],
["platform/${with_platform}/test"])
# Prepare default values for platform specific optional features
##########################################################################
netmap_support=no
+pktio_dpdk_support=no
##########################################################################
# Run platform specific checks and settings
@@ -101,6 +102,7 @@ fi
# Set conditionals as computed within platform specific files
##########################################################################
AM_CONDITIONAL([netmap_support], [test x$netmap_support = xyes ])
+AM_CONDITIONAL([PKTIO_DPDK], [test x$pktio_dpdk_support = xyes ])
AM_CONDITIONAL([HAVE_PCAP], [test $have_pcap = yes])
diff --git a/platform/linux-generic/m4/odp_dpdk.m4 b/platform/linux-generic/m4/odp_dpdk.m4
index 7fa3387..96bbc5b 100644
--- a/platform/linux-generic/m4/odp_dpdk.m4
+++ b/platform/linux-generic/m4/odp_dpdk.m4
@@ -4,7 +4,7 @@
AC_ARG_ENABLE([dpdk_support],
[ --enable-dpdk-support include dpdk IO support],
[if test x$enableval = xyes; then
- dpdk_support=yes
+ pktio_dpdk_support=yes
fi])
##########################################################################
@@ -17,7 +17,7 @@ AC_HELP_STRING([--with-dpdk-path=DIR path to dpdk build
directory],
AM_CPPFLAGS="$AM_CPPFLAGS -msse4.2 -isystem $DPDK_PATH/include"
AM_LDFLAGS="$AM_LDFLAGS -L$DPDK_PATH/lib"
LIBS="$LIBS -ldpdk -ldl -lpcap"
- dpdk_support=yes],[])
+ pktio_dpdk_support=yes],[])
##########################################################################
# Save and set temporary compilation flags
@@ -28,13 +28,13 @@ CPPFLAGS="$AM_CPPFLAGS $CPPFLAGS"
##########################################################################
# Check for DPDK availability
##########################################################################
-if test x$dpdk_support = xyes
+if test x$pktio_dpdk_support = xyes
then
AC_CHECK_HEADERS([rte_config.h], [],
[AC_MSG_FAILURE(["can't find DPDK header"])])
ODP_CFLAGS="$ODP_CFLAGS -DODP_PKTIO_DPDK"
else
- dpdk_support=no
+ pktio_dpdk_support=no
fi
##########################################################################
diff --git a/platform/linux-generic/test/Makefile.am
b/platform/linux-generic/test/Makefile.am
index 7486120..9887dea 100644
--- a/platform/linux-generic/test/Makefile.am
+++ b/platform/linux-generic/test/Makefile.am
@@ -42,6 +42,9 @@ endif
if netmap_support
TESTS += pktio/pktio_run_netmap
endif
+if PKTIO_DPDK
+TESTS += pktio/pktio_run_dpdk
+endif
endif
dist_check_SCRIPTS = run-test tests-validation.env $(LOG_COMPILER)
diff --git a/platform/linux-generic/test/pktio/Makefile.am
b/platform/linux-generic/test/pktio/Makefile.am
index a82149e..3dcc1ee 100644
--- a/platform/linux-generic/test/pktio/Makefile.am
+++ b/platform/linux-generic/test/pktio/Makefile.am
@@ -8,5 +8,8 @@ endif
if netmap_support
dist_check_SCRIPTS += pktio_run_netmap
endif
+if PKTIO_DPDK
+dist_check_SCRIPTS += pktio_run_dpdk
+endif
test_SCRIPTS = $(dist_check_SCRIPTS)
diff --git a/platform/linux-generic/test/pktio/pktio_run_dpdk
b/platform/linux-generic/test/pktio/pktio_run_dpdk
new file mode 100755
index 0000000..50e910a
--- /dev/null
+++ b/platform/linux-generic/test/pktio/pktio_run_dpdk
@@ -0,0 +1,80 @@
+#!/bin/sh
+#
+# Copyright (c) 2016, Linaro Limited
+# All rights reserved.
+#
+# SPDX-License-Identifier: BSD-3-Clause
+#
+
+# directories where pktio_main binary can be found:
+# -in the validation dir when running make check (intree or out of tree)
+# -in the script directory, when running after 'make install', or
+# -in the validation when running standalone (./pktio_run) intree.
+# -in the current directory.
+# running stand alone out of tree requires setting PATH
+PATH=${TEST_DIR}/pktio:$PATH
+PATH=$(dirname $0):$PATH
+PATH=$(dirname $0)/../../../../test/validation/pktio:$PATH
+PATH=.:$PATH
+
+pktio_main_path=$(which pktio_main${EXEEXT})
+if [ -x "$pktio_main_path" ] ; then
+ echo "running with pktio_main: $pktio_run_path"
+else
+ echo "cannot find pktio_main: please set you PATH for it."
+fi
+
+# directory where platform test sources are, including scripts
+TEST_SRC_DIR=$(dirname $0)
+
+# exit codes expected by automake for skipped tests
+TEST_SKIPPED=77
+
+# Use installed pktio env or for make check take it from platform directory
+if [ -f "./pktio_env" ]; then
+ . ./pktio_env
+elif [ -f ${TEST_SRC_DIR}/pktio_env ]; then
+ . ${TEST_SRC_DIR}/pktio_env
+else
+ echo "BUG: unable to find pktio_env!"
+ echo "pktio_env has to be in current directory or in
platform/\$ODP_PLATFORM/test."
+ echo "ODP_PLATFORM=\"$ODP_PLATFORM\""
+ exit 1
+fi
+
+run_test()
+{
+ local ret=0
+
+ pktio_main${EXEEXT}
+ ret=$?
+ if [ $ret -ne 0 ]; then
+ echo "!!! FAILED !!!"
+ fi
+
+ exit $ret
+}
+
+run()
+{
+ # need to be root to set the interface.
+ if [ "$(id -u)" != "0" ]; then
+ echo "pktio: need to be root to setup DPDK interfaces."
+ return $TEST_SKIPPED
+ fi
+
+ if [ "$ODP_PKTIO_IF0" = "" ]; then
+ setup_pktio_env clean
+ export ODP_PKTIO_DPDK_PARAMS="--vdev eth_pcap0,iface=$IF0 --vdev
eth_pcap1,iface=$IF1"
+ export ODP_PKTIO_IF0=0
+ export ODP_PKTIO_IF1=1
+ fi
+
+ run_test
+}
+
+case "$1" in
+ setup) setup_pktio_env ;;
+ cleanup) cleanup_pktio_env ;;
+ *) run ;;
+esac
_______________________________________________
lng-odp mailing list
lng-odp@lists.linaro.org
https://lists.linaro.org/mailman/listinfo/lng-odp