aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatias Elo <matias.elo@nokia.com>2018-04-27 13:54:44 +0300
committerMatias Elo <matias.elo@nokia.com>2018-04-30 13:25:32 +0300
commit0aadbcb71229bdd1c90db53e283555a70599a5bd (patch)
tree357a34b8bf06edcc889ae7991e787d69e1d002fb
parent6aab1afe53f2f337d87c1ad6f713be29afa3531e (diff)
linux-dpdk: make usage of ODP_PLATFORM_PARAMS optional
The number of memory channels is no longer a mandatory DPDK parameter, so make use of ODP_PLATFORM_PARAMS optional. Signed-off-by: Matias Elo <matias.elo@nokia.com>
-rw-r--r--.travis.yml4
-rw-r--r--platform/linux-dpdk/README15
-rw-r--r--platform/linux-dpdk/odp_init.c23
-rwxr-xr-xplatform/linux-dpdk/test/validation/api/pktio/pktio_run.sh2
-rwxr-xr-xplatform/linux-dpdk/test/wrapper-script.sh2
5 files changed, 13 insertions, 33 deletions
diff --git a/.travis.yml b/.travis.yml
index 1be920d6a..5bc119644 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -257,7 +257,7 @@ script:
- echo "Dynamic link.."
- ${CC} ${CFLAGS} ${OLDPWD}/example/hello/odp_hello.c -o odp_hello_inst_dynamic `PKG_CONFIG_PATH=${HOME}/odp-install/lib/pkgconfig:${PKG_CONFIG_PATH} pkg-config --cflags --libs libodp-linux`
- if [ -z "$CROSS_ARCH" ] ; then
- sudo ODP_PLATFORM_PARAMS="-n 2" LD_LIBRARY_PATH="${HOME}/odp-install/lib:$LD_LIBRARY_PATH" ./odp_hello_inst_dynamic ;
+ sudo LD_LIBRARY_PATH="${HOME}/odp-install/lib:$LD_LIBRARY_PATH" ./odp_hello_inst_dynamic ;
fi
- |
# it is not possible to do static linking if we only have shared DPDK library. Compiler complains about missing -ldpdk
@@ -265,7 +265,7 @@ script:
echo "Static link.."
${CC} ${CFLAGS} ${OLDPWD}/example/hello/odp_hello.c -o odp_hello_inst_static `PKG_CONFIG_PATH=${HOME}/odp-install/lib/pkgconfig:${PKG_CONFIG_PATH} pkg-config --cflags --libs libodp-linux --static` -static || exit 1
if [ -z "$CROSS_ARCH" ] ; then
- sudo ODP_PLATFORM_PARAMS="-n 2" ./odp_hello_inst_static;
+ sudo ./odp_hello_inst_static;
fi
fi
- popd
diff --git a/platform/linux-dpdk/README b/platform/linux-dpdk/README
index 7678525f6..c9e7af78e 100644
--- a/platform/linux-dpdk/README
+++ b/platform/linux-dpdk/README
@@ -173,16 +173,15 @@ To restore the NIC's back to kernel use something like this:
5. Running ODP apps
=================================================
-ODP-DPDK applications need to be run as root. You also need to supply the DPDK
-command line parameters either as a null-terminated array of char's to
-odp_global_init()'s platform_params parameter:
+ODP-DPDK applications need to be run as root. You may also need to
+supply DPDK command line parameters either as a null-terminated array of
+char's to odp_global_init()'s platform_params parameter:
- odp_global_init([params], "-n 4");
+ odp_global_init([params], "--no-huge");
Or, if it's NULL the platform tries to read the ODP_PLATFORM_PARAMS environment
variable.
-You need to pass at least "-n [1..4]" to specify the number of memory channels.
The coremask (-c) is calculated by ODP-DPDK based on the process affinity at
startup. You can influence that with 'taskset'. DPDK init changes the affinity
of the calling thread, so after it returns the original affinity is restored.
@@ -194,7 +193,7 @@ like proper DPDK threads.
Exaple how to run an ODP-DPDK L2 forwarding application:
- sudo ODP_PLATFORM_PARAMS="-n 4" ./odp_l2fwd -i 0,1 -c 2
+ sudo ./odp_l2fwd -i 0,1 -c 2
-i 0,1 - interface numbers
-c 2 - number of worker cpus
@@ -227,7 +226,7 @@ CONFIG_RTE_LIBRTE_PMD_PCAP=y
mount -t hugetlbfs none /mnt/huge
Finally give l2fwd fake devices:
- ./l2fwd -c '0xf' -n 4 --vdev "eth_pcap0,iface=veth2-1" --vdev="eth_pcap1,iface=veth2-3" -- -p 3
+ ./l2fwd -c '0xf' --vdev "eth_pcap0,iface=veth2-1" --vdev="eth_pcap1,iface=veth2-3" -- -p 3
7. Upgrading ODP-DPDK to newer ODP API level
=================================================
@@ -287,5 +286,5 @@ AESNI_MULTI_BUFFER_LIB_PATH=/path-to/Intel-multi-buffer-crypto/ \
when building odp-dpdk application, add the multi-buffer crypto library path to make file.
Before running the application, export ODP_PLATFORM_PARAMS with corresponding
crypto vdev's.
-ex: ODP_PLATFORM_PARAMS="-n 4 --vdev cryptodev_aesni_mb_pmd,max_nb_sessions=32 \
+ex: ODP_PLATFORM_PARAMS="--vdev cryptodev_aesni_mb_pmd,max_nb_sessions=32 \
--vdev cryptodev_null_pmd,max_nb_sessions=32"
diff --git a/platform/linux-dpdk/odp_init.c b/platform/linux-dpdk/odp_init.c
index 7a51ff23b..a7bc0a843 100644
--- a/platform/linux-dpdk/odp_init.c
+++ b/platform/linux-dpdk/odp_init.c
@@ -50,23 +50,6 @@ void refer_constructors(void)
}
#endif
-static void print_dpdk_env_help(void)
-{
- char prgname[] = "odpdpdk";
- char help_str[] = "--help";
- char *dpdk_argv[] = {prgname, help_str};
- int dpdk_argc = 2;
-
- ODP_ERR("Neither (char *)platform_params were provided to "
- "odp_init_global(),\n");
- ODP_ERR("nor ODP_PLATFORM_PARAMS environment variable were "
- "specified.\n");
- ODP_ERR("A string of DPDK command line arguments should be provided");
- ODP_ERR("Example: export ODP_PLATFORM_PARAMS=\"-n 4 --no-huge\"\n");
- ODP_ERR("Note: -c argument substitutes automatically from odp coremask\n");
- rte_eal_init(dpdk_argc, dpdk_argv);
-}
-
static int odp_init_dpdk(const char *cmdline)
{
char **dpdk_argv;
@@ -80,10 +63,8 @@ static int odp_init_dpdk(const char *cmdline)
if (cmdline == NULL) {
cmdline = getenv("ODP_PLATFORM_PARAMS");
- if (cmdline == NULL) {
- print_dpdk_env_help();
- return -1;
- }
+ if (cmdline == NULL)
+ cmdline = "";
}
CPU_ZERO(&original_cpuset);
diff --git a/platform/linux-dpdk/test/validation/api/pktio/pktio_run.sh b/platform/linux-dpdk/test/validation/api/pktio/pktio_run.sh
index 6007195e1..d051fa801 100755
--- a/platform/linux-dpdk/test/validation/api/pktio/pktio_run.sh
+++ b/platform/linux-dpdk/test/validation/api/pktio/pktio_run.sh
@@ -85,7 +85,7 @@ run()
echo "Failed to setup test environment, skipping test."
exit $TEST_SKIPPED
fi
- export ODP_PLATFORM_PARAMS="-n 4 --no-pci --vdev net_pcap0,iface=$IF0 --vdev net_pcap1,iface=$IF1"
+ export ODP_PLATFORM_PARAMS="--no-pci --vdev net_pcap0,iface=$IF0 --vdev net_pcap1,iface=$IF1"
export ODP_PKTIO_IF0=0
export ODP_PKTIO_IF1=1
fi
diff --git a/platform/linux-dpdk/test/wrapper-script.sh b/platform/linux-dpdk/test/wrapper-script.sh
index b095b7621..b092e1064 100755
--- a/platform/linux-dpdk/test/wrapper-script.sh
+++ b/platform/linux-dpdk/test/wrapper-script.sh
@@ -1,6 +1,6 @@
#!/bin/bash
-export ODP_PLATFORM_PARAMS=${ODP_PLATFORM_PARAMS:--n 4 --vdev="crypto_openssl" --vdev="crypto_null"}
+export ODP_PLATFORM_PARAMS=${ODP_PLATFORM_PARAMS:---vdev="crypto_openssl" --vdev="crypto_null"}
# where to mount huge pages
export HUGEPAGEDIR=${HUGEPAGEDIR:-/mnt/huge}
# exit codes expected by automake for skipped tests