Commit Graph

1468 Commits

Author SHA1 Message Date
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
Maxime Coquelin
0265a1980f vhost: prefix vDPA enum value for PCI address type
In order to avoid potential conflicts, rename the PCI_ADDR
enum value to VDPA_ADDR_PCI in vdpa_addr_type_enum.

All symbols referencing this enum are experimental, so it
does not break API policy.

Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Acked-by: Matan Azrad <matan@mellanox.com>
2020-04-21 13:57:07 +02:00
Thomas Monjalon
39f59f37ee examples/vhost_blk: use common macro for minimum
The macro RTE_MIN can be used in vhost-blk example.

This change implies fixing the sign of used_len as size_t
as defined in vhost_strcpy_pad().

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Reviewed-by: Tiwei Bie <tiwei.bie@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
2020-04-21 13:57:07 +02:00
Junyu Jiang
8f5b4af736 examples/vmdq: fix RSS configuration
In order that all queues of pools can receive packets,
add enable-rss argument to change RSS configuration.

Fixes: 6bb97df521 ("examples/vmdq: new app")
Cc: stable@dpdk.org

Signed-off-by: Junyu Jiang <junyux.jiang@intel.com>
Acked-by: Xiaoyun Li <xiaoyun.li@intel.com>
Tested-by: Yingya Han <yingyax.han@intel.com>
2020-04-21 13:57:06 +02:00
Junyu Jiang
70c37e3208 examples/vmdq: fix output of pools/queues
To match the pools/queues configuration, the pools/queues output
should start from VMDQ base queue. This patch fixed the issue.

Fixes: 6bb97df521 ("examples/vmdq: new app")
Cc: stable@dpdk.org

Signed-off-by: Junyu Jiang <junyux.jiang@intel.com>
Acked-by: Xiaoyun Li <xiaoyun.li@intel.com>
Tested-by: Yingya Han <yingyax.han@intel.com>
2020-04-21 13:57:05 +02:00
Sunil Kumar Kori
78d44153de ethdev: add tracepoints
Add tracepoints at important and mandatory APIs for tracing support.

Signed-off-by: Sunil Kumar Kori <skori@marvell.com>
Acked-by: David Marchand <david.marchand@redhat.com>
2020-04-23 15:40:06 +02:00
Ankur Dwivedi
f5ad501686 examples/ipsec-secgw: check event adapter errors
The return values of functions are checked before proceeding further.

Coverity issue: 355670, 355671, 355672, 355673
Fixes: 1d89ccf323 ("examples/ipsec-secgw: support event Tx adapter")

Signed-off-by: Ankur Dwivedi <adwivedi@marvell.com>
Acked-by: Anoob Joseph <anoobj@marvell.com>
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
2020-04-19 17:15:14 +02:00
Ankur Dwivedi
ab722af65d examples/ipsec-secgw: remove duplicated check
The two if check does the same task, so removing one.

Coverity issue: 355669
Fixes: 9ad50c29d0 ("examples/ipsec-secgw: add app mode worker")

Signed-off-by: Ankur Dwivedi <adwivedi@marvell.com>
Acked-by: Anoob Joseph <anoobj@marvell.com>
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
2020-04-19 17:15:14 +02:00
Praveen Shetty
6738c0a956 examples/ipsec-secgw: support flow director
Support load distribution in security gateway application using
NIC load distribution feature (Flow Director).
Flow Director is used to redirect the specified inbound ipsec flow
to a specified queue. This is achieved by extending the SA rule syntax
to support specification by adding new action_type of <flow-direction>
to a specified <port_id> <queue_id>.

Signed-off-by: Praveen Shetty <praveen.shetty@intel.com>
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
2020-04-19 17:15:14 +02:00
Anoob Joseph
a8af994b41 examples/ipsec-secgw: support 192/256 AES key sizes
Adding support for the following,
1. AES-192-GCM
2. AES-256-GCM
3. AES-192-CBC

Signed-off-by: Anoob Joseph <anoobj@marvell.com>
Signed-off-by: Tejasree Kondoj <ktejasree@marvell.com>
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
2020-04-19 17:15:14 +02:00
Pavan Nikhilesh
da4eae278b build: add global libatomic dependency for 32-bit clang
Add libatomic as a global dependency when compiling for 32-bit using
clang. As we need libatomic for 64-bit atomic ops.

Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
2020-04-21 11:34:09 +02:00
Ferruh Yigit
d3c9274f76 examples/vm_power_manager: fix build
Build fails because '__rte_unused' macro not defined in file, error
produced by 'i686-native-linux-gcc config' but it seems generic issue.

Build error:
.../examples/vm_power_manager/oob_monitor_nop.c:11:13:
   error: expected ‘;’ before ‘static’
   11 | __rte_unused static float
      |             ^~~~~~~
      |             ;
.../examples/vm_power_manager/oob_monitor_nop.c:12:14:
   error: unknown type name ‘__rte_unused’
   12 | apply_policy(__rte_unused int core)
      |              ^~~~~~~~~~~~
.../examples/vm_power_manager/oob_monitor_nop.c:18:21:
   error: unknown type name ‘__rte_unused’
   18 | add_core_to_monitor(__rte_unused int core)
      |                     ^~~~~~~~~~~~
.../examples/vm_power_manager/oob_monitor_nop.c:24:26:
   error: unknown type name ‘__rte_unused’
   24 | remove_core_from_monitor(__rte_unused int core)
      |                          ^~~~~~~~~~~~

Including 'rte_common.h' header which defines the macro for fix.

Fixes: f2fc83b40f ("replace unused attributes")

Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
2020-04-17 23:22:15 +02:00
Thomas Monjalon
ddcd7640ca replace no-return attributes
The new macro __rte_noreturn, for compiler hinting,
is now used where appropriate for consistency.

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
2020-04-16 18:30:58 +02:00
Thomas Monjalon
f2fc83b40f replace unused attributes
There is a common macro __rte_unused, avoiding warnings,
which is now used where appropriate for consistency.

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
2020-04-16 18:30:58 +02:00
Thomas Monjalon
ef5baf3486 replace packed attributes
There is a common macro __rte_packed for packing structs,
which is now used where appropriate for consistency.

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
2020-04-16 18:16:46 +02:00
Thomas Monjalon
f35e5b3e07 replace alignment attributes
There is a common macro __rte_aligned for alignment,
which is now used where appropriate for consistency.

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Reviewed-by: David Christensen <drc@linux.vnet.ibm.com>
2020-04-16 18:16:18 +02:00
Pavan Nikhilesh
092454d999 examples/l2fwd-event: add option to configure port pairs
Current l2fwd-event application statically configures adjacent ports as
destination ports for forwarding the traffic.

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

If no config 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 config
option is specified.

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

With above config 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: Pavan Nikhilesh <pbhagavatula@marvell.com>
Reviewed-by: Andrzej Ostruszka <aostruszka@marvell.com>
2020-04-04 18:09:51 +02:00
Mariusz Drost
053e1f3c13 examples/ipsec-secgw: enable CPU crypto fallback
Added cpu-crypto fallback option parsing as well as tests for it

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-04-05 18:38:51 +02:00
Lukasz Bartosik
844baa1039 examples/ipsec-secgw: reserve crypto queues in event mode
Reserve minimum number of crypto queues equal to number of ports.
This is to fulfill inline protocol offload requirements.

Signed-off-by: Anoob Joseph <anoobj@marvell.com>
Signed-off-by: Lukasz Bartosik <lbartosik@marvell.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
2020-04-05 18:26:04 +02:00
Lukasz Bartosik
7338a34e01 examples/ipsec-secgw: make number of buffers dynamic
Make number of buffers in a pool nb_mbuf_in_pool dependent on number
of ports, cores and crypto queues. Add command line option -s which
when used overrides dynamic calculation of number of buffers in a pool.

Signed-off-by: Anoob Joseph <anoobj@marvell.com>
Signed-off-by: Lukasz Bartosik <lbartosik@marvell.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
2020-04-05 18:26:04 +02:00
Lukasz Bartosik
9ad50c29d0 examples/ipsec-secgw: add app mode worker
Add application inbound/outbound worker thread and
IPsec application processing code for event mode.

Example ipsec-secgw command in app mode:
ipsec-secgw -w 0002:02:00.0,ipsec_in_max_spi=128
-w 0002:03:00.0,ipsec_in_max_spi=128 -w 0002:0e:00.0 -w 0002:10:00.1
--log-level=8 -c 0x1 -- -P -p 0x3 -u 0x1 -f aes-gcm.cfg
--transfer-mode event --event-schedule-type parallel

Signed-off-by: Anoob Joseph <anoobj@marvell.com>
Signed-off-by: Ankur Dwivedi <adwivedi@marvell.com>
Signed-off-by: Lukasz Bartosik <lbartosik@marvell.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
2020-04-05 18:26:04 +02:00
Lukasz Bartosik
4965dda045 examples/ipsec-secgw: add driver mode worker
Add driver inbound and outbound worker thread for ipsec-secgw. In driver
mode application does as little as possible. It simply forwards packets
back to port from which traffic was received instructing HW to apply
inline security processing using first outbound SA configured for
a given port. If a port does not have SA configured outbound traffic
on that port will be silently dropped. The aim of this mode is to
measure HW capabilities. Driver mode is selected with single-sa option.
The single-sa option accepts SA index however in event mode the SA
index is ignored.

Example command to run ipsec-secgw in driver mode:
ipsec-secgw -w 0002:02:00.0,ipsec_in_max_spi=128
-w 0002:03:00.0,ipsec_in_max_spi=128 -w 0002:0e:00.0 -w 0002:10:00.1
--log-level=8 -c 0x1 -- -P -p 0x3 -u 0x1 -f aes-gcm.cfg
--transfer-mode event --event-schedule-type parallel --single-sa 0

Signed-off-by: Anoob Joseph <anoobj@marvell.com>
Signed-off-by: Ankur Dwivedi <adwivedi@marvell.com>
Signed-off-by: Lukasz Bartosik <lbartosik@marvell.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
2020-04-05 18:26:04 +02:00
Lukasz Bartosik
65e3a202ac examples/ipsec-secgw: add event mode
Add eventmode support to ipsec-secgw. With the aid of event helper
configure and use the eventmode capabilities.

Signed-off-by: Anoob Joseph <anoobj@marvell.com>
Signed-off-by: Lukasz Bartosik <lbartosik@marvell.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
2020-04-05 18:26:04 +02:00
Lukasz Bartosik
bc33e9c7b2 examples/ipsec-secgw: add event helper config init/uninit
Add eventmode helper eh_conf_init and eh_conf_uninit
functions which purpose is to initialize and
uninitialize eventmode helper configuration.

Signed-off-by: Anoob Joseph <anoobj@marvell.com>
Signed-off-by: Lukasz Bartosik <lbartosik@marvell.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
2020-04-05 17:53:13 +02:00
Lukasz Bartosik
ec3cc53f5a examples/ipsec-secgw: support internal ports for events
Add support for Rx and Tx internal ports. When internal ports are
available then a packet can be received from eth port and forwarded
to event queue by HW without any software intervention. The same
applies to Tx side where a packet sent to an event queue can by
forwarded by HW to eth port without any software intervention.

Signed-off-by: Anoob Joseph <anoobj@marvell.com>
Signed-off-by: Lukasz Bartosik <lbartosik@marvell.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
2020-04-05 17:53:47 +02:00
Lukasz Bartosik
1bf6baac4a examples/ipsec-secgw: add event worker launch
In eventmode workers can be drafted differently according to the
capabilities of the underlying event device. The added functions will
receive an array of such workers and probe the eventmode properties to
choose the worker.

Signed-off-by: Anoob Joseph <anoobj@marvell.com>
Signed-off-by: Lukasz Bartosik <lbartosik@marvell.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
2020-04-05 17:53:13 +02:00
Anoob Joseph
4ce384793f examples/ipsec-secgw: add event config display
Add routines to display the eventmode configuration and provide
an overview of the devices used.

Signed-off-by: Anoob Joseph <anoobj@marvell.com>
Signed-off-by: Lukasz Bartosik <lbartosik@marvell.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
2020-04-05 17:53:13 +02:00
Anoob Joseph
1d89ccf323 examples/ipsec-secgw: support event Tx adapter
Add Tx adapter support. The event helper init routine will initialize
the Tx adapter according to the configuration. If Tx adapter config
is not present it will generate a default config.

Signed-off-by: Anoob Joseph <anoobj@marvell.com>
Signed-off-by: Lukasz Bartosik <lbartosik@marvell.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
2020-04-05 17:53:34 +02:00
Anoob Joseph
02afed5925 examples/ipsec-secgw: support event Rx adapter
Add Rx adapter support. The event helper init routine will initialize
the Rx adapter according to the configuration. If Rx adapter config
is not present it will generate a default config. If there are enough
event queues available it will map eth ports and event queues 1:1
(one eth port will be connected to one event queue). Otherwise it
will map all eth ports to one event queue.

Signed-off-by: Anoob Joseph <anoobj@marvell.com>
Signed-off-by: Lukasz Bartosik <lbartosik@marvell.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
2020-04-05 17:53:13 +02:00
Anoob Joseph
d7bcfb9707 examples/ipsec-secgw: add event port-lcore link
Add event device port-lcore link and specify which event queues should
be connected to the event port. Generate a default config for event
port-lcore links if it is not specified in the configuration. This
routine will check the number of available ports and then create links
according to the number of cores available. This patch also adds a new
entry in the eventmode conf to denote that all queues are to be linked
with every port. This enables one core to receive packets from all
ethernet ports.

Signed-off-by: Anoob Joseph <anoobj@marvell.com>
Signed-off-by: Lukasz Bartosik <lbartosik@marvell.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
2020-04-01 12:07:08 +02:00
Anoob Joseph
e0b0e55c8f examples/ipsec-secgw: add framework for event helper
Add framework for eventmode helper. Event mode involves
initialization of multiple devices like eventdev, ethdev
and etc. Add routines to initialize and uninitialize event
device. Generate a default config for event device if it
is not specified in the configuration. Currently event
helper supports single event device only.

Signed-off-by: Anoob Joseph <anoobj@marvell.com>
Signed-off-by: Lukasz Bartosik <lbartosik@marvell.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
2020-04-01 12:07:07 +02:00
Ankur Dwivedi
513f192b5f examples/ipsec-secgw: add default flow for inline Rx
The default flow created would enable security processing on all ESP
packets. If the default flow is created, SA based rte_flow creation
would be skipped.

Signed-off-by: Ankur Dwivedi <adwivedi@marvell.com>
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-04-01 12:07:07 +02:00
Timothy Redaelli
345187bda5 examples/qos_sched: fix build with gcc 10
GCC 10 defaults to -fno-common, this means a linker error will now be
reported if the same global variable is defined in more than one
compilation unit.

Fixes: be1e533238 ("examples/qos_sched: add TC and queue config flexibility")
Cc: stable@dpdk.org

Signed-off-by: Timothy Redaelli <tredaelli@redhat.com>
Acked-by: David Marchand <david.marchand@redhat.com>
2020-03-04 10:25:20 +01:00
Timothy Redaelli
78de15bb58 examples/eventdev: fix build with gcc 10
GCC 10 defaults to -fno-common, this means a linker error will now be
reported if the same global variable is defined in more than one
compilation unit.

Fixes: 3d1b33e44a ("examples/eventdev: move common data into pipeline common")
Cc: stable@dpdk.org

Signed-off-by: Timothy Redaelli <tredaelli@redhat.com>
Acked-by: David Marchand <david.marchand@redhat.com>
2020-03-04 10:24:51 +01:00
Timothy Redaelli
be84899229 examples/vhost_blk: fix build with gcc 10
GCC 10 defaults to -fno-common, this means a linker error will now be
reported if the same global variable is defined in more than one
compilation unit.

Fixes: c19beb3f38 ("examples/vhost_blk: introduce vhost storage sample")
Cc: stable@dpdk.org

Signed-off-by: Timothy Redaelli <tredaelli@redhat.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Acked-by: David Marchand <david.marchand@redhat.com>
2020-03-04 10:24:42 +01:00
Hemant Agrawal
08ab4769c2 add top-level SPDX license tag
This patch adds top level SPDX license identifiers for some of the DPDK
source and scripts, where the copyright owners have not yet agreed to
replace the full BSD-3 license plate.

This patch also add SPDX license tag for a file with no
previous license plates. (DPDK is BSD-3)

Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
2020-02-22 16:11:53 +01:00
Xiaoyun Li
d0e160a002 examples/tep_term: remove redundant info get
Removed redundant function call of 'rte_eth_dev_info_get()' since it has
already been called earlier.

Coverity issue: 349922
Fixes: 2bb43bd435 ("examples/tep_term: add TSO offload configuration")
Cc: stable@dpdk.org

Signed-off-by: Xiaoyun Li <xiaoyun.li@intel.com>
Reviewed-by: Xiaolong Ye <xiaolong.ye@intel.com>
Acked-by: David Marchand <david.marchand@redhat.com>
2020-02-21 11:14:35 +01:00
Anoob Joseph
b1ea86a07c examples/fips_validation: fix string token for CT length
The NIST test vectors use the string 'PTlen' to denote text lengths
in case of encrypt & decrypt operations. So the same string needs to be
used while parsing PT and CT.

Fixes: 2adb3b4e7e ("examples/fips_validation: fix AES-GCM cipher length parsing")

Signed-off-by: Anoob Joseph <anoobj@marvell.com>
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
2020-02-20 16:41:49 +01:00
Ankur Dwivedi
b685f931e1 examples/ipsec-secgw: extend inline session to non AES-GCM
This patch extends creation of inline session to all the algorithms.
Previously the inline session was enabled only for AES-GCM cipher.

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

Signed-off-by: Ankur Dwivedi <adwivedi@marvell.com>
Acked-by: Anoob Joseph <anoobj@marvell.com>
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
2020-02-20 11:16:46 +01:00
Thomas Monjalon
e162f1a751 test/ipsec: fix a typo in function name
The name of the static function check_cryptodev_capablity()
is fixed for the word "capability".
There is no functional change.

The same typo is fixed in a comment in ip_fragmentation example.

Fixes: 05fe65eb66 ("test/ipsec: introduce functional test")
Cc: stable@dpdk.org

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
2020-02-20 11:16:46 +01:00
Stephen Hemminger
16f80fd115 examples/l3fwd: improve destination lookup readability
The functions to lookup IPv4 and IPv6 were both using opaque
pointers (void *) when they should use a typed pointer instead.
The IP headers are not modified during lookup.

Get rid of unnecessary cast on the return from the function.
Replace complex trigraph expression with simple if to improve
readability.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
2020-02-16 21:07:55 +01:00
Stephen Hemminger
6e228d781c examples/l3fwd: make route array constant
The initial route setup array is unmodified by the lpm code
and can be made constant. This depends on earlier patch to
fix the rte_lpm6 to use const.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
2020-02-16 21:07:52 +01:00
Stephen Hemminger
63e5e1f902 examples/l3fwd: make lookup struct static
The lookup structure is only used in the lpm code and does
not have to be global.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
2020-02-16 21:07:45 +01:00
Pavan Nikhilesh
c3a09b17db examples/l2fwd-event: fix core allocation in poll mode
Skip master lcore when assigning cores to rx_queues as it is only used
to print stats.

Fixes: 4ff457986f ("examples/l2fwd-event: add default poll mode routines")
Cc: stable@dpdk.org

Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
2020-02-15 09:07:34 +01:00
Sunil Kumar Kori
8cecdc7e41 examples/l2fwd-event: fix error checking
Patch fixes coverity issues which handle return values from API
calling.

Coverity issue: 350588, 350594, 350598, 350599

Fixes: 3b5476db48 ("examples/l2fwd-event: setup event queue and port")
Cc: stable@dpdk.org

Signed-off-by: Sunil Kumar Kori <skori@marvell.com>
Acked-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
2020-02-15 08:04:46 +01:00
Jin Yu
71dd2870bf examples/vhost_blk: fix check of device path
Fix the time of check time of use warning in example code.
Ignore the errno of unlink failure. There are two situations.
The first one is that file doesn't exist the unlink fails and
it's ok to ignore. The second one is that unlink fails to remove
file but the next bind() would fail too.

Coverity issue: 350589, 158663
Fixes: c19beb3f38 ("examples/vhost_blk: introduce vhost storage sample")
Cc: stable@dpdk.org

Signed-off-by: Jin Yu <jin.yu@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
2020-02-14 12:42:13 +01:00
Marcin Smoczynski
68c28400ec examples/ipsec-secgw: add missing SPDX license tag
Add missing BSD-3 license tag to inline fallback testing scripts.

Signed-off-by: Marcin Smoczynski <marcinx.smoczynski@intel.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
2020-02-13 12:41:04 +01:00
Fan Zhang
2adb3b4e7e examples/fips_validation: fix AES-GCM cipher length parsing
This patch fixes the cipher len keyword typo.

Fixes: 07f5e45532 ("examples/fips_validation: fix cipher length for AES-GCM")

Suggested-by: Akhil Goyal <akhil.goyal@nxp.com>
Signed-off-by: Fan Zhang <roy.fan.zhang@intel.com>
Acked-by: David Marchand <david.marchand@redhat.com>
2020-02-14 16:12:29 +01:00