Commit Graph

669 Commits

Author SHA1 Message Date
Jianbo Liu
5df1c51033 examples/l3fwd: add loop count for hash multi-lookup
New macro to define how many times of hash lookup in one time, and this
makes the code more concise.

Signed-off-by: Jianbo Liu <jianbo.liu@linaro.org>
2017-07-04 17:41:53 +02:00
Jianbo Liu
569b290cdb examples/l3fwd: add NEON implementation
Use ARM NEON intrinsics to accelerate l3 fowarding.

Signed-off-by: Jianbo Liu <jianbo.liu@linaro.org>
2017-07-04 17:41:53 +02:00
Jianbo Liu
3a6827ed19 examples/l3fwd: rearrange LPM code
Some common code can be used by other ARCHs, move to l3fwd_lpm.c

Signed-off-by: Jianbo Liu <jianbo.liu@linaro.org>
2017-07-04 17:41:53 +02:00
Jianbo Liu
66d8bc009c examples/l3fwd: extract common code from multi packet send
Keep x86 related code in l3fwd_sse.h, and move common code to
l3fwd_common.h, which will be used by other Archs.

Signed-off-by: Jianbo Liu <jianbo.liu@linaro.org>
2017-07-04 17:41:53 +02:00
Jianbo Liu
677311d270 examples/l3fwd: rename file for sequential hash lookup
The l3fwd_em_sse.h is enabled by NO_HASH_LOOKUP_MULTI.
Renaming it because it's only for sequential hash lookup,
and doesn't include any x86 SSE instructions.

Signed-off-by: Jianbo Liu <jianbo.liu@linaro.org>
2017-07-04 17:41:53 +02:00
Jianbo Liu
8ec858abe4 examples/l3fwd: reorganise multi hash lookup
Extract common code from l3fwd_em_hlm_sse.h, and add to the new file
l3fwd_em_hlm.h.

Signed-off-by: Jianbo Liu <jianbo.liu@linaro.org>
2017-07-04 17:25:01 +02:00
Ashwin Sekhar T K
f9599fa054 examples/performance-thread: support ARM64
Updated Makefile to allow compilation for arm64 architecture.

Added necessary arm64 support for lthread.

Fixed minor compilation errors for arm64 compilation.

Tested the apps l3fwd-thread and lthread_pthread_shim on thunderx
and x86_64.

Signed-off-by: Ashwin Sekhar T K <ashwin.sekhar@caviumnetworks.com>
2017-07-04 15:19:42 +02:00
Ashwin Sekhar T K
de88718f63 examples/performance-thread: reorganise arch code
Moved the architecture dependent stack set code to architecture
specific directory.

Signed-off-by: Ashwin Sekhar T K <ashwin.sekhar@caviumnetworks.com>
2017-07-04 15:19:22 +02:00
Bruce Richardson
8152e00dce examples/performance-thread: remove non-SSE4 fallbacks
Since this example is for x86_64 platforms only, and since SSE4 is now a
mandatory requirement, we can remove the ifdefs checking for that
instruction set level, and the fallbacks if it is not present.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
2017-07-04 14:39:18 +02:00
Bruce Richardson
193f9ec5c0 examples/l3fwd: remove checks for SSE4
Since SSE4 is now part of the minimum requirements for DPDK, we don't need
to check for its presence any more.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
2017-07-04 14:39:18 +02:00
Bruce Richardson
a113713835 examples/ip_pipeline: remove macro check for SSE4
Since SSE4 is now part of the minimum requirements for DPDK, we don't need
to check for its presence any more.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
2017-07-04 14:39:18 +02:00
Jerin Jacob
577329e66b eal: switch to architecture specific pause function
Remove rte_pause() definition from rte_common.h and
switchover to architecture specific rte_pause.h

Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
2017-07-03 23:58:51 +02:00
Bernard Iremonger
d6af1a13d7 ethdev: add return values to callback process API
Change the rte_eth_dev_callback_process function to return int,
and add a void *ret_param parameter.
The new parameter is used by ixgbe and i40e instead of abusing
the user data of the callback.

Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
2017-07-01 17:19:55 +02:00
Pablo de Lara
4eb45d2d4a examples/l2fwd-crypto: fix auth info display
Fixes: 4790f99d2d ("examples/l2fwd-crypto: use cryptodev algorithm parser")
Cc: stable@dpdk.org

Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Acked-by: Fiona Trahe <fiona.trahe@intel.com>
2017-06-28 19:59:22 +02:00
Pablo de Lara
a3c2e34b7f examples/l2fwd-crypto: fix application help
Chain parameter can be CIPHER_HASH, HASH_CIPHER,
CIPHER_ONLY or HASH_ONLY, but only the first two
were shown in the application help.

Fixes: 1a75e9f3fa ("examples/l2fwd-crypto: add cipher/hash only cases")
Cc: stable@dpdk.org

Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Acked-by: Fiona Trahe <fiona.trahe@intel.com>
2017-06-28 19:59:22 +02:00
Pablo de Lara
f1ae15bac8 examples/l2fwd-crypto: fix option parsing
Statistics period time option is parsed with -T argument,
but -t was accepted by mistake, instead.

Fixes: 387259bd6c ("examples/l2fwd-crypto: add sample application")
Cc: stable@dpdk.org

Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
2017-06-28 19:59:22 +02:00
Jerin Jacob
98a7ea332b fix typos using codespell utility
Fixing typos across dpdk source code using codespell utility.
Skipped the ethdev driver's base code fixes to keep the base
code intact.

Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
Acked-by: John McNamara <john.mcnamara@intel.com>
2017-06-14 23:54:13 +02:00
Jerin Jacob
c0583d98a9 eal: introduce macro for always inline
Different drivers use internal macros like force_inline for compiler
always inline feature.
Standardizing it through __rte_always_inline macro.

Verified the change by comparing the output binary file.
No difference found in the output binary file with this change.

Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
2017-06-06 17:21:55 +02:00
Tiwei Bie
67064d6795 examples/exception_path: support FreeBSD
Signed-off-by: Tiwei Bie <tiwei.bie@intel.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
2017-06-05 17:55:40 +02:00
Andrew Rybchenko
d432af7b5b examples/multi_process: remove unused variable
Fix broken build with -Werror=unused-but-set-variable

Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
2017-06-05 17:54:30 +02:00
Jerin Jacob
62a0e941b5 examples/vhost: fix uninitialized descriptor indexes
Fixing the below error by returning from the function early
when count == 0.

Issue flagged by GCC 7.1.1

examples/vhost/virtio_net.c:370:38: error: ‘desc_indexes[0]’ may be used
uninitialized in this function [-Werror=maybe-uninitialized]
  rte_prefetch0(&vr->desc[desc_indexes[0]]);

Fixes: ca059fa5e2 ("examples/vhost: demonstrate the new generic APIs")
Cc: stable@dpdk.org

Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
2017-06-05 14:28:32 +02:00
Jerin Jacob
35f30466d6 examples/qos_sched: suppress gcc 7.1.1 warning
This one is more of a compiler issue as application
checks the app_parse_opt_vals() return value.

Since this code is in slow path, adding a memset
to fix following "maybe-uninitialized" warning.

qos_sched/args.c: In function ‘app_parse_args’:
examples/qos_sched/args.c:254:32: error: ‘vals[0]’ may be
used uninitialized in this function [-Werror=maybe-uninitialized]
pconf->rx_port = (uint8_t)vals[0];
                            ~~~~^~~

Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
Acked-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
2017-06-05 14:27:01 +02:00
Jerin Jacob
1122ba9aa1 examples/performance-thread: add fall-through comments
This fixes compiler warnings with GCC 7.1.1

Fixes: d48415e1fe ("examples/performance-thread: add l3fwd-thread app")

Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
2017-06-05 14:26:57 +02:00
Jerin Jacob
663d3bc6d6 examples/l3fwd: add switch fall-through comments
This fixes compiler warnings with GCC 7.1.1

Fixes: 268888b5b0 ("examples/l3fwd: modularize")
Fixes: 94c54b4158 ("examples/l3fwd: rework exact-match")

Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
2017-06-05 14:26:51 +02:00
Gang Jiang
fa81d3b970 examples/vhost: fix socket path parsing
The return value of strnlen(s, maxlen) is never bigger than maxlen.

Fixes: 4796ad63ba ("examples/vhost: import userspace vhost application")

Signed-off-by: Gang Jiang <jiangg@mail.ustc.edu.cn>
2017-05-10 19:05:59 +02:00
Wei Dai
232dc830f2 examples/performance-thread: remove useless include
There is no function to refer any part of execinfo.h, so remove the
reference to it.
And there is no this file in musl. So need to remove it to support musl.

Signed-off-by: Wei Dai <wei.dai@intel.com>
2017-05-05 15:03:39 +02:00
Markos Chandras
939abaf96a examples/ethtool: fix link with ixgbe shared lib
When RTE_DEVEL_BUILD is unset, -rpath is unset.
So the ethtool app cannot link with ixgbe shared library
which is required by ethtool lib:

warning: librte_pmd_ixgbe.so.1, needed by
examples/ethtool/lib/x86_64-native-linuxapp-gcc/lib/librte_ethtool.so,
not found (try using -rpath or -rpath-link)

It is fixed by adding the library in the application link.

The library link is also improved to specify that this explicit link
to ixgbe is needed only in the shared lib mode.

Fixes: 077d223e25 ("examples/ethtool: use ixgbe public function")

Signed-off-by: Markos Chandras <mchandras@suse.de>
Acked-by: Remy Horton <remy.horton@intel.com>
Acked-by: Timothy Redaelli <tredaelli@redhat.com>
Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
2017-05-01 22:03:37 +02:00
Andriy Berestovskyy
509f35d4c4 examples/load_balancer: fix Tx flush
Port ID is not an index from 0 to n_nic_ports, but rather a value
of nic_ports array.

Fixes: af75078fec ("first public release")

Signed-off-by: Andriy Berestovskyy <andriy.berestovskyy@caviumnetworks.com>
2017-05-01 18:18:29 +02:00
Pablo de Lara
4175729d01 examples/l3fwd-power: fix Rx descriptor size
L3fwd power app monitors the RX queues to see if the polling frequency
should be adjusted (the busier the queue, the higher the frequency).
The app uses several thresholds in the ring to determine the frequency,
being 96 the highest one, when frequency should be highest.

The problem is that the difference between this value and the ring size
is not big enough (128 - 96 = 32 descriptors), which means that
if the descriptors are not replenished quick enough, queue might
not be busy, but the app would think that it is, because 96th descriptor
is set.

Therefore, by increasing this gap (increasing the RX ring size),
we make sure that this false measurement will not happen.

Fixes: b451aa39db ("examples/l3fwd-power: use DD bit rather than RX queue count")
Cc: stable@dpdk.org

Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Tested-by: Lei Yao <lei.a.yao@intel.com>
2017-05-01 17:58:51 +02:00
Jingjing Wu
ddc554ad28 examples/l3fwd-power: fix handling no Rx queue
If the number of rx queues is zero, it is meaningless to enable
rx interrupt. This patch fixes it.

Fixes: aee3bc79cc ("examples/l3fwd-power: enable one-shot Rx interrupt and polling switch")
Cc: stable@dpdk.org

Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>
2017-05-01 17:52:49 +02:00
Remy Horton
935439234b examples/l2fwd-keepalive: clean up shared mem on exit
This patch adds the unlinking/unmapping of shared host memory
on termination of l2fwd-keepalive. Previously it was only
cleaned on re-running of the example application.

Fixes: e64833f227 ("examples/l2fwd-keepalive: add sample application")

Signed-off-by: Remy Horton <remy.horton@intel.com>
Tested-by: Roman Korynkevych <romanx.korynkevych@intel.com>
2017-05-01 16:42:07 +02:00
Remy Horton
91e89e477e examples/l2fwd-keepalive: add graceful exit
The l2fwd-keepalive example has infinite processing loops and as a
result the only way to exit it is via SIGINT/SIGTERM (e.g. Control-C).
The resulting shutdown is unclean, which is fixed by adding a signal
handler that causes the processing loops to break.

Fixes: e64833f227 ("examples/l2fwd-keepalive: add sample application")

Signed-off-by: Remy Horton <remy.horton@intel.com>
Tested-by: Roman Korynkevych <romanx.korynkevych@intel.com>
2017-05-01 16:42:07 +02:00
Zhiyong Yang
ab69581b74 examples/multi_process: fix timer update
To miss updating the variable prev_tsc in function l2fwd_main_loop()
The patch fixes it.

Fixes: e2366e74e0 ("examples: use buffered Tx")
Cc: stable@dpdk.org

Signed-off-by: Zhiyong Yang <zhiyong.yang@intel.com>
2017-05-01 16:39:28 +02:00
Bruce Richardson
b7162fee88 examples/performance-thread: fix build on FreeBSD 10.0
While later releases in the FreeBSD 10 series have a CPU_COUNT macro
defined, FreeBSD 10.0 and 10.1 do not have this macro. Therefore we provide
a basic fallback implementation of the macro for platforms where it is not
defined.

Fixes: 433ba6228f ("examples/performance-thread: add pthread_shim app")
Cc: stable@dpdk.org

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
2017-05-01 16:10:03 +02:00
Pablo de Lara
d7acf6ba43 examples/l2fwd-crypto: fix packets array index
Fixes: c0f87eb525 ("cryptodev: change burst API to be crypto op oriented")
Cc: stable@dpdk.org

Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
2017-04-28 17:46:19 +02:00
Bruce Richardson
1e6d5a9608 examples/performance-thread: fix compilation on Suse 11 SP2
Fixes following compilation error, using uint64_t type,
instead of int128_t unnecessarily:

In file included from ./common/lthread.c:82:0:
./common/lthread_timer.h: In function ‘_ns_to_clks’:
./common/lthread_timer.h:49:20: error: expected ‘=’, ‘,’, ‘;’,
 ‘asm’ or ‘__attribute__’ before ‘clkns’
compilation terminated due to -Wfatal-errors.

Fixes: 116819b9ed ("examples/performance-thread: add lthread subsystem")
Cc: stable@dpdk.org

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
2017-04-24 16:02:20 +02:00
Bruce Richardson
9aba2a3f3d examples/performance-thread: use a single build dir
When building any of the perf-thread examples, the output .o files were
placed in two separate directories for each app: the regular build dir and
a "common" build directory. This was due to the way the files to be built
were specified, using a relative path. Switching to use VPATH to find the
files causes Make to put all .o's into the one build directory.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
2017-04-21 16:20:33 +02:00
Bruce Richardson
4cde45f36f examples/performance-thread: fix build on FreeBSD
This set of sample apps did not compile on FreeBSD due to use of a number
of Linux/glibc-specific APIs, or APIs which existed in different headers
on FreeBSD. Specifically, the following APIs has problems:
  * sched_getcpu() is a glibc extension, so use rte_lcore_id() on BSD
  * pthread_yield() returns int on Linux, but void on FreeBSD, so
    we have to create two slightly different copies of the function.
  * the type for managing cpu sets is cpuset_t on FreeBSD rather than
    cpu_set_t as on Linux, so use rte_cpuset_t from rte_lcore.h.
  * APIs for managing cpu affinity are in pthread_np.h on FreeBSD, rather
    than in pthread.h, also fixed by including rte_lcore.h

Fixes: 433ba6228f ("examples/performance-thread: add pthread_shim app")
Fixes: d48415e1fe ("examples/performance-thread: add l3fwd-thread app")
Cc: stable@dpdk.org

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
2017-04-21 16:20:16 +02:00
Bruce Richardson
b2f4f2e2a6 examples: fix build clean on FreeBSD
The "examples_clean" top-level build target calls "make clean" for each
individual example. However, for a number of those which were linux-only
examples, the "if" condition only had a dummy "all" target i.e. no "clean"
target, causing an error with examples_clean.

Fixes: 3417cd687e ("examples: ignore linux apps on bsd")
Cc: stable@dpdk.org

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
2017-04-21 16:19:54 +02:00
Hiroki Shirokura
4ae49092fb examples/performance-thread: support C++
Lthread is awesome but it doesn't support C++.
So I write patch to support lthread to support C++.
Added "extern C {}" to lthread-headers

Signed-off-by: Hiroki Shirokura <slank.dev@gmail.com>
Acked-by: Keith Wiles <keith.wiles@intel.com>
2017-04-21 02:39:05 +02:00
Qi Zhang
6fed57a3f4 examples/ethtool: disable promiscuous mode by default
Disable promiscuous mode by default since VLAN filter
does not work when promiscuous mode is enabled.

Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Remy Horton <remy.horton@intel.com>
2017-04-21 02:24:31 +02:00
Andriy Berestovskyy
5e470a6654 examples: limit max frame size
Some PMDs do not support 9,5K jumbo frames, so the example fails.
Limit the frame size to the maximum supported by the underlying NIC.

Signed-off-by: Andriy Berestovskyy <andriy.berestovskyy@caviumnetworks.com>
2017-04-21 02:21:29 +02:00
Andriy Berestovskyy
0469250961 examples/ip_pipeline: avoid panic if link up/down not supported
Some PMDs (mostly VFs) do not provide link up/down functionality.

Signed-off-by: Andriy Berestovskyy <andriy.berestovskyy@caviumnetworks.com>
Acked-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
2017-04-21 02:15:12 +02:00
Andriy Berestovskyy
b58c9c3677 examples/ip_pipeline: support more than 32 CPUs
At the moment ip_pipeline example uses 32 during the initialization,
which leads to an error on systems with more than 32 CPUs.

Signed-off-by: Andriy Berestovskyy <andriy.berestovskyy@caviumnetworks.com>
Acked-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
2017-04-21 02:15:03 +02:00
Shyam Kumar Shrivastav
d5faec799c examples/ip_pipeline: fix port range filtering
Firewall ACL definition need to use same input index for source and
destination ports as these are 16 bits and would fit in one ACL
field of 32 bits. This is required as per librte_acl API. Without this
UDP/TCP source and destination ports filtering (and for that
matter ICMP type/code filtering) does not work.

Signed-off-by: Shyam Kumar Shrivastav <shrivastav.shyam@gmail.com>
Reviewed-by: Jasvinder Singh <jasvinder.singh@intel.com>
Acked-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
2017-04-21 02:10:20 +02:00
Pablo de Lara
c64457cb11 examples/l2fwd-crypto: fix padding calculation
For padding calculation, it is necessary to know if algorithm
is a block cipher or stream cipher algorithm, and know the
block size for the algorithm.

In the application, this block size should be only the
cipher block size, but if authentication was used too,
it was being overwritten by the authentication block size,
which is not needed.

Fixes: 27cf2d1b18 ("examples/l2fwd-crypto: discover capabilities")
Cc: stable@dpdk.org

Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Acked-by: Fan Zhang <roy.fan.zhang@intel.com>
2017-04-20 11:32:45 +02:00
Fan Zhang
d2797f51cc examples/l2fwd-crypto: add cryptodev mask option
Previously, l2fwd-crypto application did not give user the
flexibility to decide which crypto device(s) will be used.

In this patch, a new cryptodev_mask option is added to the
application. Same as portmask, the cryptodev_mask avails the
user to mask out the unwanted crypto devices in the system.

Signed-off-by: Fan Zhang <roy.fan.zhang@intel.com>
2017-04-20 11:32:45 +02:00
Pablo de Lara
18f421f65b examples/l2fwd-crypto: fix AEAD tests when AAD is zero
For AEAD algorithms, additional authenticated data (AAD)
can be passed, but it is optional, so its size can be zero.
However, it is required to set this length to zero in the crypto
operation to avoid undefined behaviour.

Fixes: 617a7949c9 ("examples/l2fwd-crypto: parse AAD parameter")
Cc: stable@dpdk.org

Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
2017-04-20 11:32:45 +02:00
Jeff Guo
60da774e6e examples: enable HW CRC strip by default
Since VF can not disable/enable HW CRC strip for non-DPDK PF drivers,
and kernel driver almost default enable that feature, if disable it in
example app's rxmode, VF driver will report the VF launch failure. So
this patch default to enable HW CRC strip to let VF launch successful.

Cc: stable@dpdk.org

Signed-off-by: Jeff Guo <jia.guo@intel.com>
Acked-by: Jingjing Wu <jingjing.wu@intel.com>
2017-04-10 22:36:37 +02:00
Bruce Richardson
a894e13ede examples: enable build of performance-thread
The performance-thread example was not build by default in the make
examples build target. It will compile ok for x86_64 targets so add it to
the examples makefile list for that platform.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Declan Doherty <declan.doherty@intel.com>
2017-04-06 21:37:19 +02:00