Commit Graph

1434 Commits

Author SHA1 Message Date
David Hunt
e4d028a0fb examples/vm_power: fix build without i40e
channel_monitor.c was dependent on i40e driver being available.
This is only necessary for the TRAFFIC policy, so use #ifdef's
to not call these when i40e not available.

Fixes: f14791a812 ("examples/vm_power_mgr: add policy to channels")
Cc: stable@dpdk.org

Signed-off-by: David Hunt <david.hunt@intel.com>
Tested-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
2019-10-27 19:38:02 +01:00
Marcin Hajkowski
0de94bcac7 examples/vm_power: send confirmation cmd to guest
Use new guest channel API to send confirmation
message for received power command.

Signed-off-by: Marcin Hajkowski <marcinx.hajkowski@intel.com>
Tested-by: David Hunt <david.hunt@intel.com>
Acked-by: Lee Daly <lee.daly@intel.com>
2019-10-27 19:28:21 +01:00
Marcin Hajkowski
a21f995b53 examples/vm_power: process incoming confirmation cmds
Extend vm_power_guest to check incoming confirmations
of messages previously sent to host.

Signed-off-by: Marcin Hajkowski <marcinx.hajkowski@intel.com>
Tested-by: David Hunt <david.hunt@intel.com>
Acked-by: Lee Daly <lee.daly@intel.com>
2019-10-27 19:27:54 +01:00
Xiao Zhang
0412cfeff9 examples/l3fwd-power: fix Rx interrupt disabling
Interrupt will not be received when disabling RX interrupt without
synchronization mechanism sometimes which leads to wake up issue.
Add spinlock to fix it.

Fixes: b736d64787 ("examples/l3fwd-power: disable Rx interrupt when waking up")
Cc: stable@dpdk.org

Signed-off-by: Xiao Zhang <xiao.zhang@intel.com>
Reviewed-by: Marvin Liu <yong.liu@intel.com>
Acked-by: David Hunt <david.hunt@intel.com>
2019-10-27 18:34:34 +01:00
Feifei Wang
39d21077e5 examples/l3fwd: prefetch the content of the next packet
The cache-misses problem is very serious when the function
lpm_cb_parse_ptype is called to read the content of packets. That is
because the contents of packages previously stored in the cache are
overwritten by the following instructions or variables.
Thus the prefetch order can be used to prefetch the next packet into
the cache to avoid CPU spending too much time on it.

On Octeon TX platform with built-in NIC, 12% performance gain was
measured by running RFC2544 NDR test with l3fwd. Furthermore, the
cache-misses event of the function lpm_cb_parse_ptype was reduced by
20%, and the CPU task-clock of it dropped from 16.49% to 11.3%, based
on the forwarding test for one minute with the 64B packet.
On the dpaa2 platform, no performance improvement nor drop were seen
with this patch by running RFC2544 NDR test with l3fwd.
On the x86 platform, 15.7% performance gain was measured by running
RFC2544 NDR test with l3fwd.

Signed-off-by: Feifei Wang <feifei.wang@arm.com>
Reviewed-by: Gavin Hu <gavin.hu@arm.com>
Reviewed-by: Ruifeng Wang <ruifeng.wang@arm.com>
Reviewed-by: Phil Yang <phil.yang@arm.com>
2019-10-27 18:21:16 +01:00
Marcin Baran
632bcd9b5d examples/ioat: print statistics
Added printing stats of ports each second.  The stats printing is done
using master core.  The information provided informs about packets
received, dropped and send as well as statistics of rawdev devices.

Signed-off-by: Marcin Baran <marcinx.baran@intel.com>
Signed-off-by: Pawel Modrak <pawelx.modrak@intel.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
2019-10-27 18:03:34 +01:00
Pawel Modrak
59694dc5bd examples/ioat: add two threads configuration
Added possibility to use two lcores: first for packet receiving and
copying, second for packets sending.

Signed-off-by: Pawel Modrak <pawelx.modrak@intel.com>
Signed-off-by: Marcin Baran <marcinx.baran@intel.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
2019-10-27 18:03:34 +01:00
Marcin Baran
2328542ed8 examples/ioat: add rawdev copy mode
Added support for copying packets using rawdev device. Each port's Rx queue
is assigned DMA channel for copy.

Signed-off-by: Marcin Baran <marcinx.baran@intel.com>
Signed-off-by: Pawel Modrak <pawelx.modrak@intel.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
2019-10-27 18:03:31 +01:00
Marcin Baran
ae368c96ee examples/ioat: add software copy mode
Added support for copying packets using software copy mode and MAC address
changing. The copies are processed using one lcore.

Signed-off-by: Marcin Baran <marcinx.baran@intel.com>
Signed-off-by: Pawel Modrak <pawelx.modrak@intel.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
2019-10-27 18:02:44 +01:00
Pawel Modrak
c8e6ceeceb examples/ioat: add new sample app for ioat driver
A new sample app demonstrating use of driver for CBDMA.  The app receives
packets, performs software or hardware copy, changes packets' MAC addresses
(if enabled) and forwards them. The change covers ports initialization,
closing connection and argument parsing.

Signed-off-by: Pawel Modrak <pawelx.modrak@intel.com>
Signed-off-by: Marcin Baran <marcinx.baran@intel.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
2019-10-27 17:57:41 +01:00
Bruce Richardson
7f7d44064c examples/vm_power: add guest cli to meson
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: David Hunt <david.hunt@intel.com>
2019-10-27 17:27:46 +01:00
Bruce Richardson
99dc01446e examples/vm_power: fix type of cmdline token in cli
Building the example with clang gives the error:

  error: expression which evaluates to zero treated as a null pointer
  constant of type 'const char *' [-Werror,-Wnon-literal-null-conversion]
                        lcore_id, UINT8);
                                  ^~~~~

This error is due to the wrong data type being given for the
cmd_set_cpu_freq_core_num value - it was specified as string rather than
numeric type.

Fixes: f5e5c3347a ("examples/vm_power: cli in guest")
Cc: stable@dpdk.org

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: David Hunt <david.hunt@intel.com>
2019-10-27 17:25:38 +01:00
Bruce Richardson
32c97c80f2 examples/server_node_efd: add server binary to meson build
When adding to the build, add in two missing includes that prevented build
on freebsd, rather than just duplicating the makefile restriction.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Luca Boccassi <bluca@debian.org>
2019-10-27 17:25:22 +01:00
Bruce Richardson
6186dea09c examples/server_node_efd: add node binary to meson build
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Luca Boccassi <bluca@debian.org>
2019-10-27 17:24:31 +01:00
Bruce Richardson
1af713dc3f examples/performance-thread: add pthread shim to meson
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Luca Boccassi <bluca@debian.org>
2019-10-27 17:24:25 +01:00
Bruce Richardson
64eee69a29 examples/performance-thread: add l3fwd-thread to meson
Limited to x86_64 systems, as it fails to compile on any others and is
disabled in the examples makefile for non-x86_64 systems.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Luca Boccassi <bluca@debian.org>
2019-10-27 17:24:18 +01:00
Bruce Richardson
e9159ef929 examples/performance-thread: remove warning disabling
The warnings about functions not returning values can be removed from the
code by just adding an attribute to the function to specifies it doesn't
return. The GCC bug referenced in the makefile which prevents this from
working has been fixed for >10 years according to bugzilla.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Luca Boccassi <bluca@debian.org>
2019-10-27 17:24:14 +01:00
Bruce Richardson
55bd294cb0 examples/ethtool: build as part of meson build
Since the code for the ethtool example was contained in subdirectories the
compilation of this example is different from most of the other apps, and
it had not been abled when the user requests a build with "-Dexamples=all".

To simplify the build with meson, the separate ethtool library is not build
separately, rather the app is built as a single entity.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Luca Boccassi <bluca@debian.org>
2019-10-27 17:23:13 +01:00
Bruce Richardson
e6d7862834 examples/bpf: remove from list of examples to build
The examples/bpf directory does not contain an example app, but rather
example code for use with testpmd's BPF support. Therefore, we should not
attempt to build it when the user requests "examples=all". This also
synchronises the meson behaviour with make which similarly doesn't compile
up the code.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Luca Boccassi <bluca@debian.org>
2019-10-27 17:23:05 +01:00
Xiaoyun Li
ec4a1d40a5 examples/ntb: add return code checks
This patch adds return value checking and error handling for
rte_rawdev_en/dequeue_buffers() and rte_eth_link_get().

Coverity issue: 350247, 350250, 350251, 350252, 350253, 350254
Fixes: 5194299d6e ("examples/ntb: support more functions")

Signed-off-by: Xiaoyun Li <xiaoyun.li@intel.com>
2019-10-27 13:46:03 +01:00
Igor Ryzhov
49e7e2dee3 kni: add ability to set min/max MTU
Starting with kernel version 4.10, there are new min/max MTU values in
net_device structure, which are set to ETH_MIN_MTU and ETH_DATA_LEN by
default. We should be able to change these values to allow MTU more than
1500 to be set on KNI.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
Acked-by: Ferruh Yigit <ferruh.yigit@intel.com>
2019-10-27 11:07:43 +01:00
Ciara Power
ab6ebd7020 examples/load_balancer: remove example
This example can be removed because DPDK now has a range
of libraries, especially rte_eventdev, that did not exist
previously for load balancing, making this less relevant.
Also, modern NIC cards have greater ability to do load balancing,
e.g. using RSS, over a wider range of fields than earlier cards did.

Signed-off-by: Ciara Power <ciara.power@intel.com>
Acked-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
2019-10-26 22:32:40 +02:00
Ciara Power
d82610b940 examples/netmap-compat: remove example
Rather than providing a shim layer on top of netmap,
we should instead encourage users to create apps using
the DPDK APIs directly.

Signed-off-by: Ciara Power <ciara.power@intel.com>
Acked-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
2019-10-26 22:32:40 +02:00
Ciara Power
46971b273e examples/quota-watermark: remove example
Original DPDK rings code had explicit support for a
single watermark per-ring, but more recent releases of
DPDK had a more general mechanism where each enqueue
or dequeue call could return the remaining elements/free-slots
in the ring.
Therefore, this example is not as relevant as before and can be removed.

Signed-off-by: Ciara Power <ciara.power@intel.com>
Acked-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
2019-10-26 22:32:40 +02:00
Bruce Richardson
bd6e98193a examples/l3fwd-vf: remove example
The main l3fwd app should work with both PF and VF devices, so remove the
VF-only l3fwd example.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
2019-10-26 22:32:40 +02:00
Bruce Richardson
207361b350 examples/exception_path: remove example
The example app shows the use of TUN/TAP with DPDK, but DPDK has a built-in
TAP PMD, so this example is obsolete and so can be removed.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
2019-10-26 22:32:40 +02:00
Jin Yu
19b8d75f64 examples: delete vhost SCSI example
This example is too old and SPDK will not maintain this example
anymore. Also SPDK has submitted a new vhost example vhost-blk.
We will keep on maintaining vhost-blk and It shows the packed
ring and live recovery support.

Signed-off-by: Jin Yu <jin.yu@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
2019-10-25 19:23:22 +02:00
Flavia Musatescu
512d873ff1 net: add new header file for VXLAN
The VXLAN related definitions and structures are moved from
rte_ether.h to a new header file: rte_xvlan.h.

Also introducing a new define macro for VXLAN default port id:
RTE_VXLAN_DEFAULT_PORT

Signed-off-by: Flavia Musatescu <flavia.musatescu@intel.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
Tested-by: Raslan Darawsheh <rasland@mellanox.com>
2019-10-25 19:00:22 +02:00
Konstantin Ananyev
b50bcefdcc examples/bpf: remove duplicate mbuf definition
Get rid of duplicate definitions for rte_mbuf and related macros.
Include rte_mbuf_core.h instead.

Signed-off-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
Acked-by: Michel Machado <michel@digirati.com.br>
2019-10-25 19:33:31 +02:00
Jasvinder Singh
0edf18eee2 sched: add 64-bit values
To support high bandwidth network interfaces, all rates (port,
subport level token bucket and traffic class rates, pipe level
token bucket and traffic class rates) and stats counters defined
in public data structures (rte_sched.h) are modified to support
64 bit counters.

Signed-off-by: Jasvinder Singh <jasvinder.singh@intel.com>
Signed-off-by: Lukasz Krakowiak <lukaszx.krakowiak@intel.com>
Acked-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
2019-10-25 18:07:26 +02:00
Jasvinder Singh
b0c1628b15 examples/qos_sched: add subport config flexibility
Modify qos sample app to allow different subports of the same port
to have different configuration in terms of number of pipes, pipe
queue sizes, etc.

Signed-off-by: Jasvinder Singh <jasvinder.singh@intel.com>
Signed-off-by: Lukasz Krakowiak <lukaszx.krakowiak@intel.com>
2019-10-25 17:53:26 +02:00
Jasvinder Singh
29169a4184 examples/ip_pipeline: add subport config flexibility to TM
Modify ip pipeline traffic management function to allow different
subports of the same port to have different configuration in terms
of number of pipes, pipe queue sizes, etc.

Signed-off-by: Jasvinder Singh <jasvinder.singh@intel.com>
Signed-off-by: Lukasz Krakowiak <lukaszx.krakowiak@intel.com>
2019-10-25 17:53:07 +02:00
Michael Shamis
ae65004fa7 examples/fips_validation: separate ECB and CBC init
Separate initialization of IV, PT and CT according to TDES
ECB and CBC crypto modes

Signed-off-by: Michael Shamis <michaelsh@marvell.com>
Reviewed-by: Marko Kovacevic <marko.kovacevic@intel.com>
2019-10-23 16:57:06 +02:00
Michael Shamis
d3190431b5 examples/fips_validation: support AES ECB
Signed-off-by: Michael Shamis <michaelsh@marvell.com>
Reviewed-by: Marko Kovacevic <marko.kovacevic@intel.com>
2019-10-23 16:57:06 +02:00
Michael Shamis
efe3a8dbb6 examples/fips_validation: support TDES ECB
Signed-off-by: Michael Shamis <michaelsh@marvell.com>
Reviewed-by: Marko Kovacevic <marko.kovacevic@intel.com>
2019-10-23 16:57:06 +02:00
Ferruh Yigit
8532effd32 examples/vm_power: fix build
Fixes: 70febdcfd6 ("examples: check status of getting MAC address")

Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
Tested-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
2019-10-23 16:41:04 +02:00
Nipun Gupta
b21302a107 eventdev: add Tx flag for packets with same destination
This patch introduces a `flag` in the Eth TX adapter enqueue API.
Some drivers may support burst functionality only with the packets
having same destination device and queue.

The flag `RTE_EVENT_ETH_TX_ADAPTER_ENQUEUE_SAME_DEST` can be used
to indicate this so the underlying driver, for drivers to utilize
burst functionality appropriately.

Signed-off-by: Nipun Gupta <nipun.gupta@nxp.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
2019-10-18 10:03:08 +02:00
David Marchand
fe56fe635b examples/ntb: fix build
lcore indexes can't be represented with uint8_t.
Seen on armv8 target:

examples/ntb/ntb_fwd.c: In function ‘cmd_quit_parsed’:
arm64-armv8a-linux-gcc/include/rte_lcore.h:296:8:
error: comparison is always true due to limited range of data type
[-Werror=type-limits]
       i<RTE_MAX_LCORE;      \
        ^
examples/ntb/ntb_fwd.c:164:2: note: in expansion of
macro ‘RTE_LCORE_FOREACH_SLAVE’
  RTE_LCORE_FOREACH_SLAVE(lcore_id) {
  ^~~~~~~~~~~~~~~~~~~~~~~

Fixes: 5194299d6e ("examples/ntb: support more functions")

Signed-off-by: David Marchand <david.marchand@redhat.com>
2019-10-21 17:46:02 +02:00
David Marchand
384b0a33fe clean bare metal support traces
Bare metal support has been gone for quite some time but we still had
some checks on system includes.

Signed-off-by: David Marchand <david.marchand@redhat.com>
Acked-by: Thomas Monjalon <thomas@monjalon.net>
2019-10-21 16:19:00 +02:00
Xiaoyun Li
5194299d6e examples/ntb: support more functions
Support to transmit files between two systems.
Support iofwd between one ethdev and NTB device.
Support rxonly and txonly for NTB device.
Support to set forwarding mode as file-trans, txonly,
rxonly or iofwd.
Support to show/clear port stats and throughput.

Signed-off-by: Xiaoyun Li <xiaoyun.li@intel.com>
Acked-by: Jingjing Wu <jingjing.wu@intel.com>
2019-10-21 15:41:23 +02:00
Jim Harris
61af1713d3 vhost: add missing experimental flag
This function is listed under EXPERIMENTAL in the
rte_vhost_version.map, so it needs to be marked
with __rte_experimental in the header file as well.

Found by check-experimental-syms.sh when trying to compile
DPDK with -finstrument-functions.  This script didn't
catch this in the normal case, since the function is
declared __rte_always_inline.

This also requires updating the vhost_scsi example to allow
use of this newly marked experimental API.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
2019-10-07 15:00:57 +02:00
Ivan Ilchenko
0ecc27f28d examples/ipv4_multicast: check allmulticast enable status
rte_eth_allmulticast_enable()/rte_eth_allmulticast_disable() return
value was changed from void to int, so this patch modify usage
of these functions across examples/ipv4_multicast
according to new return type.

Signed-off-by: Ivan Ilchenko <ivan.ilchenko@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
2019-10-07 15:00:55 +02:00
Igor Romanov
70febdcfd6 examples: check status of getting MAC address
The return value of rte_eth_macaddr_get() was changed from void to int.
Update the usage of the functions according to the new return type.

Signed-off-by: Igor Romanov <igor.romanov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
2019-10-07 15:00:55 +02:00
Igor Romanov
22e5c73bd1 examples: check status of getting link info
The return value of rte_eth_link_get() and rte_eth_link_get_nowait()
was changed from void to int. Update the usage of the functions
according to the new return type.

Signed-off-by: Igor Romanov <igor.romanov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
2019-10-07 15:00:54 +02:00
Ivan Ilchenko
f430bbcecf examples: take promiscuous mode switch result into account
rte_eth_promiscuous_enable()/rte_eth_promiscuous_disable() return
value was changed from void to int, so this patch modify usage
of these functions across examples according to new return type.

Signed-off-by: Ivan Ilchenko <ivan.ilchenko@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
2019-10-07 15:00:54 +02:00
Ivan Ilchenko
b57e35d6e9 kni: check code of promiscuous mode switch
rte_eth_promiscuous_enable()/rte_eth_promiscuous_disable() return
value was changed from void to int, so modify usage of these
functions across lib/librte_kni according to new return type.

Signed-off-by: Ivan Ilchenko <ivan.ilchenko@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
2019-10-07 15:00:54 +02:00
Ivan Ilchenko
089e5ed727 examples: check status of getting ethdev info
rte_eth_dev_info_get() return value was changed from void to
int, so this patch modify rte_eth_dev_info_get() usage across
examples according to its new return type.

Signed-off-by: Ivan Ilchenko <ivan.ilchenko@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2019-10-07 14:45:35 +02:00
Ivan Ilchenko
37fb306c16 examples/vhost: check status of getting ethdev info
rte_eth_dev_info_get() return value was changed from void to
int, so this patch modify rte_eth_dev_info_get() usage across
examples/vhost according to its new return type.

Signed-off-by: Ivan Ilchenko <ivan.ilchenko@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Tiwei Bie <tiwei.bie@intel.com>
2019-10-07 14:45:35 +02:00
Ivan Ilchenko
45069992a3 examples/qos_sched: check status of getting ethdev info
rte_eth_dev_info_get() return value was changed from void to
int, so this patch modify rte_eth_dev_info_get() usage across
examples/qos_sched according to its new return type.

Signed-off-by: Ivan Ilchenko <ivan.ilchenko@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Acked-by: Jasvinder Singh <jasvinder.singh@intel.com>
2019-10-07 14:45:35 +02:00
Ivan Ilchenko
d9a66c56b8 examples/flow_filtering: check status of getting ethdev info
rte_eth_dev_info_get() return value was changed from void to
int, so this patch modify rte_eth_dev_info_get() usage across
examples/flow_filtering according to its new return type.

Signed-off-by: Ivan Ilchenko <ivan.ilchenko@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Acked-by: Ori Kam <orika@mellanox.com>
2019-10-07 14:45:35 +02:00
Ivan Ilchenko
28f90c3583 examples/flow_classify: check status of getting ethdev info
rte_eth_dev_info_get() return value was changed from void to
int, so this patch modify rte_eth_dev_info_get() usage across
examples/flow_classify according to its new return type.

Signed-off-by: Ivan Ilchenko <ivan.ilchenko@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Acked-by: Bernard Iremonger <bernard.iremonger@intel.com>
2019-10-07 14:45:35 +02:00
Ivan Ilchenko
03ad0e5c25 examples/ipsec-secgw: check status of getting ethdev info
rte_eth_dev_info_get() return value was changed from void to
int, so this patch modify rte_eth_dev_info_get() usage across
examples/ipsec-secgw according to its new return type.

Signed-off-by: Ivan Ilchenko <ivan.ilchenko@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
2019-10-07 14:45:35 +02:00
Andrew Rybchenko
78402e16ec ethdev: remove redundant device info cleanup before get
rte_eth_dev_info_get() always fills in device information memory
with zeros on entry.

Fixes: b671987985 ("ethdev: avoid getting uninitialized info for bad port")
Cc: stable@dpdk.org

Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2019-09-20 10:19:42 +02:00
Marcin Smoczynski
f9ee2da6b9 examples/ipsec-secgw: update required Scapy version
Update Scapy version requirement from 2.4.3rc1 to 2.4.3, which has been
used because 2.4.2 had a bug which made this version unable to install.
Accept future versions of Scapy too.

Signed-off-by: Marcin Smoczynski <marcinx.smoczynski@intel.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
2019-10-09 11:50:12 +02:00
Chaitanya Babu Talluri
75b3dddf95 examples/fips_validation: fix null dereferences
One issue caught by Coverity 343408
*deref_parm: Directly dereferencing parameter val->val.

In writeback_tdes_hex_str(), tmp_val is initialised to null.
tmp_val.val is updated only if keys are found.
If keys are not found,it doesn't fails but continues
to invoke writeback_hex_str(),where val->val is accessed
without null check.

The fix is to return the error,
if keys are not found in writeback_tdes_hex_str().

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

Signed-off-by: Chaitanya Babu Talluri <tallurix.chaitanya.babu@intel.com>
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
2019-10-09 11:50:12 +02:00
Marcin Smoczynski
f46aa9859b examples/ipsec-secgw: fix over MTU packet crash
When sending an encrypted packet which size after encapsulation exceeds
MTU, ipsec-secgw application tries to fragment it. If --reassemble
option has not been set it results with a segmantation fault, because
fragmentation buckets have not been initialized.

Fix crashing by adding extra check if --ressemble option has not been
set and packet exceeds MTU after encapsulation - drop it.

Fixes: b01d1cd213 ("examples/ipsec-secgw: support fragmentation and reassembly")
Cc: stable@dpdk.org

Signed-off-by: Marcin Smoczynski <marcinx.smoczynski@intel.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
2019-10-09 11:50:12 +02:00
Akhil Goyal
0d9b0263ce examples/ipsec-secgw: support IPv6 tunnel for lookaside proto
IPv6 tunnels are already supported in case of inline and
lookaside none cases. In case of protocol offload, the details
for IPv6 header need to be added in session configuration
for security session create.

Signed-off-by: Akhil Goyal <akhil.goyal@nxp.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
2019-10-09 11:50:12 +02:00
Michael Shamis
74ac75589d examples/ipsec-secgw: add offload error handling
Added error handler for offload mode.

Signed-off-by: Michael Shamis <michaelsh@marvell.com>
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
2019-10-09 11:50:12 +02:00
Anoob Joseph
1f868d9024 examples/ipsec-secgw: fix access to freed packet
For unknown/unsupported packets, the packet would get checked for inline
offloads after the packet is freed.

Fixes: 0ccfd14bc1 ("examples/ipsec-secgw: support inline protocol")
Cc: stable@dpdk.org

Signed-off-by: Anoob Joseph <anoobj@marvell.com>
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
2019-10-09 11:50:12 +02:00
Bernard Iremonger
23742f21f7 examples/ipsec-secgw: fix unchecked return value
Check the return value of the rte_eth_dev_rss_hash_conf_get function.

Coverity issue: 344970
Fixes: 3a690d5a65 ("examples/ipsec-secgw: fix first packet with inline crypto")
Cc: stable@dpdk.org

Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
2019-10-09 11:50:12 +02:00
Jasvinder Singh
f6feb39c20 examples/qos_meter: fix color type conversion
In APP_MODE_SRTCM_COLOR_AWARE mode, sample app compilation fails
due to wrong meter color type conversion.

error log-
/qos_meter/main.c:error: conversion to incomplete type
(enum rte_meter_color) input_color);

Fixes: c1656328db ("meter: replace color definitions")
Cc: stable@dpdk.org

Reported-by: Yuan Peng <yuan.peng@intel.com>
Signed-off-by: Jasvinder Singh <jasvinder.singh@intel.com>
Acked-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
2019-08-11 00:07:31 +02:00
Jasvinder Singh
4aae2d28ef examples/ip_pipeline: fix TC oversubscription weight
The sched library checks the subport tc ov weight value regardless
of whether RTE_SCHED_SUBPORT_TC_OV flag is enabled or not.

This fix allows application to always set valid tc ov weight value.

error log
SCHED: pipe_profile_check: Incorrect value for tc ov weight
SCHED: rte_sched_port_check_params: Pipe profile check failed(-22)
Command "tmgr" failed.

Fixes: 25961ff3bc ("examples/ip_pipeline: add traffic manager object")
Cc: stable@dpdk.org

Signed-off-by: Jasvinder Singh <jasvinder.singh@intel.com>
Acked-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
2019-08-06 15:22:48 +02:00
Konstantin Ananyev
9a710863de examples/bpf: fix build
Example BPF programs t2.c, t3.c in folder examples/bpf are
failing to compile with latest dpdk.org master.
The reason is changes in some core DPDK header files, that causes
now inclusion of x86 specific headers.
To overcome the issue, minimize inclusion of DPDK header files
into BPF source code.

Bugzilla ID: 321

Fixes: 9dfc06c26a ("test/bpf: add samples")
Cc: stable@dpdk.org

Reported-by: Michel Machado <michel@digirati.com.br>
Suggested-by: Michel Machado <michel@digirati.com.br>
Signed-off-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
2019-08-06 12:30:11 +02:00
Xiaoyun Li
440af660ff examples/ntb: fix error handling
This patch adds return value checking for fseek function to fix
error handling issue found by coverity scan.

Coverity issue: 344996
Fixes: c5eebf85ba ("examples/ntb: add example for NTB")
Cc: stable@dpdk.org

Signed-off-by: Xiaoyun Li <xiaoyun.li@intel.com>
Reviewed-by: Xiaolong Ye <xiaolong.ye@intel.com>
2019-08-06 10:40:54 +02:00
Stephen Hemminger
6f3f0acd95 remove extra blank lines at end of files
There should not be blank lines at end of files.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
2019-08-05 15:19:32 +02:00
Hariprasad Govindharajan
d7f936190e examples/l3fwd: fix unaligned memory access on x86
Fix unaligned memory access when reading IPv6 header which
leads to segmentation fault by changing aligned memory read
to unaligned memory read.

Bugzilla ID: 279
Fixes: 64d3955de1 ("examples/l3fwd: fix ARM build")
Cc: stable@dpdk.org

Signed-off-by: Hariprasad Govindharajan <hariprasad.govindharajan@intel.com>
Reviewed-by: Bruce Richardson <bruce.richardson@intel.com>
Reviewed-by: Jerin Jacob <jerinj@marvell.com>
Reviewed-by: David Christensen <drc@linux.vnet.ibm.com>
Reviewed-by: Herakliusz Lipiec <herakliusz.lipiec@intel.com>
Tested-by: Herakliusz Lipiec <herakliusz.lipiec@intel.com>
2019-07-30 22:05:00 +02:00
Harman Kalra
6f327ba1a3 examples/rxtx_callbacks: fix HW timestamp config
Since all PMDs doesn't implement per queue offload capabilities but
supports RX timestamping and also since rx_offload_capa includes all
rx_queue_offload_capa's. Hence moving the logic to enable HW timestamp
via DEV_RX_OFFLOAD_TIMESTAMP flag before device configuration so that
this application can work with all PMDs.

Fixes: cd1dadeb9b ("examples/rxtx_callbacks: support HW timestamp")

Signed-off-by: Harman Kalra <hkalra@marvell.com>
Reviewed-by: Jerin Jacob <jerinj@marvell.com>
2019-07-30 11:21:49 +02:00
Jasvinder Singh
7f394eebbb examples/qos_sched: add more TC to red configuration
Add RED configuration to more traffic classes in app configuration
files.

Signed-off-by: Jasvinder Singh <jasvinder.singh@intel.com>
Acked-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
2019-07-30 10:19:08 +02:00
Harman Kalra
376aa383e7 examples/ptpclient: fix delay request message
Observed an issue with the length and domain number of the
delay request message sent out by the client. Due to which delay
response from master was not received.

Fixes: ab129e9065 ("examples/ptpclient: add minimal PTP client")
Cc: stable@dpdk.org

Signed-off-by: Harman Kalra <hkalra@marvell.com>
Reviewed-by: Jerin Jacob <jerinj@marvell.com>
2019-07-30 00:11:42 +02:00
Sunil Kumar Kori
ed553e3db4 examples/ip_frag: remove Tx fast free offload flag
Application uses different pool to allocate direct and indirect
mbufs which are further spliced together to consturct a fragmented
packet and same is transmitted over the port which is configured
with DEV_TX_OFFLOAD_MBUF_FAST_FREE enabled i.e. all segments
must belong to the same pool. But constructed packet violates
the conditions.

So fixing DEV_TX_OFFLOAD_MBUF_FAST_FREE flag during device
configuration.

Fixes: fdb9eff67f ("examples/ip_fragmentation: convert to new offloads API")
Cc: stable@dpdk.org

Signed-off-by: Sunil Kumar Kori <skori@marvell.com>
Reviewed-by: Jerin Jacob <jerinj@marvell.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
2019-07-29 23:47:29 +02:00
Xiaolong Ye
abd5ed65ea examples/qos_sched: replace license text with SPDX tag
Signed-off-by: Xiaolong Ye <xiaolong.ye@intel.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
2019-07-29 13:31:45 +02:00
Marcin Zapolski
f0f96b472c examples/ip_frag: fix stale content of ethdev info
The eth_dev_info was used with content that was obsolete. Added update
of struct content prior to use.

Fixes: 6b7780bfeb ("examples/ip_frag: fix use of ethdev internal device array")
Cc: stable@dpdk.org

Signed-off-by: Marcin Zapolski <marcinx.a.zapolski@intel.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
2019-07-22 19:10:31 +02:00
Jasvinder Singh
be1e533238 examples/qos_sched: add TC and queue config flexibility
Update qos sched sample app for configuration flexibility of
pipe traffic classes and queues.

Signed-off-by: Jasvinder Singh <jasvinder.singh@intel.com>
Signed-off-by: Abraham Tovar <abrahamx.tovar@intel.com>
Signed-off-by: Lukasz Krakowiak <lukaszx.krakowiak@intel.com>
2019-07-22 15:43:10 +02:00
Jasvinder Singh
3f2eaa4ce9 examples/ip_pipeline: add config flexibility to TM
Update ip pipeline sample app for configuration flexiblity of
pipe traffic classes and queues.

Signed-off-by: Jasvinder Singh <jasvinder.singh@intel.com>
Signed-off-by: Abraham Tovar <abrahamx.tovar@intel.com>
Signed-off-by: Lukasz Krakowiak <lukaszx.krakowiak@intel.com>
2019-07-22 15:42:59 +02:00
Jasvinder Singh
e16b06da09 sched: remove WRR from strict priority TC queues
All higher priority traffic classes contain only one queue, thus
remove wrr function for them. The lowest priority best-effort
traffic class conitnue to have multiple queues and packet are
scheduled from its queues using wrr function.

Signed-off-by: Jasvinder Singh <jasvinder.singh@intel.com>
Signed-off-by: Abraham Tovar <abrahamx.tovar@intel.com>
Signed-off-by: Lukasz Krakowiak <lukaszx.krakowiak@intel.com>
2019-07-22 15:16:25 +02:00
Bernard Iremonger
f0529ed29c examples/ipsec-secgw: fix inline test scripts
Remove workaround in tun_aesgcm_defs.sh and trs_aesgcm_defs.sh
to get around the bug where the first inbound packet is dropped
for inline crypto.

Fixes: 9297844520 ("examples/ipsec-secgw: add scripts for functional test")
Cc: stable@dpdk.org

Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
2019-07-19 14:32:58 +02:00
Bernard Iremonger
3a690d5a65 examples/ipsec-secgw: fix first packet with inline crypto
Inline crypto installs a flow rule in the NIC. This flow
rule must be installed before the first inbound packet is
received.

The create_session() function installs the flow rule,
create_session() has been refactored into create_inline_session()
and create_lookaside_session(). The create_inline_session() function
uses the socket_ctx data and is now called at initialisation in
sa_add_rules().

The max_session_size() function has been added to calculate memory
requirements.

The cryprodev_init() function has been refactored to drop calls to
rte_mempool_create() and to drop calculation of memory requirements.

The main() function has been refactored to call max_session_size() and
to call session_pool_init() and session_priv_pool_init() earlier.
The ports are started now before adding a flow rule in main().
The sa_init(), sp4_init(), sp6_init() and rt_init() functions are
now called after the ports have been started.

The rte_ipsec_session_prepare() function is called in fill_ipsec_session()
for inline which is called from the ipsec_sa_init() function.

Fixes: ec17993a14 ("examples/ipsec-secgw: support security offload")
Fixes: d299106e8e ("examples/ipsec-secgw: add IPsec sample application")
Cc: stable@dpdk.org

Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
2019-07-19 14:32:46 +02:00
Tao Zhu
37a29f0039 examples/ipsec-secgw: fix --mtu option parsing
This patch add parameter --mtu parse key and enumeration value.

Fixes: b01d1cd213 ("examples/ipsec-secgw: support fragmentation and reassembly")

Signed-off-by: Tao Zhu <taox.zhu@intel.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
Tested-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
2019-07-19 14:15:21 +02:00
Fan Zhang
186b14d685 cryptodev: make xform key pointer constant
This patch changes the key pointer data types in cipher, auth,
and aead xforms from "uint8_t *" to "const uint8_t *" for a
more intuitive and safe sessionn creation.

Signed-off-by: Fan Zhang <roy.fan.zhang@intel.com>
Acked-by: Arek Kusztal <arkadiuszx.kusztal@intel.com>
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
Acked-by: Liron Himi <lironh@marvell.com>
2019-07-19 14:15:21 +02:00
Erik Gabriel Carrillo
b58b3c9675 examples/performance-thread: init timer subsystem
The timer subsystem should be initialized in the l3fwd-thread app before
the L-thread subsystem can be used.

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

Signed-off-by: Erik Gabriel Carrillo <erik.g.carrillo@intel.com>
2019-07-18 23:20:14 +02:00
Haiyue Wang
faa4ee7536 examples/tep_term: remove duplicate definitions
The state of virtio device has been defined in both header file and
source file, keep the definition in header file for public use.

Fixes: a50245ede7 ("examples/tep_term: initialize VXLAN sample")
Cc: stable@dpdk.org

Signed-off-by: Haiyue Wang <haiyue.wang@intel.com>
2019-07-18 23:10:19 +02:00
Konstantin Ananyev
826038fcfc examples/ip_frag: fix unknown ethernet type
Right now app blindly set IPv4 ether type for all non IPv6 packets.
Instead we can save and later restore original type value.

Fixes: 74de12b7b6 ("examples/ip_fragmentation: overhaul")
Cc: stable@dpdk.org

Signed-off-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
2019-07-18 23:07:17 +02:00
Konstantin Ananyev
b869cbc955 examples/ip_frag: fix Tx un-fragmented packets
With latest changes l3fwd_simple_forward() blindly set
(PKT_TX_IPV4 | PKT_TX_IP_CKSUM) ol_flags for all IPv4 packets.
Though for un-fragmented packets we also do have to set l3_len
to make HW IP cksum offload to work properly.
That causes HW/PMD to drop or generate invalid packets.
Though for un-fragmented packets we don't need to regenerate
IPv4 cksum, as L3 header is not modified.
Fix by setting ol_flags only when required.

Fixes: 16863bbb4a ("examples/ip_fragmentation: enable IP checksum offload")

Signed-off-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
2019-07-18 23:05:36 +02:00
Marcin Zapolski
6b7780bfeb examples/ip_frag: fix use of ethdev internal device array
Modify ip_fragmentation example app to use rte_eth_info_get instead
of global rte_eth_devices structure.
Apps should not be using internal DPDK data structures directly.

Fixes: 9758b956dc ("examples/ip_fragmentation: fix Tx queues init")
Cc: stable@dpdk.org

Signed-off-by: Marcin Zapolski <marcinx.a.zapolski@intel.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
2019-07-18 23:05:13 +02:00
Marcin Zapolski
0109baf196 examples/ipsec-secgw: fix use of ethdev internal struct
Modify ipsec-secgw example app to use rte_eth_dev_info_get instead of
rte_eth_dev.
Apps should not be using internal DPDK data structures directly.

Fixes: a4677f7836 ("examples/ipsec-secgw: add target queues in flow actions")
Cc: stable@dpdk.org

Signed-off-by: Marcin Zapolski <marcinx.a.zapolski@intel.com>
Reviewed-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
2019-07-18 23:05:13 +02:00
Marcin Zapolski
5c5c1f99a9 examples: fix use of ethdev internal device array
Modify l3fwd and related example apps to use locally defined port_conf
instead of global rte_eth_devices which is not a part of public API.
Apps should not be using internal DPDK data structures directly.

Fixes: 1ef9600b2d ("examples/l3fwd: convert to ethdev offloads API")
Fixes: ba8c103d24 ("examples/l3fwd-acl: convert to new ethdev offloads API")
Fixes: 40df1d7a69 ("examples/l3fwd-power: convert to new ethdev offloads API")
Fixes: 43fc038262 ("examples/l3fwd-vf: convert to new ethdev offloads API")
Fixes: 373149c631 ("examples/performance-thread: convert to new offloads API")
Cc: stable@dpdk.org

Signed-off-by: Marcin Zapolski <marcinx.a.zapolski@intel.com>
2019-07-18 22:32:45 +02:00
David Hunt
abeef65dfd examples/power: fix policy handling for FIFO
While the core frequency scale-up and scale down all works fine with the
fifo-per-core functionality, there was a gap for policy handling. When
creating or destroying a policy, the core associated with the FIFO
needs to be automatically added to the core list, so the policy is
associated with the correct core.

Fixes: 221e7026d5 ("examples/power: add FIFO per core for JSON interface")

Signed-off-by: David Hunt <david.hunt@intel.com>
Acked-by: Anatoly Burakov <anatoly.burakov@intel.com>
2019-07-17 22:53:38 +02:00
David Hunt
b55d8fec46 examples/l3fwd-power: fix busyness number
Current implementation only outputs 3 numbers for busyness, 0, 50 and 100.
Fix this so that the 50% is replaced by a curve, more meaningful.
This can be replaced in each use case by a suitable calculation for
that use case.

Fixes: 609e79841f ("examples/l3fwd-power: add telemetry mode")

Signed-off-by: David Hunt <david.hunt@intel.com>
Acked-by: Anatoly Burakov <anatoly.burakov@intel.com>
2019-07-17 22:53:28 +02:00
David Hunt
135393d456 examples/power: fix strcpy buffer overrun
replace strcpy with strlcpy to prevent buffer overrun
With fix, attempting to use a VERY lonng vm name results in a nicely
truncated 32 character name rather than a segfault:
Setting VM Name to [sdfdsfsfsdffdsdsasdsadasdakjshd]

Using strlcpy rather than rte_strlcpy, as the rte_ version is only a
fallback.

As well as the fix in main.c, this patch also changes an occurrence of
rte_strlcpy in channel_manager.c and channel_monitor.c to strlcpy.

Fixes: 59287933a0 ("examples/vm_power: add options to guest app")
Cc: stable@dpdk.org

Signed-off-by: David Hunt <david.hunt@intel.com>
Acked-by: Anatoly Burakov <anatoly.burakov@intel.com>
2019-07-16 13:30:58 +02:00
David Hunt
16015fd65a examples/power: fix FreeBSD meson lib dependency
Samples apps that depend on the power library should not build if
the power library is not present. So now the following apps will
check to see if it's built, else skip building.
* l3fwd-pwer
* vm_power_manager
* guest_cli

Fixes: e013078857 ("examples/power: support meson/ninja build")
Fixes: 89f0711f9d ("examples: build some samples with meson")
Cc: stable@dpdk.org

Signed-off-by: David Hunt <david.hunt@intel.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
2019-07-12 10:26:55 +01:00
David Hunt
018faf21d6 examples/l3fwd-power: fix metrics divisions
6 issues caught by Coverity 343465
* Possible divide by zero on 3 lines
* Convert to float then back to int, losing precision on 3 lines

This patch modifies the code so that it only assigns calculated
values if the divisor is > 0, otherwise sets metrics to zero.
Also removes the un-needed round() function.

Coverity issue: 343465
Fixes: 609e79841f ("examples/l3fwd-power: add telemetry mode")

Signed-off-by: David Hunt <david.hunt@intel.com>
2019-07-11 00:00:46 +02:00
Marcin Hajkowski
221e7026d5 examples/power: add FIFO per core for JSON interface
This patch implements a separate FIFO for each cpu core to improve the
previous functionality where anyone with access to the FIFO could affect
any core on the system. By using appropriate permissions, FIFO interfaces
can be configured to only affect the particular cores.

Because each FIFO is per core, the following fields have been removed
from the command JSON format: core_list, resource_id, name.

Signed-off-by: Lukasz Krakowiak <lukaszx.krakowiak@intel.com>
Signed-off-by: Lukasz Gosiewski <lukaszx.gosiewski@intel.com>
Signed-off-by: Marcin Hajkowski <marcinx.hajkowski@intel.com>
Tested-by: David Hunt <david.hunt@intel.com>
Acked-by: Anatoly Burakov <anatoly.burakov@intel.com>
2019-07-10 23:55:07 +02:00
Dilshod Urazov
4fbf332431 examples/ipsec-secgw: fix error sign
rte_errno values should be positive.

Fixes: d299106e8e ("examples/ipsec-secgw: add IPsec sample application")
Cc: stable@dpdk.org

Signed-off-by: Dilshod Urazov <dilshod.urazov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Acked-by: Bernard Iremonger <bernard.iremonger@intel.com>
2019-07-08 12:35:55 +02:00
Phil Yang
016493307a examples/packet_ordering: add stats per worker thread
The current implementation using the '__sync' built-ins to synchronize
statistics within worker threads. The '__sync' built-ins functions are
full barriers which will affect the performance, so add a per worker
packets statistics to remove the synchronisation between worker threads.

Since the maximum core number can get to 256, so disable the per core
stats print in default and add the --insight-worker option to enable it.

For example:
sudo examples/packet_ordering/arm64-armv8a-linuxapp-gcc/packet_ordering \
-l 112-115 --socket-mem=1024,1024 -n 4 -- -p 0x03 --insight-worker

RX thread stats:
 - Pkts rxd:                            226539223
 - Pkts enqd to workers ring:           226539223

Worker thread stats on core [113]:
 - Pkts deqd from workers ring:         77557888
 - Pkts enqd to tx ring:                77557888
 - Pkts enq to tx failed:               0

Worker thread stats on core [114]:
 - Pkts deqd from workers ring:         148981335
 - Pkts enqd to tx ring:                148981335
 - Pkts enq to tx failed:               0

Worker thread stats:
 - Pkts deqd from workers ring:         226539223
 - Pkts enqd to tx ring:                226539223
 - Pkts enq to tx failed:               0

TX stats:
 - Pkts deqd from tx ring:              226539223
 - Ro Pkts transmitted:                 226539168
 - Ro Pkts tx failed:                   0
 - Pkts transmitted w/o reorder:        0
 - Pkts tx failed w/o reorder:          0

Suggested-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
Signed-off-by: Phil Yang <phil.yang@arm.com>
Reviewed-by: Gavin Hu <gavin.hu@arm.com>
2019-07-08 16:33:06 +02:00
Sunil Kumar Kori
31c787678c examples/ip_reassembly: enable IP checksum offload
As per the documentation to use any IP offload features, application
must set required offload flags into mbuf->ol_flags.

Signed-off-by: Sunil Kumar Kori <skori@marvell.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
2019-07-08 11:04:01 +02:00
Sunil Kumar Kori
16863bbb4a examples/ip_fragmentation: enable IP checksum offload
As per the documentation to use any IP offload features, application
must set required offload flags into mbuf->ol_flags.

Signed-off-by: Sunil Kumar Kori <skori@marvell.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
2019-07-08 11:04:01 +02:00
Fan Zhang
1cfd1559b2 examples/ipsec-secgw: support header reconstruction
This patch updates the ipsec-secgw application to support
header reconstruction. In addition a series of tests have
been added to prove the implementation's correctness.

Signed-off-by: Fan Zhang <roy.fan.zhang@intel.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
Tested-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
2019-07-05 15:28:14 +02:00
Konstantin Ananyev
ba3f160318 examples/ipsec-secgw: add bypass test case
Add simple test-case with all traffic in BYPASS mode.
Useful for some basic test of your network environment.

Signed-off-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
2019-07-05 15:28:14 +02:00
Konstantin Ananyev
d06fe6ea67 examples/ipsec-secgw: add multi-segment test cases
Enhance test scripts to support fragmentation/reassemble functionality.

Signed-off-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
2019-07-05 15:28:14 +02:00
Konstantin Ananyev
b01d1cd213 examples/ipsec-secgw: support fragmentation and reassembly
Add optional ability to fragment packet bigger then mtu,
and reassemble fragmented packet.
To minimize possible performance effect, reassembly is
implemented as RX callback.
To support these features ipsec-secgw relies on librte_ipsec ability
to handle multi-segment packets.
Also when reassemble/fragmentation support is enabled, attached
crypto devices have to support 'In Place SGL' offload capability.
To enable/disable this functionality, two new optional command-line
options are introduced:
  --reassemble <val> - number of entries in reassemble table
  --mtu <val> - MTU value for all attached ports
As separate '--mtu' option is introduced, '-j <val>' option is now used
to specify mbuf data buffer size only.

Signed-off-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
2019-07-05 15:28:14 +02:00
Konstantin Ananyev
a135e050ad examples/ipsec-secgw: fix packet length
for packets smaller then 64B some NICs reports pkt_len=64B.
As ipsec-secgw (and librte_ipsec) relies on pkt_len value to determine
payload length, that causes problems for small packets.
To fix the issue, check that pkt_len matches values in IPv4/IPv6 header
and re-adjust pkt_len if necessary.

Fixes: 906257e965 ("examples/ipsec-secgw: support IPv6")
Fixes: d299106e8e ("examples/ipsec-secgw: add IPsec sample application")
Cc: stable@dpdk.org

Signed-off-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
2019-07-05 15:28:14 +02:00
Mariusz Drost
b1a3ac782d examples/ipsec-secgw: fix inline modes
Application ipsec-secgw is not working for IPv4 transport mode and for
IPv6 both transport and tunnel mode.

IPv6 tunnel mode is not working due to wrongly assigned fields of
security association patterns, as it was IPv4, during creation of
inline crypto session.

IPv6 and IPv4 transport mode is iterating through security capabilities
until it reaches tunnel, which causes session to be created as tunnel,
instead of transport. Another issue, is that config file does not
provide source and destination ip addresses for transport mode, which
are required by NIC to perform inline crypto. It uses default addresses
stored in security association (all zeroes), which causes dropped
packages.

To fix that, reorganization of code in create_session() is needed,
to behave appropriately to given protocol (IPv6/IPv4). Change in
iteration through security capabilities is also required, to check
for expected mode (not only tunnel).

For lack of addresses issue, some resolving mechanism is needed.
Approach is to store addresses in security association, as it is
for tunnel mode. Difference is that they are obtained from sp rules,
instead of config file. To do that, sp[4/6]_spi_present() function
is used to find addresses based on spi value, and then stored in
corresponding sa rule. This approach assumes, that every sp rule
for inline crypto have valid addresses, as well as range of addresses
is not supported.

New flags for ipsec_sa structure are required to distinguish between
IPv4 and IPv6 transport modes. Because of that, there is need to
change all checks done on these flags, so they work as expected.

Fixes: ec17993a14 ("examples/ipsec-secgw: support security offload")
Fixes: 9a0752f498 ("net/ixgbe: enable inline IPsec")
Cc: stable@dpdk.org

Signed-off-by: Mariusz Drost <mariuszx.drost@intel.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
Tested-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
2019-07-05 15:28:14 +02:00
Marcin Smoczynski
9a18283a54 examples/ipsec-secgw: add scapy based tests
Add new unittest-like mechanism which uses scapy to craft custom
packets and a set of assertions to check how ipsec-secgw example
application is processing them. Python3 with scapy module is
required by pkttest.sh to run test scripts.

A new mechanism is used to test IPv6 transport mode traffic with
header extensions (trs_ipv6opts.py).

Fix incomplete test log problem by disabling buffering of ipsec-secgw
standard output with stdbuf application.

Signed-off-by: Marcin Smoczynski <marcinx.smoczynski@intel.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
Tested-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
2019-07-05 15:28:14 +02:00
Marcin Smoczynski
1e05895e35 examples/ipsec-secgw: support IPv6 options
Using transport with IPv6 and header extensions requires calculating
total header length including extensions up to ESP header which is
achieved with iteratively parsing extensions when preparing traffic
for processing. Calculated l3_len is later used to determine SPI
field offset for an inbound traffic and to reconstruct L3 header by
librte_ipsec.

Signed-off-by: Marcin Smoczynski <marcinx.smoczynski@intel.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
Tested-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
2019-07-05 15:28:14 +02:00
Anoob Joseph
c9030ae382 cryptodev: add feature flags to disable
Adding a new field, ff_disable, to allow applications to control the
features enabled on the crypto device. This would allow for efficient
usage of HW/SW offloads.

Signed-off-by: Anoob Joseph <anoobj@marvell.com>
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
2019-07-05 15:03:25 +02:00
Fan Zhang
6da6a83ee0 examples/fips_validation: fix logically dead code
Coverity issue: 336866, 336841, 336838
Fixes: 41d561cbdd ("examples/fips_validation: add power on self test")
Cc: stable@dpdk.org

Signed-off-by: Fan Zhang <roy.fan.zhang@intel.com>
Acked-by: Marko Kovacevic <marko.kovacevic@intel.com>
2019-07-05 14:52:25 +02:00
Xiaoyun Li
c5eebf85ba examples/ntb: add example for NTB
Enable an example for rawdev ntb. Support interactive mode to send
file on one host and receive file from another host. The command line
would be 'send [filepath]' and 'receive [filepath]'.

But since the FIFO is not enabled right now, use rte_memcpy as the enqueue
and dequeue functions and only support transmitting file no more than 4M.

Signed-off-by: Xiaoyun Li <xiaoyun.li@intel.com>
Acked-by: Jingjing Wu <jingjing.wu@intel.com>
Reviewed-by: Xiaolong Ye <xiaolong.ye@intel.com>
2019-07-05 12:50:19 +02:00
Lukasz Krakowiak
60dea75f90 examples/power: remove double copy of FIFO path
Removed doubled created fifo path string for channel info.

Signed-off-by: Lukasz Krakowiak <lukaszx.krakowiak@intel.com>
Signed-off-by: Lukasz Gosiewski <lukaszx.gosiewski@intel.com>
Acked-by: David Hunt <david.hunt@intel.com>
2019-07-04 22:42:45 +02:00
Bruce Richardson
4131ad5db7 examples: fix pkg-config detection with older make
Make versions before 4.2 did not have support for the .SHELLSTATUS
variable, so use another method to detect shell success.

Fixes: 22119c4591 ("examples: use pkg-config in makefiles")
Cc: stable@dpdk.org

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Luca Boccassi <bluca@debian.org>
2019-07-03 23:10:23 +02:00
Bruce Richardson
291d090364 examples/vhost_crypto: support build with pkg-config
The vhost_crypto example app did not check for a libdpdk pkg-config file
and attempt to build using that. Add support for that method of compile to
align the app with the other examples.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Luca Boccassi <bluca@debian.org>
2019-07-02 18:12:13 +02:00
Bruce Richardson
f3558ec28f examples/vdpa: support build with pkg-config
The vdpa example app did not check for a libdpdk pkg-config file and
attempt to build using that. Add support for that method of compile to
align the app with the other examples.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Luca Boccassi <bluca@debian.org>
2019-07-02 18:12:05 +02:00
Bruce Richardson
ca9268529d examples: support relocated DPDK install
For testing of DPDK, we want to override the prefix given by the
pkg-config file, so that we can get correct paths for DPDK installed
in an unusual location.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Luca Boccassi <bluca@debian.org>
2019-07-02 18:07:46 +02:00
Bao-Long Tran
a1d9307b2c examples/l3fwd-vf: remove unused Rx/Tx configuration
The RX and TX Prefetch, Host, and Write-back threshold values are
defined but not used anywhere. They are leftovers from a previous
patch.

Fixes: 81f7ecd9 ("examples: use factorized default Rx/Tx configuration")
Cc: stable@dpdk.org

Signed-off-by: Bao-Long Tran <longtb5@viettel.com.vn>
2019-07-01 21:45:31 +02:00
Xiaolong Ye
196a46fab6 examples/flow_filtering: remove out-of-date comment
Now we've setup both rx and tx queues.

Signed-off-by: Xiaolong Ye <xiaolong.ye@intel.com>
Acked-by: Ori Kam <orika@mellanox.com>
2019-06-28 20:32:18 +02:00
Thomas Monjalon
292472ba0b examples/l3fwd-power: fix build with gcc 4
error: ‘for’ loop initial declarations are only allowed in C99 mode

Fixes: 609e79841f ("examples/l3fwd-power: add telemetry mode")

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
2019-06-29 14:29:49 +02:00
Reshma Pattan
609e79841f examples/l3fwd-power: add telemetry mode
Add new telemetry mode support for l3fwd-power.
This is a standalone mode, in this mode l3fwd-power
does simple l3fwding along with calculating
empty polls, full polls, and busy percentage for
each forwarding core. The aggregation of these
values of all cores is reported as application
level telemetry to metric library for every 500ms from the
master core.

The busy percentage is calculated by recording the poll_count
and when the count reaches a defined value the total
cycles it took is measured and compared with minimum and maximum
reference cycles and busy rate is set according to either 0% or
50% or 100%.

Signed-off-by: Reshma Pattan <reshma.pattan@intel.com>
Acked-by: Anatoly Burakov <anatoly.burakov@intel.com>
2019-06-28 11:50:24 +02:00
Marcin Smoczynski
28188cee2a build: enable BSD features visibility for FreeBSD
When a component uses either XOPEN_SOURCE or POSIX_C_SOURCE macro
explicitly in its build recipe, it restricts visibility of a non POSIX
features subset, such as IANA protocol numbers (IPPROTO_* macros).
Non standard features are enabled by default for DPDK both for Linux
thanks to _GNU_SOURCE and for FreeBSD thanks to __BSD_VISIBLE. However
using XOPEN_SOURCE or POSIX_(C_)SOURCE in a component causes
__BSD_VISIBLE to be defined to 0 for FreeBSD, causing different feature
sets visibility for Linux and FreeBSD. It restricts from using IPPROTO
macros in public headers, such as rte_ip.h, despite the fact they are
already widely used in sources.

Add __BSD_VISIBLE macro specified unconditionally for FreeBSD targets
which enforces feature sets visibility unification between Linux and
FreeBSD.

Add single -D_GNU_SOURCE to config/meson.build as a project argument
instead of adding separate directive for each project subtree.

This patch solves the problem of build breaks for [1] on FreeBSD [2]
following the discussion [3].

[1] https://mails.dpdk.org/archives/dev/2019-May/131885.html
[2] http://mails.dpdk.org/archives/test-report/2019-May/082263.html
[3] https://mails.dpdk.org/archives/dev/2019-May/132110.html

Signed-off-by: Marcin Smoczynski <marcinx.smoczynski@intel.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
2019-06-26 16:50:33 +02:00
Fan Zhang
be7a9518da examples/vhost_crypto: remove unused function
This patch tries to fix the coverity issue of unchecked
return value. Since the function that causes the problem
is unused, it is removed completely.

Coverity issue: 336816
Fixes: f5188211c7 ("examples/vhost_crypto: add sample application")
Cc: stable@dpdk.org

Signed-off-by: Fan Zhang <roy.fan.zhang@intel.com>
Reviewed-by: Jens Freimann <jfreimann@redhat.com>
Acked-by: Marko Kovacevic <marko.kovacevic@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
2019-06-20 23:42:04 +02:00
David Marchand
0e34bced78 examples/vdpa: remove trace of legacy linuxapp
This check on Linux environment has been added at a time when we already
had switched to using the boolean RTE_EXEC_ENV_LINUXAPP.
It was then missed when converting to RTE_EXEC_ENV_LINUX.

Fixes: edbed86d1c ("examples/vdpa: introduce a new sample for vDPA")
Fixes: 742bde12f3 ("build/linux: rename macro from LINUXAPP to LINUX")
Cc: stable@dpdk.org

Signed-off-by: David Marchand <david.marchand@redhat.com>
Reviewed-by: Tiwei Bie <tiwei.bie@intel.com>
Reviewed-by: Xiaolong Ye <xiaolong.ye@intel.com>
2019-06-20 23:42:04 +02:00
Tom Barbette
cd1dadeb9b examples/rxtx_callbacks: support HW timestamp
Use rxtx callback to demonstrate a way to use rte_eth_read_clock to
convert the hardware timestamps to an amount of cycles.

This allows to get the amount of time the packet spent since its entry
in the device. While the regular latency only shows the latency from
when it entered the software stack.

Signed-off-by: Tom Barbette <barbette@kth.se>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2019-06-06 20:21:20 +09:00
David Marchand
996839793a examples/multi_process: fix FreeBSD build
Caught on FreeBSD 12:

/usr/include/netinet/ip.h:71:17: error: field 'ip_src' has incomplete type
  struct in_addr ip_src,ip_dst; /* source and dest address */
                 ^~~~~~

On FreeBSD, netinet/ip.h is not auto sufficient like on Linux.
But actually, this header is not used in the example, just remove it.

Fixes: 764bf26873 ("add FreeBSD support")
Cc: stable@dpdk.org

Signed-off-by: David Marchand <david.marchand@redhat.com>
Tested-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
2019-06-05 15:13:06 +02:00
Ali Alnubani
9758b956dc examples/ip_fragmentation: fix Tx queues init
The application tries to configure queue ids larger
than the maximum allowed by MAX_TX_QUEUE_PER_PORT. This
causes the startup error:

"
  ...
  Initializing port 0 on lcore 0... Address:7C:FE:90:12:23:0D
  txq=0,0 txq=1,1 txq=2,2 txq=3,3 txq=4,4 txq=5,5 txq=6,6 txq=7,7 txq=8,8
  txq=9,9 txq=10,10 txq=11,11 txq=12,12 txq=13,13 txq=14,14 txq=15,15
  txq=16,16 Invalid TX queue_id=16

  EAL: Error - exiting with code: 1
    Cause: rte_eth_tx_queue_setup: err=-22, port=0
"

The error reproduces when lcores aren't set, and when the
machine has more than 16 cores.

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

Signed-off-by: Ali Alnubani <alialnu@mellanox.com>
2019-06-04 12:45:41 +02:00
Ali Alnubani
f10aadfd2f examples/multi_process: build with meson
This enables building the example multiprocess applications in
the subdirectory multi_process.

Signed-off-by: Ali Alnubani <alialnu@mellanox.com>
Acked-by: Luca Boccassi <bluca@debian.org>
2019-06-04 12:35:06 +02:00
Ali Alnubani
711d11c696 examples: use child directory as name
This would allow correctly naming an application residing
in a subdirectory. For example, if the example is set to 'path/to/app',
then the name would be 'app'.
This doesn't affect the naming of an example that isn't in a subdirectory.

Signed-off-by: Ali Alnubani <alialnu@mellanox.com>
Acked-by: Luca Boccassi <bluca@debian.org>
2019-06-04 12:34:36 +02:00
Bruce Richardson
f5256f8dfd build: remove unnecessary large file support defines
Since we now always use _FILE_OFFSET_BITS=64 flag when building
DPDK, we can remove the Makefile and C-file #defines setting it
individually for parts of the build.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Luca Boccassi <bluca@debian.org>
2019-06-03 23:55:50 +02:00
David Marchand
0c9da7555d net: replace IPv4/v6 constants with uppercase name
Since we change these macros, we might as well avoid triggering complaints
from checkpatch because of mixed case.

old=RTE_IPv4
new=RTE_IPV4
git grep -lw $old | xargs sed -i -e "s/\<$old\>/$new/g"

old=RTE_ETHER_TYPE_IPv4
new=RTE_ETHER_TYPE_IPV4
git grep -lw $old | xargs sed -i -e "s/\<$old\>/$new/g"

old=RTE_ETHER_TYPE_IPv6
new=RTE_ETHER_TYPE_IPV6
git grep -lw $old | xargs sed -i -e "s/\<$old\>/$new/g"

Signed-off-by: David Marchand <david.marchand@redhat.com>
Reviewed-by: Olivier Matz <olivier.matz@6wind.com>
2019-06-03 16:54:54 +02:00
Stephen Hemminger
2b7a03c50b examples/bond: use lcore accessors
Referring to lcore_config directly is no longer recommended.
Also remove unnecessary assignment of slave_core_id.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Signed-off-by: David Marchand <david.marchand@redhat.com>
2019-06-03 12:30:17 +02:00
David Marchand
4df7d46bbd examples/qos_sched: do not dereference global config struct
Prefer the existing apis rather than direct access the configuration
structure.

Fixes: de3cfa2c98 ("sched: initial import")
Cc: stable@dpdk.org

Signed-off-by: David Marchand <david.marchand@redhat.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
2019-05-30 00:30:17 +02:00
David Marchand
200bc52e5a examples/multi_process: do not dereference global config struct
Prefer the existing apis rather than direct access the configuration
structure.

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

Signed-off-by: David Marchand <david.marchand@redhat.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
2019-05-30 00:29:16 +02:00
Ferruh Yigit
ea6b39b5b8 kni: remove ethtool support
Current design requires kernel drivers and they need to be probed by
Linux up to some level so that they can be usable by DPDK for ethtool
support, this requires maintaining the Linux drivers in DPDK.

Also ethtool support is limited and hard, if not impossible, to expand
to other PMDs.

Since KNI ethtool support is not used commonly, if not used at all,
removing the support for the sake of simplicity and maintenance.

Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Neil Horman <nhorman@tuxdriver.com>
Acked-by: Thomas Monjalon <thomas@monjalon.net>
2019-05-29 23:38:45 +02:00
Michael Santana
f4be6a9a29 fix off-by-one errors in snprintf
snprintf guarantees to always correctly place a null terminator
in the buffer string. So manually placing a null terminator
in a buffer right after a call to snprintf is redundant code.

Additionally, there is no need to use 'sizeof(buffer) - 1' in snprintf as this
means we are not using the last character in the buffer. 'sizeof(buffer)' is
enough.

Cc: stable@dpdk.org

Signed-off-by: Michael Santana <msantana@redhat.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Anatoly Burakov <anatoly.burakov@intel.com>
2019-05-29 13:02:53 +02:00
Olivier Matz
e73e3547ce net: add rte prefix to UDP structure
Add 'rte_' prefix to structures:
- rename struct udp_hdr as struct rte_udp_hdr.

Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
Reviewed-by: Stephen Hemminger <stephen@networkplumber.org>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2019-05-24 13:34:46 +02:00
Olivier Matz
f41b5156fe net: add rte prefix to TCP structure
Add 'rte_' prefix to structures:
- rename struct tcp_hdr as struct rte_tcp_hdr.

Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
Reviewed-by: Stephen Hemminger <stephen@networkplumber.org>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2019-05-24 13:34:46 +02:00
Olivier Matz
09d9ae1ac9 net: add rte prefix to SCTP structure
Add 'rte_' prefix to structures:
- rename struct sctp_hdr as struct rte_sctp_hdr.

Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
Reviewed-by: Stephen Hemminger <stephen@networkplumber.org>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2019-05-24 13:34:46 +02:00
Olivier Matz
24ac604ef7 net: add rte prefix to IP defines
Add 'RTE_' prefix to defines:
- rename IPv4( as RTE_IPv4(.
- rename IPV4_MAX_PKT_LEN as RTE_IPV4_MAX_PKT_LEN.
- rename IPV4_HDR_IHL_MASK as RTE_IPV4_HDR_IHL_MASK.
- rename IPV4_IHL_MULTIPLIER as RTE_IPV4_IHL_MULTIPLIER.
- rename IPV4_HDR_DF_SHIFT as RTE_IPV4_HDR_DF_SHIFT.
- rename IPV4_HDR_MF_SHIFT as RTE_IPV4_HDR_MF_SHIFT.
- rename IPV4_HDR_FO_SHIFT as RTE_IPV4_HDR_FO_SHIFT.
- rename IPV4_HDR_DF_FLAG as RTE_IPV4_HDR_DF_FLAG.
- rename IPV4_HDR_MF_FLAG as RTE_IPV4_HDR_MF_FLAG.
- rename IPV4_HDR_OFFSET_MASK as RTE_IPV4_HDR_OFFSET_MASK.
- rename IPV4_HDR_OFFSET_UNITS as RTE_IPV4_HDR_OFFSET_UNITS.
- rename IPV4_ANY as RTE_IPV4_ANY.
- rename IPV4_LOOPBACK as RTE_IPV4_LOOPBACK.
- rename IPV4_BROADCAST as RTE_IPV4_BROADCAST.
- rename IPV4_ALLHOSTS_GROUP as RTE_IPV4_ALLHOSTS_GROUP.
- rename IPV4_ALLRTRS_GROUP as RTE_IPV4_ALLRTRS_GROUP.
- rename IPV4_MAX_LOCAL_GROUP as RTE_IPV4_MAX_LOCAL_GROUP.
- rename IPV4_MIN_MCAST as RTE_IPV4_MIN_MCAST.
- rename IPV4_MAX_MCAST as RTE_IPV4_MAX_MCAST.
- rename IS_IPV4_MCAST as RTE_IS_IPV4_MCAST.
- rename IPV6_HDR_FL_SHIFT as RTE_IPV6_HDR_FL_SHIFT.
- rename IPV6_HDR_TC_SHIFT as RTE_IPV6_HDR_TC_SHIFT.
- rename IPV6_HDR_FL_MASK as RTE_IPV6_HDR_FL_MASK.
- rename IPV6_HDR_TC_MASK as RTE_IPV6_HDR_TC_MASK.

Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
Reviewed-by: Stephen Hemminger <stephen@networkplumber.org>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2019-05-24 13:34:46 +02:00
Olivier Matz
a7c528e5d7 net: add rte prefix to IP structure
Add 'rte_' prefix to structures:
- rename struct ipv4_hdr as struct rte_ipv4_hdr.
- rename struct ipv6_hdr as struct rte_ipv6_hdr.

Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
Reviewed-by: Stephen Hemminger <stephen@networkplumber.org>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2019-05-24 13:34:46 +02:00
Olivier Matz
5ef2546767 net: add rte prefix to ESP structure
Add 'rte_' prefix to structures:
- rename struct esp_hdr as struct rte_esp_hdr.

Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
Reviewed-by: Stephen Hemminger <stephen@networkplumber.org>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2019-05-24 13:34:45 +02:00
Olivier Matz
35b2d13fd6 net: add rte prefix to ether defines
Add 'RTE_' prefix to defines:
- rename ETHER_ADDR_LEN as RTE_ETHER_ADDR_LEN.
- rename ETHER_TYPE_LEN as RTE_ETHER_TYPE_LEN.
- rename ETHER_CRC_LEN as RTE_ETHER_CRC_LEN.
- rename ETHER_HDR_LEN as RTE_ETHER_HDR_LEN.
- rename ETHER_MIN_LEN as RTE_ETHER_MIN_LEN.
- rename ETHER_MAX_LEN as RTE_ETHER_MAX_LEN.
- rename ETHER_MTU as RTE_ETHER_MTU.
- rename ETHER_MAX_VLAN_FRAME_LEN as RTE_ETHER_MAX_VLAN_FRAME_LEN.
- rename ETHER_MAX_VLAN_ID as RTE_ETHER_MAX_VLAN_ID.
- rename ETHER_MAX_JUMBO_FRAME_LEN as RTE_ETHER_MAX_JUMBO_FRAME_LEN.
- rename ETHER_MIN_MTU as RTE_ETHER_MIN_MTU.
- rename ETHER_LOCAL_ADMIN_ADDR as RTE_ETHER_LOCAL_ADMIN_ADDR.
- rename ETHER_GROUP_ADDR as RTE_ETHER_GROUP_ADDR.
- rename ETHER_TYPE_IPv4 as RTE_ETHER_TYPE_IPv4.
- rename ETHER_TYPE_IPv6 as RTE_ETHER_TYPE_IPv6.
- rename ETHER_TYPE_ARP as RTE_ETHER_TYPE_ARP.
- rename ETHER_TYPE_VLAN as RTE_ETHER_TYPE_VLAN.
- rename ETHER_TYPE_RARP as RTE_ETHER_TYPE_RARP.
- rename ETHER_TYPE_QINQ as RTE_ETHER_TYPE_QINQ.
- rename ETHER_TYPE_ETAG as RTE_ETHER_TYPE_ETAG.
- rename ETHER_TYPE_1588 as RTE_ETHER_TYPE_1588.
- rename ETHER_TYPE_SLOW as RTE_ETHER_TYPE_SLOW.
- rename ETHER_TYPE_TEB as RTE_ETHER_TYPE_TEB.
- rename ETHER_TYPE_LLDP as RTE_ETHER_TYPE_LLDP.
- rename ETHER_TYPE_MPLS as RTE_ETHER_TYPE_MPLS.
- rename ETHER_TYPE_MPLSM as RTE_ETHER_TYPE_MPLSM.
- rename ETHER_VXLAN_HLEN as RTE_ETHER_VXLAN_HLEN.
- rename ETHER_ADDR_FMT_SIZE as RTE_ETHER_ADDR_FMT_SIZE.
- rename VXLAN_GPE_TYPE_IPV4 as RTE_VXLAN_GPE_TYPE_IPV4.
- rename VXLAN_GPE_TYPE_IPV6 as RTE_VXLAN_GPE_TYPE_IPV6.
- rename VXLAN_GPE_TYPE_ETH as RTE_VXLAN_GPE_TYPE_ETH.
- rename VXLAN_GPE_TYPE_NSH as RTE_VXLAN_GPE_TYPE_NSH.
- rename VXLAN_GPE_TYPE_MPLS as RTE_VXLAN_GPE_TYPE_MPLS.
- rename VXLAN_GPE_TYPE_GBP as RTE_VXLAN_GPE_TYPE_GBP.
- rename VXLAN_GPE_TYPE_VBNG as RTE_VXLAN_GPE_TYPE_VBNG.
- rename ETHER_VXLAN_GPE_HLEN as RTE_ETHER_VXLAN_GPE_HLEN.

Do not update the command line library to avoid adding a dependency to
librte_net.

Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
Reviewed-by: Stephen Hemminger <stephen@networkplumber.org>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2019-05-24 13:34:45 +02:00
Olivier Matz
538da7a1ca net: add rte prefix to ether functions
Add 'rte_' prefix to functions:
- rename is_same_ether_addr() as rte_is_same_ether_addr().
- rename is_zero_ether_addr() as rte_is_zero_ether_addr().
- rename is_unicast_ether_addr() as rte_is_unicast_ether_addr().
- rename is_multicast_ether_addr() as rte_is_multicast_ether_addr().
- rename is_broadcast_ether_addr() as rte_is_broadcast_ether_addr().
- rename is_universal_ether_addr() as rte_is_universal_ether_addr().
- rename is_local_admin_ether_addr() as rte_is_local_admin_ether_addr().
- rename is_valid_assigned_ether_addr() as rte_is_valid_assigned_ether_addr().
- rename eth_random_addr() as rte_eth_random_addr().
- rename ether_addr_copy() as rte_ether_addr_copy().
- rename ether_format_addr() as rte_ether_format_addr().

Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
Reviewed-by: Stephen Hemminger <stephen@networkplumber.org>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2019-05-24 13:34:45 +02:00
Olivier Matz
6d13ea8e8e net: add rte prefix to ether structures
Add 'rte_' prefix to structures:
- rename struct ether_addr as struct rte_ether_addr.
- rename struct ether_hdr as struct rte_ether_hdr.
- rename struct vlan_hdr as struct rte_vlan_hdr.
- rename struct vxlan_hdr as struct rte_vxlan_hdr.
- rename struct vxlan_gpe_hdr as struct rte_vxlan_gpe_hdr.

Do not update the command line library to avoid adding a dependency to
librte_net.

Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
Reviewed-by: Stephen Hemminger <stephen@networkplumber.org>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2019-05-24 13:34:45 +02:00
Olivier Matz
e482e0fa6a net: add rte prefix to ARP defines
Add 'RTE_' prefix to defines:
- rename ARP_HRD_ETHER as RTE_ARP_HRD_ETHER.
- rename ARP_OP_REQUEST as RTE_ARP_OP_REQUEST.
- rename ARP_OP_REPLY as RTE_ARP_OP_REPLY.
- rename ARP_OP_REVREQUEST as RTE_ARP_OP_REVREQUEST.
- rename ARP_OP_REVREPLY as RTE_ARP_OP_REVREPLY.
- rename ARP_OP_INVREQUEST as RTE_ARP_OP_INVREQUEST.
- rename ARP_OP_INVREPLY as RTE_ARP_OP_INVREPLY.

Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
Reviewed-by: Stephen Hemminger <stephen@networkplumber.org>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2019-05-24 13:34:44 +02:00
Olivier Matz
f2745bfebc net: add rte prefix to ARP structures
Also rename arp_hrd, arp_pro, arp_hln, arp_pln and arp_op fields
to avoid conflict with the #defines in gnu libc.

Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
Reviewed-by: Stephen Hemminger <stephen@networkplumber.org>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2019-05-24 13:34:44 +02:00
Bruce Richardson
7e9562a107 examples: fix make clean when using pkg-config
The "make clean" command had a number of issues:
- the "--ignore-fail-on-non-empty" flag is not present on BSD
- the call to remove the build folder would fail if there was no build
  folder present.

These are fixed by only removing the build folder if it exists, and by
using -p flag to rmdir in place of --ignore-fail-on-non-empty

Fixes: 22119c4591 ("examples: use pkg-config in makefiles")
Cc: stable@dpdk.org

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Luca Boccassi <bluca@debian.org>
2019-05-20 23:57:47 +02:00
Bruce Richardson
699729bea9 examples: remove auto-generation of examples list
The examples/meson.build file scanned the filesystem to find all examples
to build (for examples=all option) and install. However, using run_command
and scanning the filesystem prevented ninja from properly detecting the
addition or removal of any examples - one had to recreate the build
directory from scratch to guarantee correct detection of all examples. This
patch replaces this generated list with a static list of examples, thereby
allowing proper tracking by ninja/meson, but at the cost of having to
update this file when a new example is added or removed.

This also fixes an issue with Windows builds, since "sh" is not available
there.

Fixes: 2daf565f91 ("examples: install as part of ninja install")
Cc: stable@dpdk.org

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Luca Boccassi <bluca@debian.org>
2019-05-20 23:57:12 +02:00
Bruce Richardson
85d7158edf examples: fix install with empty meson parameter
While the examples were being installed into the appropriate install path
when processing the examples/meson.build file, that file was only processed
if the "examples" meson parameter was non-empty. Since we now do more than
just build the examples, we need to unconditionally process the file.

Fixes: 2daf565f91 ("examples: install as part of ninja install")
Cc: stable@dpdk.org

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Luca Boccassi <bluca@debian.org>
2019-05-20 23:55:50 +02:00
Marcin Smoczynski
96d8ea839b examples/ipsec-secgw: fix build error log
Fix invalid indentation - extra whitespace before error directive which
is causing syntax error when no pkgconfig file for the DPDK is found and
RTE_SDK is not specified.

Fixes: d299106e8e ("examples/ipsec-secgw: add IPsec sample application")
Cc: stable@dpdk.org

Signed-off-by: Marcin Smoczynski <marcinx.smoczynski@intel.com>
2019-05-10 00:19:31 +02:00
David Hunt
8f8f876bd7 examples/power: fix json null termination
coverity complains about a null-termination after a read,
so we terminate once we exit the do-while read loop.

Coverity issue: 337680
Fixes: a63504a90f ("examples/power: add JSON string handling")
Cc: stable@dpdk.org

Signed-off-by: David Hunt <david.hunt@intel.com>
Reviewed-by: Anatoly Burakov <anatoly.burakov@intel.com>
2019-05-03 01:41:42 +02:00
David Hunt
3f1fc5f2cb examples/power: fix buffer overrun
The freqs array in freq_info struct has RTE_MAX_LCORE_FREQS elements,
yet the code can attempt to look at the index at  RTE_MAX_LCORE,
which may be greater than RTE_MAX_LCORE_FREQS. Fix to limit index to
RTE_MAX_LCORE_FREQS.

Coverity issue: 337660
Fixes: d26c18c932 ("examples/vm_power: cpu frequency in host")
Cc: stable@dpdk.org

Signed-off-by: David Hunt <david.hunt@intel.com>
Acked-by: Reshma Pattan <reshma.pattan@intel.com>
2019-05-03 01:38:46 +02:00
Yongseok Koh
7c22ccdd91 examples/multi_process: fix buffer underrun
For client_server_mp, the total number of buffers for the mbuf mempool
should be correctly calculated. Otherwise, having more clients will stop
traffic.

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

Signed-off-by: Yongseok Koh <yskoh@mellanox.com>
2019-05-03 01:33:57 +02:00
Shreyansh Jain
f0a26885b3 examples/l3fwd: support separate buffer pool per port
Traditionally, only a single buffer pool per port
(or, per-port-per-socket) is created in l3fwd application.

If separate pools are created per-port, it might lead to gain in
performance as packet alloc/dealloc requests would be isolated
across ports (and their corresponding lcores).

This patch adds an argument '--per-port-pool' to the l3fwd application.
By default, old mode of single pool per port (split on sockets) is
active.

L3fwd user guide is also updated by this patch.

Signed-off-by: Shreyansh Jain <shreyansh.jain@nxp.com>
Acked-by: Ruifeng Wang <ruifeng.wang@arm.com>
2019-05-03 00:47:58 +02:00