Commit Graph

1515 Commits

Author SHA1 Message Date
Rory Sexton
95f648ff9e examples/vm_power: make branch ratio threshold per core
This modification allows for the branch ratio threshold to be set
per core rather than system wide. This gives greater flexibility to
the branch ratio monitoring allowing it to manage different
workloads with different characteristics on the same system.

Signed-off-by: Rory Sexton <rory.sexton@intel.com>
Reviewed-by: David Hunt <david.hunt@intel.com>
Acked-by: Reshma Pattan <reshma.pattan@intel.com>
2020-07-17 14:40:56 +02:00
Anatoly Burakov
11159dd669 examples/l3fwd-power: select default mode automatically
Currently, the application does support running without the power
library being initialized, but it has to be specifically requested. On
platforms without support for frequency scaling using the power library,
we can just enable interrupt-only mode by default.

Suggested-by: Jerin Jacob <jerinj@marvell.com>
Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
Tested-by: Harman Kalra <hkalra@marvell.com>
2020-07-11 13:32:37 +02:00
Anatoly Burakov
e0194feb32 examples/l3fwd-power: add interrupt-only mode
In addition to existing modes, add a mode which is very similar to
legacy mode, but does not do frequency scaling, and thus does not
depend on the power library.

Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
Tested-by: Yinan Wang <yinan.wang@intel.com>
2020-07-11 13:31:07 +02:00
Anatoly Burakov
2a0e2e2db3 examples/l3fwd-power: add legacy mode option
Currently, legacy mode is the implicit default, but it is not possible
to directly request using legacy mode. Add the argument to enable
requesting legacy mode, and also make it the default.

Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
2020-07-11 13:30:06 +02:00
Anatoly Burakov
5b41ab3574 examples/l3fwd-power: fix style and control flow
Make the coding style more consistent, and the init logic control flow
more explicit.

Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
2020-07-11 13:29:10 +02:00
Anatoly Burakov
9b133b42ab examples/l3fwd-power: allow only supported environments
Currently, l3fwd-power will attempt to run even if the power env
is set to KVM, which is not supported. Fix this by preventing the
app from initializing unless the env is set to one of the supported
modes.

Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
Tested-by: Yinan Wang <yinan.wang@intel.com>
2020-07-11 13:28:02 +02:00
Anatoly Burakov
f06493ad73 examples/l3fwd-power: disable interrupts by default
Currently, interrupts are enabled in telemetry and empty poll modes, but
they are not used. Switch to disabling interrupts by default, and only
enable interrupts for modes that require them.

Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
Tested-by: Yinan Wang <yinan.wang@intel.com>
2020-07-11 13:22:15 +02:00
Joyce Kong
428e684795 introduce restricted pointer aliasing marker
The 'restrict' keyword is recognized in C99, while type qualifier
'__restrict' compiles ok in C with all language levels. This patch
is to replace the existing 'restrict' with '__rte_restrict' which
is a common wrapper supported by all compilers.

Signed-off-by: Joyce Kong <joyce.kong@arm.com>
Reviewed-by: Phil Yang <phil.yang@arm.com>
Reviewed-by: Ruifeng Wang <ruifeng.wang@arm.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
2020-07-10 15:35:32 +02:00
Anoob Joseph
1329602b6c examples/ipsec-secgw: add per-core packet statistics
Adding per core packet handling stats to analyze traffic distribution
when multiple cores are engaged.

Since aggregating the packet stats across cores would affect
performance, keeping the feature disabled using compile time flags.

Signed-off-by: Anoob Joseph <anoobj@marvell.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
2020-07-08 00:15:35 +02:00
Harry van Haaren
ff0f1040b6 examples/eventdev: fix 32-bit coremask
This commit fixes a bug in 32-bit environments when a core mask greater
than 32-bits is requested. The fix is to convert the bitmask logic to
64 bits, aligning 64 and 32 bit implementations.

Fixes: adb5d548 ("examples/eventdev_pipeline_sw_pmd: add sample app")
Cc: stable@dpdk.org

Reported-by: Jun W Zhou <junx.w.zhou@intel.com>
Suggested-by: Mao Jiang <maox.jiang@intel.com>
Signed-off-by: Harry van Haaren <harry.van.haaren@intel.com>
2020-06-29 18:37:52 +02:00
Vamsi Attunuru
fa19eb20d2 examples/l2fwd: add forwarding port mapping option
Current l2fwd application statically configures adjacent ports as
destination ports for forwarding the traffic.

Add a portmap option to pass the forwarding port pair mapping which allows
the user to configure forwarding port mapping.

If no portmap argument is specified, destination port map is not
changed and traffic gets forwarded with existing mapping.

To align port/queue configuration of each lcore with destination port
map, port/queue configuration of each lcore gets modified when portmap
option is specified.

Ex: ./l2fwd -c 0xff -- -p 0x3f -q 2 --portmap="(0,3)(1,4)(2,5)"

With above portmap option, traffic received from portid = 0 gets forwarded
to port = 3 and vice versa, similarly traffic gets forwarded on other port
pairs (1,4) and (2,5)

Signed-off-by: Vamsi Attunuru <vattunuru@marvell.com>
Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
Acked-by: Andrzej Ostruszka <aostruszka@marvell.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
2020-07-05 13:07:58 +02:00
Thomas Monjalon
de321d5918 build: remove special handling for node library
The node library had a need of being linked as a whole
to make some constructors effective.
Now that all libraries are linked with --whole-archive,
there is no need to have this library separate.

Fixes: e2db26f766 ("build: always link whole DPDK static libraries")

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Tested-by: Jerin Jacob <jerinj@marvell.com>
2020-07-05 10:52:11 +02:00
Bruce Richardson
8549295db0 build/pkg-config: improve static linking flags
Rather than setting -Bstatic in the linker flags when doing a static link,
and then having to explicitly set -Bdynamic again afterwards, we can update
the pkg-config file to use -l:libfoo.a syntax to explicitly refer to the
static library in question. Since this syntax is not supported by meson's
pkg-config module directly, we can post-process the .pc files instead to
adjust them.

Once done, we can simplify the examples' makefiles and the docs by removing
the explicit static flag.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Luca Boccassi <bluca@debian.org>
Acked-by: Sunil Pai G <sunil.pai.g@intel.com>
Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
2020-07-01 19:30:52 +02:00
Bruce Richardson
e2db26f766 build: always link whole DPDK static libraries
To ensure all constructors are included in static build, we need to pass
the --whole-archive flag when linking, which is used with the
"link_whole" meson option. Since we use link_whole for all libs, we no
longer need to track the lib as part of the static dependency, just the
path to the headers for compiling.

After this patch is applied, all DPDK .a files are inside
--whole-archive/--no-whole-archive flags, but external dependencies and
shared libs being linked against remain outside.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Tested-by: Andrzej Ostruszka <aostruszka@marvell.com>
Acked-by: Luca Boccassi <bluca@debian.org>
Acked-by: Sunil Pai G <sunil.pai.g@intel.com>
Acked-by: Thomas Monjalon <thomas@monjalon.net>
2020-07-01 19:30:52 +02:00
Maxime Coquelin
fbe6be6ea0 examples/vdpa: remove useless device count
The VDPA example now uses the vDPA class iterator, so
knowing the number of available devices beforehand is
no longer needed.

Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Acked-by: Adrián Moreno <amorenoz@redhat.com>
2020-06-30 14:52:30 +02:00
Maxime Coquelin
71296e7b2d examples/vdpa: use new wrappers instead of ops
Now that wrappers to query number of queues, Virtio
features and Vhost-user protocol features are available,
let's make the vDPA example to use them.

Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Acked-by: Adrián Moreno <amorenoz@redhat.com>
2020-06-30 14:52:30 +02:00
Maxime Coquelin
0f700f90ad vhost: replace device ID in applications
This patch replaces the use of vDPA device ID with
vDPA device pointer. The goals is to remove the vDPA
device ID to avoid confusion with the Vhost ID.

Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Acked-by: Adrián Moreno <amorenoz@redhat.com>
2020-06-30 14:52:30 +02:00
Maxime Coquelin
2263f13941 vhost: replace vDPA device ID in Vhost
This removes the notion of device ID in Vhost library
as a preliminary step to get rid of the vDPA device ID.

Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Acked-by: Adrián Moreno <amorenoz@redhat.com>
2020-06-30 14:52:30 +02:00
Maxime Coquelin
81a6b7fe06 vhost: replace device ID in vDPA ops
This patch is a preliminary step to get rid of the
vDPA device ID. It makes vDPA callbacks to use the
vDPA device struct as a reference instead of the ID.

Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Acked-by: Adrián Moreno <amorenoz@redhat.com>
2020-06-30 14:52:30 +02:00
Maxime Coquelin
38f8ab0bbc vhost: make vDPA framework bus agnostic
This patch makes the vDPA framework to no more
support only PCI devices, but any devices by relying
on the generic device name as identifier.

Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Acked-by: Adrián Moreno <amorenoz@redhat.com>
2020-06-30 14:52:30 +02:00
Matan Azrad
6505865aa8 examples/vdpa: add statistics show command
A new vDPA driver feature was added to query the virtq
statistics from the HW.

Use this feature to show the HW queues statistics for the virtqs.

Command description: stats X Y.
X is the device ID.
Y is the queue ID, Y=0xffff to show all the virtio queues
statistics of the device X.

Signed-off-by: Matan Azrad <matan@mellanox.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
2020-06-30 14:52:29 +02:00
Thomas Monjalon
4f299b7169 build: replace meson OS detection with variable
Some places were calling the meson function host_machine.system()
instead of the variables is_windows and is_linux defined
in config/meson.build.

At the same time, the missing "Linux restriction" reason is added to
pfe and octeontx2 crypto PMDs.

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
2020-06-30 15:29:59 +02:00
Georgiy Levashov
3ee6f70651 examples: add flush after stats printing
When printf()'s stdout is line-buffered for terminal, it is fully
buffered for pipes. So, stdout listener can only get the output
when it is flushed (on program termination, when buffer is filled or
manual flush).

stdout buffer might fill slowly since every stats report could be small.

Also when it is fully filled it might contain a part of the last stats
report which makes it very inconvenient for any automation which reads
and parses the output.

Fixes: af75078fec ("first public release")
Cc: stable@dpdk.org

Signed-off-by: Georgiy Levashov <georgiy.levashov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
2020-06-25 00:20:01 +02:00
Jasvinder Singh
358eb13389 examples/ip_pipeline: remove check of null response
For sending request messages to data plane threads, the
caller invokes *_msg_send_recv() functions which never
return null response. Thus, removed redundant check on
the returned response.

Coverity issue: 357750, 357740, 357749, 357758, 357702, 357736
Coverity issue: 357679, 357791, 357738, 357778, 357716, 357705
Coverity issue: 357776, 357753, 357729, 357735, 357773, 357723
Fixes: 32e5d9b154 ("examples/ip_pipeline: add enable and disable commands")
Fixes: 50e73d0518 ("examples/ip_pipeline: add stats read commands")
Fixes: 6b1b3c3c9d ("examples/ip_pipeline: add port enable and disable commands")
Fixes: a3a95b7d58 ("examples/ip_pipeline: add table entry commands")
Fixes: 3186282f8e ("examples/ip_pipeline: add table bulk add command")
Fixes: f634e4c569 ("examples/ip_pipeline: add table entry delete command")
Fixes: c64b9121a9 ("examples/ip_pipeline: add table entry stats command")
Fixes: 7e11393e40 ("examples/ip_pipeline: add meter profile commands")
Fixes: e92058d604 ("examples/ip_pipeline: add meter stats command")
Fixes: 2b82ef4861 ("examples/ip_pipeline: add DSCP table update command")
Fixes: d0d306c7f2 ("examples/ip_pipeline: add TTL stats command")
Fixes: a3169ee5ec ("examples/ip_pipeline: support rule time read")
Cc: stable@dpdk.org

Signed-off-by: Jasvinder Singh <jasvinder.singh@intel.com>
Acked-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
2020-05-24 18:24:28 +02:00
Ferruh Yigit
36f9eba471 examples/kni: fix crash during MTU set
During MTU set (kni_change_mtu) sample application setup queues, which
can free and re-allocate queues.
Meanwhile sample application keeps continues in Rx/Tx burst calls in
different threads, which may cause crash during queue setup.

Pausing application Rx/Tx calls before MTU set and starts it back
afterwards.

Bugzilla ID: 482
Fixes: a26b116749 ("examples/kni: fix MTU change to setup Tx queue")
Cc: stable@dpdk.org

Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Rasesh Mody <rmody@marvell.com>
Tested-by: Xi Zhang <xix.zhang@intel.com>
2020-05-24 18:04:20 +02:00
Thomas Monjalon
666272d20d examples/vm_power: drop Unix path limit redefinition
The Unix socket path may be as long as UNIX_PATH_MAX.
This constant is supposed to be defined in sys/un.h.
On Linux, it appears to be in linux/un.h.

This constant was re-defined locally, based on a variable declaration.
It is breaking compilation with -fno-common (default in GCC 10)
We could avoid the variable declaration by using NULL struct,
but it looks simpler not redefining this system constant.

As the power library and its examples are restricted to Linux only,
the Linux header file is directly included.

Fixes: 0d74597c1b ("examples/vm_power: fix max length of unix socket path")
Cc: stable@dpdk.org

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Acked-by: David Marchand <david.marchand@redhat.com>
Acked-by: Kevin Traynor <ktraynor@redhat.com>
2020-05-21 15:41:49 +02:00
Thomas Monjalon
96d3d532f9 examples/vm_power: fix build with -fno-common
The variables of the same name are merged together
if compiled with -fcommon. It used to be the default.
This default behaviour allows to declare a variable in a header file and
share the variable in every .o binaries thanks to merge at link-time.

If compiling with -fno-common (default in GCC 10), the variable must be
shared as extern to avoid multiple re-definitions.

Fixes: dff22404aa ("examples/vm_power_mgr: add VCPU to PCPU mapping")
Cc: stable@dpdk.org

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Acked-by: David Marchand <david.marchand@redhat.com>
Acked-by: Kevin Traynor <ktraynor@redhat.com>
2020-05-21 15:41:48 +02:00
Pavan Nikhilesh
1d049dc762 examples/l3fwd-graph: check link query failure
Fix unchecked return values reported by coverity.

Coverity issue: 350601
Fixes: ef853f1fd9 ("examples/l3fwd-graph: add ethdev configuration changes")

Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
Acked-by: Nithin Dabilpuram <ndabilpuram@marvell.com>
2020-05-19 19:15:14 +02:00
Pavan Nikhilesh
c1c48e7636 examples/l3fwd: check service core reset result
Fix unchecked return values reported by coverity.

Coverity issue: 354235
Fixes: 8bd537e9c6 ("examples/l3fwd: add service core setup based on caps")
Cc: stable@dpdk.org

Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
2020-05-19 19:15:14 +02:00
Rasesh Mody
a26b116749 examples/kni: fix MTU change to setup Tx queue
This patch adds a fix to setup Tx queue when changing KNI interface MTU.
It ensures device can safely start txq post MTU change operation.

Fixes: fc9ee41b70 ("examples/kni: convert to new ethdev offloads API")
Cc: stable@dpdk.org

Signed-off-by: Rasesh Mody <rmody@marvell.com>
Acked-by: Ferruh Yigit <ferruh.yigit@intel.com>
2020-05-19 18:29:38 +02:00
Jin Yu
e2b4cfd6a4 examples/vhost_blk: fix not null-terminated buffer
In vhost_blk_bdev_construct: The string buffer may not have
a null terminator if the source string's length is equal to
the buffer size.

Fixes: 91d3e2d429 ("examples/vhost_blk: refactor to increase readability")

Signed-off-by: Jin Yu <jin.yu@intel.com>
Reviewed-by: Xiaolong Ye <xiaolong.ye@intel.com>
2020-05-18 20:35:57 +02:00
Ivan Dyukov
c81e3f21d1 examples: remove extra new line after link duplex
This patch removes extra 'new line' in few app examples.

Fixes: d3641ae863 ("examples: update link status checks")
Fixes: 387259bd6c ("examples/l2fwd-crypto: add sample application")
Fixes: 4ff457986f ("examples/l2fwd-event: add default poll mode routines")
Fixes: e64833f227 ("examples/l2fwd-keepalive: add sample application")
Fixes: 204896f8d6 ("examples/l2fwd-jobstats: add new example")
Fixes: c8e6ceeceb ("examples/ioat: add new sample app for ioat driver")
Fixes: cc8f4d020c ("examples/ip_reassembly: initial import")
Fixes: d299106e8e ("examples/ipsec-secgw: add IPsec sample application")
Fixes: 39aad0e88c ("examples/flow_distributor: new example to demonstrate EFD")
Fixes: d48415e1fe ("examples/performance-thread: add l3fwd-thread app")
Fixes: 20c78ac9ee ("examples/vm_power_mgr: add port initialisation")
Fixes: 361b2e9559 ("acl: new sample l3fwd-acl")
Fixes: de3cfa2c98 ("sched: initial import")
Fixes: d7937e2e3d ("power: initial import")
Fixes: 3fc5ca2f63 ("kni: initial import")
Cc: stable@dpdk.org

Signed-off-by: Ivan Dyukov <i.dyukov@samsung.com>
2020-05-12 04:07:29 +02:00
Vladimir Medvedkin
04fa1906fc examples/ipsec-secgw: remove limitation for crypto sessions
Get rid of hardcoded limit of cryptodev sessions.

Signed-off-by: Vladimir Medvedkin <vladimir.medvedkin@intel.com>
Tested-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
2020-05-11 13:17:43 +02:00
Archana Muniganti
90ecace4f6 examples/fips_validation: fix parsing of algorithms
Few of the NIST TDES test files don't contain TDES string.
Added indicators to identify such files. These indicators
are part of only NIST TDES test vector files.

Fixes: 527cbf3d5e ("examples/fips_validation: support TDES parsing")
Cc: stable@dpdk.org

Signed-off-by: Archana Muniganti <marchana@marvell.com>
Signed-off-by: Ayuj Verma <ayverma@marvell.com>
Acked-by: Anoob Joseph <anoobj@marvell.com>
2020-05-11 13:17:43 +02:00
Praveen Shetty
5ec3eb3b83 examples/ipsec-secgw: fix ESP flow error log
Function create_ipsec_esp_flow returns a negative number in case of any
failure and we are passing this to strerror to display the error message.
But strerror()'s argument cannot be negative.
In case of failure, displaying exact error message to console is handled
in create_ipsec_esp_flow function.
So it is not required to print the error message again using strerror.
This patch will remove the unnecessary calling of strerror function
to fix the negative argument passing to strerror issue.

Coverity issue: 357691
Fixes: 6738c0a956 ("examples/ipsec-secgw: support flow director")

Signed-off-by: Praveen Shetty <praveen.shetty@intel.com>
Acked-by: Lukasz Wojciechowski <l.wojciechow@partner.samsung.com>
Acked-by: Anoob Joseph <anoobj@marvell.com>
2020-05-11 13:17:43 +02:00
Mariusz Drost
9dbc4e21e7 examples/ipsec-secgw: clean up test scripts
As more test cases are defined for execution, test scripts structure
needs to be reorganized, so fewer files are needed to describe the test.
To achieve that, new environment variables are incorporated into the
scripts.
Additionally, tests for mixed tunnel protocols are added.

Signed-off-by: Mariusz Drost <mariuszx.drost@intel.com>
Tested-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
2020-05-11 13:17:43 +02:00
Anatoly Burakov
f4d1e19c29 examples/l3fwd-power: add Rx interrupt timeout
Currently, thread waiting on an interrupt does not have a timeout, so
it will not ever wake up until traffic arrives. This means that, when
time comes to exit the application, it will not quit unless there
happens to be traffic coming in and waking up the thread from sleep.

Fix it so that the interrupt thread sleeps for 10ms before waking up
and attempting to poll again. Additionally, remove the log message
to avoid spamming about entering interrupt mode.

Fixes: 613ce6691c ("examples/l3fwd-power: implement proper shutdown")
Cc: stable@dpdk.org

Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
Acked-by: David Hunt <david.hunt@intel.com>
Tested-by: Lihong Ma <lihongx.ma@intel.com>
2020-05-11 21:33:42 +02:00
Harry van Haaren
2c434431f4 examples/eventdev: fix crash on exit
This commit fixes a segfault on exit by using Ctrl^C if the master lcore
was also being used as a worker core. The root cause of the issue was
that the interrupt handler was cleaning up resources such as the ethdev
and eventdev ports, and once the interrupt handler would return, that
thread would continue working as an eventdev worker, and dereference the
memory which just had free() called on it.

Fixed by moving the cleanup code from the interrupt handler to the
cleanup stage of main(), which the master thread will execute once
it has returned from its worker() functionality.

Fixes: 085edac2ca ("examples/eventdev_pipeline: support Tx adapter")
Cc: stable@dpdk.org

Signed-off-by: Harry van Haaren <harry.van.haaren@intel.com>
Tested-by: Jun W Zhou <junx.w.zhou@intel.com>
2020-05-11 19:20:54 +02:00
Louise Kilheeney
0c2b79e8d5 examples/l2fwd-keepalive: fix mbuf pool size
MBUF pool of size 8192 was causing packet loss when using four ports. To
fix this issue this patch specifies the number of MBUF's per port
instead of having one set MBUF pool size, this way it will adapt to any
number of ports.

Fixes: e64833f227 ("examples/l2fwd-keepalive: add sample application")
Cc: stable@dpdk.org

Signed-off-by: Louise Kilheeney <louise.kilheeney@intel.com>
Tested-by: Xi Zhang <xix.zhang@intel.com>
2020-05-11 17:18:58 +02:00
Ciara Power
eeb486f3ba eal: add telemetry as dependency
This patch moves telemetry further down the build, and adds it as a
dependency for EAL. Telemetry V2 is now configured to build by default,
and the legacy support is built when the telemetry config flag is set.

Telemetry now has EAL flags, shown below:
"--telemetry" = Enables telemetry (this is default if no flags given)
"--no-telemetry" = Disables telemetry

When telemetry is enabled, it will attempt to open the new socket
version, and also the legacy support socket (this will depend on Jansson
external dependency and telemetry config flag, as before).

Signed-off-by: Ciara Power <ciara.power@intel.com>
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Reviewed-by: Keith Wiles <keith.wiles@intel.com>
2020-05-11 00:37:16 +02:00
Ciara Power
a35919a113 examples/l3fwd-power: use new telemetry
The l3fwd-power example app now registers a stats command with
telemetry, and provides a callback function to handle formatting the
power stats.

An example usage is shown below:

Connecting to /var/run/dpdk/rte/dpdk_telemetry.v2
{"version": "DPDK 20.05.0-rc0", "pid": 63384, "max_output_len": 16384}
--> /
{"/": ["/", "/ethdev/link_status", "/ethdev/list", "/ethdev/xstats", \
    "/help", "/info", "/l3fwd-power/stats", "/rawdev/list", \
    "/rawdev/xstats"]}
--> /l3fwd-power/stats
{"/l3fwd-power/stats": {"empty_poll": 281625000, "full_poll": 0, \
    "busy_percent": 0}}

The existing stats tracking done by the app using the metrics
library is unaffected. This will still be used to ensure backward
compatibility.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Signed-off-by: Ciara Power <ciara.power@intel.com>
Reviewed-by: Keith Wiles <keith.wiles@intel.com>
2020-05-11 00:37:15 +02:00
Sunil Kumar Kori
d52e042850 examples/l3fwd: fix error checking
This patch fixes coverity issues regard to error check.

Coverity issue: 354227, 354232, 354238, 354239, 354240
Fixes: aaf58cb85b ("examples/l3fwd: add event port and queue setup")
Cc: stable@dpdk.org

Signed-off-by: Sunil Kumar Kori <skori@marvell.com>
Acked-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
2020-05-01 19:37:17 +02:00
Jin Yu
91d3e2d429 examples/vhost_blk: refactor to increase readability
Refactor the code and make it easier to read. It's
useful for understanding the inflight APIs and how
packed ring works. Update the RST because the packed
ring patch has been merged to QEMU master and ring_packed
parameter changes to packed.

Signed-off-by: Jin Yu <jin.yu@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
2020-05-05 15:54:26 +02:00
Kevin Traynor
f8afd29247 examples/ipsec-gw: fix gcc 10 maybe-uninitialized warning
gcc 10.0.1 reports:

../examples/ipsec-secgw/ipsec_process.c: In function ‘ipsec_process’:
../examples/ipsec-secgw/ipsec_process.c:132:34:
error: ‘grp.m’ may be used uninitialized in this function
 [-Werror=maybe-uninitialized]
  132 |    grp[n].cnt = pkts + i - grp[n].m;
      |                            ~~~~~~^~

This is a correct warning for the initial execution of the statement.
However, it is the design of the loop that grp[0].cnt will later be
written with the correct value using an initialized grp[0].m before it
is used.

In order to remove the warning, initialize grp[0].m for the initial and
unused calculation of grp[0].cnt.

Fixes: 3e5f4625dc ("examples/ipsec-secgw: make data-path to use IPsec library")
Cc: stable@dpdk.org

Suggested-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
Signed-off-by: Kevin Traynor <ktraynor@redhat.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
2020-05-06 11:18:36 +02:00
Nithin Dabilpuram
3087ec1cf4 examples/l3fwd-graph: add graph config and main loop
Add graph creation, configuration logic and graph main loop.
This graph main loop is run on every slave lcore and calls
rte_graph_walk() to walk over lcore specific rte_graph.
Master core accumulates and prints graph walk stats of all the
lcore's graph's.

Signed-off-by: Nithin Dabilpuram <ndabilpuram@marvell.com>
2020-05-05 23:46:11 +02:00
Nithin Dabilpuram
ef853f1fd9 examples/l3fwd-graph: add ethdev configuration changes
Add changes to ethdev port and queue configuration based
on command line parameters for l3fwd graph application.

Signed-off-by: Nithin Dabilpuram <ndabilpuram@marvell.com>
2020-05-05 23:45:48 +02:00
Nithin Dabilpuram
08bd1a1744 examples/l3fwd-graph: add graph-based l3fwd skeleton
Add graph based l3fwd application skeleton with cmdline
parsing support inline with normal l3fwd.

Signed-off-by: Nithin Dabilpuram <ndabilpuram@marvell.com>
2020-05-05 23:42:26 +02:00
Olivier Matz
c0280d5d8a mempool: return 0 if area is too small on populate
Change rte_mempool_populate_iova() and rte_mempool_populate_virt() to
return 0 instead of -EINVAL when there is not enough room to store one
object, as it can be helpful for applications to distinguish this
specific case.

As this is an ABI change, use symbol versioning to preserve old
behavior for binary applications.

Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Acked-by: Andrew Rybchenko <arybchenko@solarflare.com>
Acked-by: Lukasz Wojciechowski <l.wojciechow@partner.samsung.com>
2020-05-05 00:27:05 +02:00
Anatoly Burakov
613ce6691c examples/l3fwd-power: implement proper shutdown
Currently, shutdown for l3fwd-power application is all over the place
and may or may not happen either in the signal handler or in the main()
function. Fix this so that the signal handler will only set the exit
variable, thereby allowing all of the loops to end properly and proceed
to deinitialize everything.

Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
Acked-by: David Hunt <david.hunt@intel.com>
Reviewed-by: Reshma Pattan <reshma.pattan@intel.com>
2020-04-26 23:51:23 +02:00
Anatoly Burakov
a163130bd6 examples/l3fwd-power: exit on power lib init failure
Currently, if power library initialization fails, only a log message is
displayed. This is suboptimal for a number of reasons, but the main one
is that telemetry mode does not depend on the power library and can
therefore run in environments where l3fwd-power would normally not run
correctly (such as inside a VM). This will lead to attempts to
deinitialize the power library on exit, with a subsequent forced unclean
shutdown of DPDK.

Fix this by only initializing the power library in modes that actually
need it, and change a log message to a failure to initialize.

Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
Acked-by: David Hunt <david.hunt@intel.com>
Reviewed-by: Reshma Pattan <reshma.pattan@intel.com>
2020-04-26 23:48:41 +02:00