dpdk.git
5 years agonet: add function to convert string to ethernet address
Stephen Hemminger [Fri, 5 Jul 2019 17:16:17 +0000 (10:16 -0700)]
net: add function to convert string to ethernet address

Make a function that can be used in place of eth_aton_r
to convert a string to rte_ether_addr. This function
allows both byte (xx:xx:xx:xx:xx:xx) and word (XXXX:XXXX:XXXX)
format and has the same lack of error handling as the original.

This also allows ethdev to no longer have a hard dependency
on the cmdline library.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Reviewed-by: Andrew Rybchenko <arybchenko@solarflare.com>
5 years agonet: deinline non-critical ethernet functions
Stephen Hemminger [Fri, 5 Jul 2019 17:16:16 +0000 (10:16 -0700)]
net: deinline non-critical ethernet functions

Formatting Ethernet address and getting a random value are
not in critical path so they should not be inlined.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Rami Rosen <ramirose@gmail.com>
Reviewed-by: Andrew Rybchenko <arybchenko@solarflare.com>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
5 years agonet/af_xdp: correct XDP frame size
Xiaolong Ye [Sun, 7 Jul 2019 15:57:05 +0000 (23:57 +0800)]
net/af_xdp: correct XDP frame size

XSK_UMEM__DEFAULT_FRAME_SIZE has been changed to 4096 in kernel commit
123e8da1d330 (xsk: Change the default frame size to 4096 and allow
controlling it),
but we still need to keep ETH_AF_XDP_FRAME_SIZE as 2048 to fit most
dpdk apps.

Signed-off-by: Xiaolong Ye <xiaolong.ye@intel.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
5 years agoapp/testpmd: match GRE key and present bits
Xiaoyu Min [Fri, 5 Jul 2019 09:54:26 +0000 (17:54 +0800)]
app/testpmd: match GRE key and present bits

Support matching on GRE key and present bits (C,K,S)

Example testpmd command could be:
  testpmd>flow create 0 ingress group 1 pattern eth / ipv4 /
  gre / gre_key value is 0x12345678 / end
  actions rss queues 1 0 end / mark id 196 / end

Which will match GRE packet with k present bit set and key value is
0x12345678.

Signed-off-by: Xiaoyu Min <jackmin@mellanox.com>
Acked-by: Ori Kam <orika@mellanox.com>
Acked-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
5 years agoethdev: add GRE key field to flow API
Xiaoyu Min [Fri, 5 Jul 2019 09:54:23 +0000 (17:54 +0800)]
ethdev: add GRE key field to flow API

Add new rte_flow_item_gre_key in order to match the optional key field.

Signed-off-by: Xiaoyu Min <jackmin@mellanox.com>
Acked-by: Ori Kam <orika@mellanox.com>
Acked-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
5 years agonet/mlx5: support matching on ICMP/ICMP6
Xiaoyu Min [Wed, 3 Jul 2019 07:22:49 +0000 (15:22 +0800)]
net/mlx5: support matching on ICMP/ICMP6

On DV/DR flow engine, MLX5 can match on ICMP/ICMP6's code and type field
via FLEX Parser, which can be enabled by config FW using FLEX Parser
profile 2:

mlxconfig -d <mst device> -y set FLEX_PARSER_PROFILE_ENABLE=2

The testpmd commands could be:

  testpmd> flow create 0 ingress pattern eth / ipv4 /
           icmp type is 8 code is 0 / end
   actions rss queues 0 1 end / end

  testpmd> flow create 0 ingress pattern  eth / ipv6 /
           icmp6 type is 128 code is 0 / end
   actions rss queues 0 1 end / end

Signed-off-by: Xiaoyu Min <jackmin@mellanox.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
5 years agonet/mlx5: zero out UDP checksum in encapsulation
Eli Britstein [Thu, 4 Jul 2019 11:16:28 +0000 (11:16 +0000)]
net/mlx5: zero out UDP checksum in encapsulation

Mellanox NICs do not support UDP checksum hardware tx offload over IPv6.
This limitation becomes critical for UDP based tunnels like VXLAN.
Beside the UDP checksum validity is required by IPv6 there is an option
in Linux to allow accepting UDP zero sum (see udp6zerocsumrx in iproute2
package).

This patch zeroes out the UDP checksum field for encapsulation headers
in raw encap action.

Signed-off-by: Eli Britstein <elibr@mellanox.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
5 years agonet/mlx: allow build only on Linux
Thomas Monjalon [Mon, 8 Jul 2019 07:18:04 +0000 (09:18 +0200)]
net/mlx: allow build only on Linux

Currently mlx4/mlx5 support only Linux.

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Matan Azrad <matan@mellanox.com>
5 years agovhost: log virtio and vhost-user negotiated features
Maxime Coquelin [Thu, 20 Jun 2019 20:07:12 +0000 (22:07 +0200)]
vhost: log virtio and vhost-user negotiated features

Having this info logged by default when analysing bug reports
has proved to be useful.

Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Reviewed-by: Tiwei Bie <tiwei.bie@intel.com>
5 years agonet/mvneta: remove resources when port is closed
Yuri Chipchev [Wed, 3 Jul 2019 07:58:12 +0000 (10:58 +0300)]
net/mvneta: remove resources when port is closed

Since 18.11, it is suggested that driver should release all its private
resources at the dev_close routine. So all resources previously released
in remove routine are now released at the dev_close routine, and the
dev_close routine will be called in driver remove routine in order to
support removing a device without closing its ports.

Above behavior changes are supported by setting RTE_ETH_DEV_CLOSE_REMOVE
flag during probe stage.

Signed-off-by: Yuri Chipchev <yuric@marvell.com>
Reviewed-by: Liron Himi <lironh@marvell.com>
5 years agonet/fm10k: fix descriptor filling in vector Tx
Xiao Wang [Wed, 3 Jul 2019 02:53:32 +0000 (10:53 +0800)]
net/fm10k: fix descriptor filling in vector Tx

The shift left operation "pkt->vlan_tci << 16" gets vlan_tci extended
to signed type and may cause invalid descriptor. Also the same issue for
the "data_len" field. This patch fixes it by casting them to uint64_t.

Fixes: 21f13c541eb0 ("fm10k: add vector Tx")
Cc: stable@dpdk.org
Signed-off-by: Xiao Wang <xiao.w.wang@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
5 years agonet/ipn3ke: implement statistics
Andy Pei [Mon, 1 Jul 2019 10:36:28 +0000 (18:36 +0800)]
net/ipn3ke: implement statistics

This patch implements statistics read and reset function for ipn3ke.

Signed-off-by: Andy Pei <andy.pei@intel.com>
Acked-by: Rosen Xu <rosen.xu@intel.com>
5 years agonet/ipn3ke: add stats register and clearing
Andy Pei [Mon, 1 Jul 2019 10:36:25 +0000 (18:36 +0800)]
net/ipn3ke: add stats register and clearing

ipn3ke can work on 10G mode and 25G mode.
10G mode and 25G mode has different MAC register address for statistics.
This patch implements statistics registers for 10G mode and 25G mode.

Also implements different stats clearing per mode.

Fixes: c01c748e4ae6 ("net/ipn3ke: add new driver")
Cc: stable@dpdk.org
Signed-off-by: Andy Pei <andy.pei@intel.com>
Acked-by: Rosen Xu <rosen.xu@intel.com>
5 years agonet/ipn3ke: delete MAC register address mask
Andy Pei [Mon, 1 Jul 2019 10:36:26 +0000 (18:36 +0800)]
net/ipn3ke: delete MAC register address mask

Original code is compatible with older device, whose mac register
address is no more than 10 bits. Now we have mac register address
longer than 10 bits, so we just delete the mask here.

Fixes: c01c748e4ae6 ("net/ipn3ke: add new driver")
Cc: stable@dpdk.org
Signed-off-by: Andy Pei <andy.pei@intel.com>
Acked-by: Rosen Xu <rosen.xu@intel.com>
5 years agonet/i40e: fix unexpected skip FDIR setup
Qi Zhang [Wed, 3 Jul 2019 06:34:49 +0000 (14:34 +0800)]
net/i40e: fix unexpected skip FDIR setup

In i40e_flow_flush_fdir_filter, i40e_fdir_teardown is called, so
i40e_fdir_setup is required to be called before create a new fdir flow.

Bugzilla ID: 265
Fixes: 2e67a7fbf3ff ("net/i40e: config flow director automatically")
Cc: stable@dpdk.org
Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Beilei Xing <beilei.xing@intel.com>
5 years agodoc: add search engine for API
Aideen McLoughlin [Thu, 27 Jun 2019 13:58:19 +0000 (14:58 +0100)]
doc: add search engine for API

I modified the API config file to incorporate a search button into the
API documentation page.

Signed-off-by: Aideen McLoughlin <aideen.mcloughlin@intel.com>
5 years agodoc: add vdev doxygen
Aideen McLoughlin [Wed, 26 Jun 2019 15:20:55 +0000 (16:20 +0100)]
doc: add vdev doxygen

The APIs in the rte_bus_vdev.h file were not part of the API
documentation. I added this header file to the doxygen config file with
the name vdev.

Signed-off-by: Aideen McLoughlin <aideen.mcloughlin@intel.com>
Acked-by: Ferruh Yigit <ferruh.yigit@intel.com>
5 years agodoc: fix link about bifurcated model in Linux guide
Ali Alnubani [Wed, 26 Jun 2019 15:23:06 +0000 (18:23 +0300)]
doc: fix link about bifurcated model in Linux guide

Since dpdksummit.com does not exist anymore,
the old link redirected to https://www.dpdk.org/events/.

Cc: stable@dpdk.org
Signed-off-by: Ali Alnubani <alialnu@mellanox.com>
5 years agodoc: fix a grammar mistake in rawdev guide
Xiaolong Ye [Tue, 4 Jun 2019 08:41:00 +0000 (16:41 +0800)]
doc: fix a grammar mistake in rawdev guide

Fixes: a9bb0c44c775 ("doc: add rawdev library guide and doxygen page")
Cc: stable@dpdk.org
Signed-off-by: Xiaolong Ye <xiaolong.ye@intel.com>
Acked-by: John McNamara <john.mcnamara@intel.com>
Acked-by: Shreyansh Jain <shreyansh.jain@nxp.com>
5 years agohash: load value after full key compare
Honnappa Nagarahalli [Tue, 2 Jul 2019 21:16:34 +0000 (16:16 -0500)]
hash: load value after full key compare

When a hash entry is added, there are 2 sets of stores.

1) The application writes its data to memory (whose address
is provided in rte_hash_add_key_with_hash_data API (or NULL))
2) The rte_hash library writes to its own internal data structures;
key store entry and the hash table.

The only ordering requirement between these 2 is that - store
to the application data must complete before the store to key_index.
There are no ordering requirements between the stores to
key/signature and store to application data. The synchronization
point for application data can be any point between the 'store to
application data' and 'store to the key_index'. So, 'pdata' should not
be a guard variable for the data in hash table. It should be a guard
variable only for the application data written to the memory location
pointed by 'pdata'. Hence, in the lookup functions, 'pdata' can be
loaded after full key comparison succeeds.

The synchronization point for the application data (store-release
to 'pdata' in key store) is changed to be consistent with the order
of loads in lookup function. However, this change is cosmetic and
does not affect the functionality.

Fixes: e605a1d36 ("hash: add lock-free r/w concurrency")
Cc: stable@dpdk.org
Signed-off-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
Reviewed-by: Gavin Hu <gavin.hu@arm.com>
Tested-by: Ruifeng Wang <ruifeng.wang@arm.com>
Acked-by: Yipeng Wang <yipeng1.wang@intel.com>
5 years agohash: use ordered loads only if signature matches
Honnappa Nagarahalli [Tue, 2 Jul 2019 21:16:33 +0000 (16:16 -0500)]
hash: use ordered loads only if signature matches

Relaxed signature comparison is done first. Further ordered loads
are done only if the signature matches. Any false positives are
caught by the full key comparison. This provides performance
benefits as load-acquire is executed only when required.

Fixes: e605a1d36 ("hash: add lock-free r/w concurrency")
Cc: stable@dpdk.org
Signed-off-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
Reviewed-by: Gavin Hu <gavin.hu@arm.com>
Tested-by: Ruifeng Wang <ruifeng.wang@arm.com>
Acked-by: Yipeng Wang <yipeng1.wang@intel.com>
5 years agoevent/octeontx2: add Tx adapter
Pavan Nikhilesh [Thu, 4 Jul 2019 02:19:39 +0000 (07:49 +0530)]
event/octeontx2: add Tx adapter

Add event eth Tx adapter support to octeontx2 SSO.

Signed-off-by: Jerin Jacob <jerinj@marvell.com>
Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
Signed-off-by: Nithin Dabilpuram <ndabilpuram@marvell.com>
5 years agoevent/octeontx2: support PTP for SSO
Harman Kalra [Thu, 4 Jul 2019 02:19:38 +0000 (07:49 +0530)]
event/octeontx2: support PTP for SSO

Add PTP support for SSO based on rx_offloads of the queue connected to
it.

Signed-off-by: Harman Kalra <hkalra@marvell.com>
Signed-off-by: Nithin Dabilpuram <ndabilpuram@marvell.com>
Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
5 years agoevent/octeontx2: add Rx adapter fastpath ops
Pavan Nikhilesh [Thu, 4 Jul 2019 02:19:37 +0000 (07:49 +0530)]
event/octeontx2: add Rx adapter fastpath ops

Add support for event eth Rx adapter fastpath operations.

Signed-off-by: Jerin Jacob <jerinj@marvell.com>
Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
Signed-off-by: Nithin Dabilpuram <ndabilpuram@marvell.com>
5 years agoevent/octeontx2: resize SSO in-flight buffers
Pavan Nikhilesh [Thu, 4 Jul 2019 02:19:36 +0000 (07:49 +0530)]
event/octeontx2: resize SSO in-flight buffers

Resize SSO internal in-flight buffer count based on the Rx queues
mempool size connected to event queues.

Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
5 years agoevent/octeontx2: add Rx adapter
Pavan Nikhilesh [Thu, 4 Jul 2019 02:19:35 +0000 (07:49 +0530)]
event/octeontx2: add Rx adapter

Add event eth Rx adapter capabilities, queue add and delete functions.

Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
Signed-off-by: Jerin Jacob <jerinj@marvell.com>
5 years agoapp/eventdev: optimize producer routine
Pavan Nikhilesh [Wed, 3 Jul 2019 05:51:35 +0000 (11:21 +0530)]
app/eventdev: optimize producer routine

When using synthetic and timer event producer reduce the calls made to
mempool library by using get_bulk() instead of get().

Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
5 years agoevent/opdl: fix error sign
Dilshod Urazov [Thu, 4 Jul 2019 10:03:32 +0000 (11:03 +0100)]
event/opdl: fix error sign

Fixes: 0bf298e39286 ("event/opdl: add event port config get/set")
Fixes: 3c7f3dcfb099 ("event/opdl: add PMD main body and helper function")
Fixes: 4236ce9bf5bf ("event/opdl: add OPDL ring infrastructure library")
Cc: stable@dpdk.org
Signed-off-by: Dilshod Urazov <dilshod.urazov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: David Marchand <david.marchand@redhat.com>
5 years agoevent/sw: fix error sign
Dilshod Urazov [Thu, 4 Jul 2019 10:03:31 +0000 (11:03 +0100)]
event/sw: fix error sign

Fixes: 371a688fc159 ("event/sw: support linking queues to ports")
Cc: stable@dpdk.org
Signed-off-by: Dilshod Urazov <dilshod.urazov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Acked-by: Harry van Haaren <harry.van.haaren@intel.com>
5 years agoeventdev: fix error sign
Dilshod Urazov [Thu, 4 Jul 2019 10:03:30 +0000 (11:03 +0100)]
eventdev: fix error sign

Fixes: c9bf83947e2e ("eventdev: add eth Tx adapter APIs")
Fixes: 47d05b292820 ("eventdev: add timer adapter common code")
Fixes: 6750b21bd6af ("eventdev: add default software timer adapter")
Fixes: c75f7897ea35 ("eventdev: set error code in port link/unlink functions")
Fixes: 7d1acc9dde93 ("eventdev: introduce helper function for enqueue burst")
Fixes: 406aed4e0dd9 ("eventdev: add errno-style return values")
Fixes: cc7b73ea9e3b ("eventdev: add new software timer adapter")
Cc: stable@dpdk.org
Signed-off-by: Dilshod Urazov <dilshod.urazov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: David Marchand <david.marchand@redhat.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
5 years agoexamples/ipsec-secgw: fix error sign
Dilshod Urazov [Fri, 5 Jul 2019 12:18:09 +0000 (13:18 +0100)]
examples/ipsec-secgw: fix error sign

rte_errno values should be positive.

Fixes: d299106e8e31 ("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>
5 years agotest/ring: replace sync with atomic builtins
Phil Yang [Mon, 8 Apr 2019 03:02:31 +0000 (11:02 +0800)]
test/ring: replace sync with atomic builtins

'__sync' built-in functions are deprecated, should use the '__atomic'
built-in instead. the sync built-in functions are full barriers, while
atomic built-in functions offer less restrictive one-way barriers,
which help performance.

Here is the example test result on TX2:
sudo ./arm64-armv8a-linuxapp-gcc/app/test -c 0x7fffffe \
-n 4 --socket-mem=1024,0 --file-prefix=~ -- -i
RTE>>ring_perf_autotest

*** ring_perf_autotest without this patch ***
SP/SC bulk enq/dequeue (size: 8): 6.22
MP/MC bulk enq/dequeue (size: 8): 11.50
SP/SC bulk enq/dequeue (size: 32): 1.85
MP/MC bulk enq/dequeue (size: 32): 2.66

*** ring_perf_autotest with this patch ***
SP/SC bulk enq/dequeue (size: 8): 6.13
MP/MC bulk enq/dequeue (size: 8): 9.83
SP/SC bulk enq/dequeue (size: 32): 1.96
MP/MC bulk enq/dequeue (size: 32): 2.30

So for the ring performance test, this patch improved 11% of ring
operations performance.

Signed-off-by: Phil Yang <phil.yang@arm.com>
Reviewed-by: Gavin Hu <gavin.hu@arm.com>
Reviewed-by: Joyce Kong <joyce.kong@arm.com>
Reviewed-by: Dharmik Thakkar <dharmik.thakkar@arm.com>
5 years agotest/distributor: replace sync with atomic builtins
Phil Yang [Mon, 8 Apr 2019 03:02:30 +0000 (11:02 +0800)]
test/distributor: replace sync with atomic builtins

'__sync' built-in functions are deprecated, should use the '__atomic'
built-in instead. the sync built-in functions are full barriers, while
atomic built-in functions offer less restrictive one-way barriers,
which help performance.

Here is the example test result on TX2:
sudo ./arm64-armv8a-linuxapp-gcc/app/test -l 112-139 \
-n 4 --socket-mem=1024,1024 -- -i
RTE>>distributor_perf_autotest

*** distributor_perf_autotest without this patch ***
==== Cache line switch test ===
Time for 33554432 iterations = 1519202730 ticks
Ticks per iteration = 45

*** distributor_perf_autotest with this patch ***
==== Cache line switch test ===
Time for 33554432 iterations = 1251715496 ticks
Ticks per iteration = 37

Less ticks needed for the cache line switch test. It got 17% of
performance improvement.

Signed-off-by: Phil Yang <phil.yang@arm.com>
Reviewed-by: Gavin Hu <gavin.hu@arm.com>
Reviewed-by: Ruifeng Wang <ruifeng.wang@arm.com>
Reviewed-by: Joyce Kong <joyce.kong@arm.com>
Reviewed-by: Dharmik Thakkar <dharmik.thakkar@arm.com>
Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
5 years agoexamples/packet_ordering: add stats per worker thread
Phil Yang [Mon, 8 Apr 2019 03:02:29 +0000 (11:02 +0800)]
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>
5 years agocommon/octeontx2: cleanup void returns
Krzysztof Kanas [Mon, 8 Jul 2019 12:18:32 +0000 (14:18 +0200)]
common/octeontx2: cleanup void returns

mbox_unregister_vf_irq and mbox_unregister_pf_irq returns void value.
mbox_unregister_irq also returns void.

Clang with flags '-Wall -Wextra -pedantic' complains about:
void function should not return void expression

Signed-off-by: Krzysztof Kanas <kkanas@marvell.com>
5 years agoservice: promote experimental functions to stable
Gage Eads [Thu, 20 Jun 2019 19:02:27 +0000 (14:02 -0500)]
service: promote experimental functions to stable

The functions rte_service_may_be_active(), rte_service_lcore_attr_get(),
and rte_service_attr_reset_all() were introduced nearly a year ago in DPDK
18.08. They can be considered non-experimental for the 19.08 release.

rte_service_may_be_active() is used by the sw PMD, and this commit allows
it to not need any experimental API.

Signed-off-by: Gage Eads <gage.eads@intel.com>
5 years agomempool/octeontx2: fix pool populating
Vamsi Attunuru [Mon, 8 Jul 2019 04:47:31 +0000 (10:17 +0530)]
mempool/octeontx2: fix pool populating

Fix npa pool range errors observed while creating mempool, this issue
happens when mempool objects are from different mem segments.

During mempool creation, octeontx2 mempool driver populates pool range
fields before enqueuing the buffers. If any enqueue or dequeue operation
reaches npa hardware prior to the range field's HW context update,
those ops result in npa range errors. Patch adds a routine to read back
HW context and verify if range fields are updated or not.

Fixes: e5271c507aeb ("mempool/octeontx2: add remaining slow path ops")

Signed-off-by: Vamsi Attunuru <vattunuru@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
5 years agoexamples/ip_reassembly: enable IP checksum offload
Sunil Kumar Kori [Mon, 8 Jul 2019 04:33:00 +0000 (10:03 +0530)]
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>
5 years agoexamples/ip_fragmentation: enable IP checksum offload
Sunil Kumar Kori [Mon, 8 Jul 2019 04:32:59 +0000 (10:02 +0530)]
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>
5 years agoip_frag: remove IP checkum offload flag
Sunil Kumar Kori [Mon, 8 Jul 2019 04:32:58 +0000 (10:02 +0530)]
ip_frag: remove IP checkum offload flag

Currently PKT_TX_IP_CKSUM is being set into mbuf->ol_flags
during fragmentation and reassemble operation implicitly.
Because of this, application is forced to use checksum offload
whether it is supported by platform or not.

Also documentation does not provide any expected value of ol_flags
in returned mbuf (reassembled or fragmented) so application will never
come to know that which offloads are enabled. So transmission may be failed
for the platforms which does not support checksum offload.

Also, IPv6 does not contain any checksum field in header so setting
mbuf->ol_flags with PKT_TX_IP_CKSUM is itself invalid.

So removing mentioned flag from the library.

Signed-off-by: Sunil Kumar Kori <skori@marvell.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
5 years agoeal: fix typo in comments
Krzysztof Kanas [Tue, 4 Jun 2019 09:21:26 +0000 (11:21 +0200)]
eal: fix typo in comments

Fixes: a753e53d517b ("eal: add device event monitor framework")
Fixes: af75078fece3 ("first public release")
Cc: stable@dpdk.org
Signed-off-by: Krzysztof Kanas <kkanas@marvell.com>
5 years agotest/mcslock: add MCS queued lock unit test
Phil Yang [Fri, 5 Jul 2019 10:27:08 +0000 (18:27 +0800)]
test/mcslock: add MCS queued lock unit test

Unit test and perf test for MCS queued lock.

Signed-off-by: Phil Yang <phil.yang@arm.com>
Reviewed-by: Gavin Hu <gavin.hu@arm.com>
Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
5 years agomcslock: add MCS queued lock implementation
Phil Yang [Fri, 5 Jul 2019 10:27:06 +0000 (18:27 +0800)]
mcslock: add MCS queued lock implementation

If there are multiple threads contending, they all attempt to take the
spinlock lock at the same time once it is released. This results in a
huge amount of processor bus traffic, which is a huge performance
killer. Thus, if we somehow order the lock-takers so that they know who
is next in line for the resource we can vastly reduce the amount of bus
traffic.

This patch added MCS lock library. It provides scalability by spinning
on a CPU/thread local variable which avoids expensive cache bouncings.
It provides fairness by maintaining a list of acquirers and passing the
lock to each CPU/thread in the order they acquired the lock.

Signed-off-by: Phil Yang <phil.yang@arm.com>
Reviewed-by: Steve Capper <steve.capper@arm.com>
Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
Reviewed-by: Gavin Hu <gavin.hu@arm.com>
5 years agovfio: retry creating sPAPR DMA window
Takeshi Yoshimura [Fri, 7 Jun 2019 02:28:29 +0000 (11:28 +0900)]
vfio: retry creating sPAPR DMA window

sPAPR allows only page_shift from VFIO_IOMMU_SPAPR_TCE_GET_INFO ioctl.
However, Linux 4.17 or before returns incorrect page_shift for Power9.
I added the code for retrying creation of sPAPR DMA window.

Signed-off-by: Takeshi Yoshimura <tyos@jp.ibm.com>
Acked-by: Anatoly Burakov <anatoly.burakov@intel.com>
5 years agonet/dpaa: support interface init for multi-process
Akhil Goyal [Tue, 25 Jun 2019 10:40:19 +0000 (16:10 +0530)]
net/dpaa: support interface init for multi-process

The existing code is enabling the Tx queues as per
the number of lcore count, which is causing issue
in case of secondary process running on different number
of cores.
This patch fixes the Tx queues to number of DPAA cores,
which helps in using fixed number of Tx queues across
processes access.

Signed-off-by: Akhil Goyal <akhil.goyal@nxp.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
5 years agobus/dpaa: update mempool for secondary process
Hemant Agrawal [Tue, 25 Jun 2019 10:40:18 +0000 (16:10 +0530)]
bus/dpaa: update mempool for secondary process

1. need to use the bpool with rte_malloc instead of rte_free
2. Option to give portal to the secondary process thread.

Signed-off-by: Radu Bulie <radu-andrei.bulie@nxp.com>
Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
Tested-by: Akhil Goyal <akhil.goyal@nxp.com>
5 years agobus/dpaa: support hotplug ops
Shreyansh Jain [Tue, 25 Jun 2019 10:40:17 +0000 (16:10 +0530)]
bus/dpaa: support hotplug ops

Parse and find_device have specific function - former is for parsing a
string passed as argument, whereas the later is for iterating over all
the devices in the bus and calling a callback/handler. They have been
corrected with their right operations to support hotplugging/devargs
plug/unplug calls.

Support for plug/unplug too has been added.

Signed-off-by: Shreyansh Jain <shreyansh.jain@nxp.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
5 years agoexamples/ipsec-secgw: support header reconstruction
Fan Zhang [Thu, 4 Jul 2019 10:42:36 +0000 (11:42 +0100)]
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>
5 years agoipsec: support header construction
Fan Zhang [Thu, 4 Jul 2019 10:42:35 +0000 (11:42 +0100)]
ipsec: support header construction

Add support for RFC 4301(5.1.2) to update of
Type of service field and Traffic class field
bits inside ipv4/ipv6 packets for outbound cases
and inbound cases which deals with the update of
the DSCP/ENC bits inside each of the fields.

Signed-off-by: Marko Kovacevic <marko.kovacevic@intel.com>
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>
5 years agoapp/bbdev: add test vectors for 5GNR
Nicolas Chautru [Wed, 3 Jul 2019 15:24:10 +0000 (08:24 -0700)]
app/bbdev: add test vectors for 5GNR

Adding LDPC vectors for UT verification, coverage,
and profiling for 5GNR encode/decode operations.

Signed-off-by: Nicolas Chautru <nicolas.chautru@intel.com>
Acked-by: Amr Mokhtar <amr.mokhtar@intel.com>
5 years agoapp/bbdev: update for 5GNR
Nicolas Chautru [Wed, 3 Jul 2019 15:24:09 +0000 (08:24 -0700)]
app/bbdev: update for 5GNR

Extending test framework for FEC 5GNR operations
for UT verification and profiling.

Signed-off-by: Nicolas Chautru <nicolas.chautru@intel.com>
Acked-by: Amr Mokhtar <amr.mokhtar@intel.com>
5 years agodoc: update turbo_sw build steps in bbdev guide
Nicolas Chautru [Wed, 3 Jul 2019 15:24:08 +0000 (08:24 -0700)]
doc: update turbo_sw build steps in bbdev guide

This now includes steps to build with either
libraries for AVX2, or AVX512 or no dependency.

Signed-off-by: Nicolas Chautru <nicolas.chautru@intel.com>
Acked-by: Amr Mokhtar <amr.mokhtar@intel.com>
5 years agobaseband/turbo_sw: extend for 5G
Nicolas Chautru [Wed, 3 Jul 2019 15:24:07 +0000 (08:24 -0700)]
baseband/turbo_sw: extend for 5G

Implementation still based on Intel SDK libraries
optimized for AVX512 instructions set and 5GNR.
This can be also build for AVX2 for 4G capability or
without SDK dependency for maintenance.

Signed-off-by: Nicolas Chautru <nicolas.chautru@intel.com>
Acked-by: Amr Mokhtar <amr.mokhtar@intel.com>
5 years agodoc: update bbdev guide for 5GNR operations
Nicolas Chautru [Wed, 3 Jul 2019 15:24:06 +0000 (08:24 -0700)]
doc: update bbdev guide for 5GNR operations

The documentation captures the related change in
BBDEV API to support 5GNR encode/decode operations.

Signed-off-by: Nicolas Chautru <nicolas.chautru@intel.com>
Acked-by: Amr Mokhtar <amr.mokhtar@intel.com>
5 years agobbdev: extend API for 5G FEC
Nicolas Chautru [Wed, 3 Jul 2019 15:24:05 +0000 (08:24 -0700)]
bbdev: extend API for 5G FEC

Extension to BBDEV operations to support 5G
on top of existing 4G operations.

Signed-off-by: Nicolas Chautru <nicolas.chautru@intel.com>
Acked-by: Amr Mokhtar <amr.mokhtar@intel.com>
5 years agobbdev: rename non-generic LTE specific structure
Nicolas Chautru [Wed, 3 Jul 2019 15:24:04 +0000 (08:24 -0700)]
bbdev: rename non-generic LTE specific structure

Renaming of the enums and structure which were LTE specific to
allow for extension and support for 5GNR operations.

Signed-off-by: Nicolas Chautru <nicolas.chautru@intel.com>
Acked-by: Amr Mokhtar <amr.mokhtar@intel.com>
5 years agotest/crypto: return correct value if feature not supported
Damian Nowak [Wed, 3 Jul 2019 11:15:58 +0000 (13:15 +0200)]
test/crypto: return correct value if feature not supported

This patch makes unsupported tests visible in
the testsuite summary.

Signed-off-by: Damian Nowak <damianx.nowak@intel.com>
Acked-by: Fiona Trahe <fiona.trahe@intel.com>
5 years agotest/crypto: add scatter-gather tests for IP and OOP
Damian Nowak [Wed, 3 Jul 2019 11:15:57 +0000 (13:15 +0200)]
test/crypto: add scatter-gather tests for IP and OOP

This patch adds test cases for wireless in-place
and out-of-place auth-cipher operations with
scatter-gather lists as input and output mbufs.
Test cases include buffer appended digest
generation with encryption and buffer decryption
with appended digest verification.
It also adds cases where digest is encrypted
only partially.

Signed-off-by: Damian Nowak <damianx.nowak@intel.com>
Acked-by: Fiona Trahe <fiona.trahe@intel.com>
5 years agotest/crypto: add KASUMI test cases for auth-cipher
Damian Nowak [Wed, 3 Jul 2019 11:15:56 +0000 (13:15 +0200)]
test/crypto: add KASUMI test cases for auth-cipher

This patch adds test cases for kasumi in-place
and out-of-place auth-cipher operations. Test
cases include buffer appended digest generation
with encryption and buffer decryption with
appended digest verification.

Signed-off-by: Damian Nowak <damianx.nowak@intel.com>
Acked-by: Fiona Trahe <fiona.trahe@intel.com>
5 years agotest/crypto: add ZUC test cases for auth-cipher
Damian Nowak [Wed, 3 Jul 2019 11:15:55 +0000 (13:15 +0200)]
test/crypto: add ZUC test cases for auth-cipher

This patch adds test cases for zuc in-place
and out-of-place auth-cipher operations. Test
cases include buffer appended digest generation
with encryption and buffer decryption with
appended digest verification.

Signed-off-by: Damian Nowak <damianx.nowak@intel.com>
Acked-by: Fiona Trahe <fiona.trahe@intel.com>
5 years agotest/crypto: add SNOW3G test cases for auth-cipher
Damian Nowak [Wed, 3 Jul 2019 11:15:54 +0000 (13:15 +0200)]
test/crypto: add SNOW3G test cases for auth-cipher

This patch adds test cases for snow3g in-place
and out-of-place auth-cipher operations. Test
cases include buffer appended digest generation
with encryption and buffer decryption with
appended digest verification.
It also adds cases where digest is encrypted
only partially.

Signed-off-by: Damian Nowak <damianx.nowak@intel.com>
Acked-by: Fiona Trahe <fiona.trahe@intel.com>
5 years agocrypto/qat: extend support for digest-encrypted auth-cipher
Damian Nowak [Wed, 3 Jul 2019 11:15:53 +0000 (13:15 +0200)]
crypto/qat: extend support for digest-encrypted auth-cipher

This patch adds condition to be met when using
out-of-place auth-cipher operations. It checks
if the digest location overlaps with the data to
be encrypted or decrypted and if so, treats as a
digest-encrypted case.
Patch adds checking, if the digest is being
encrypted or decrypted partially and extends PMD
buffers accordingly.
It also adds feature flag for QuickAssist
Technology to emphasize it's support for digest
appended auth-cipher operations.

Signed-off-by: Damian Nowak <damianx.nowak@intel.com>
Acked-by: Fiona Trahe <fiona.trahe@intel.com>
5 years agocryptodev: add digest encrypted feature flag
Damian Nowak [Wed, 3 Jul 2019 11:15:52 +0000 (13:15 +0200)]
cryptodev: add digest encrypted feature flag

Some PMDs can only support digest being
encrypted separately in auth-cipher operations.
Thus it is required to add feature flag in PMD
to reflect if it does support digest-appended
both: digest generation with encryption and
decryption with digest verification.
This patch also adds information about new
feature flag to the release notes.

Signed-off-by: Damian Nowak <damianx.nowak@intel.com>
Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Acked-by: Fiona Trahe <fiona.trahe@intel.com>
5 years agocryptodev: document usage of digest-appended operations
Damian Nowak [Wed, 3 Jul 2019 11:15:51 +0000 (13:15 +0200)]
cryptodev: document usage of digest-appended operations

This patch explains what are the conditions
and how to use digest appended for auth-cipher
operations.

Signed-off-by: Damian Nowak <damianx.nowak@intel.com>
Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Acked-by: Fiona Trahe <fiona.trahe@intel.com>
5 years agocrypto/openssl: fix free of asymmetric crypto keys
Arek Kusztal [Mon, 1 Jul 2019 14:57:25 +0000 (16:57 +0200)]
crypto/openssl: fix free of asymmetric crypto keys

In case big number need to be freed, data it contains should
also be cleared before especially if it is critical data like
private keys.

Fixes: 3e9d6bd447fb ("crypto/openssl: add RSA and mod asym operations")
Cc: stable@dpdk.org
Signed-off-by: Arek Kusztal <arkadiuszx.kusztal@intel.com>
Acked-by: Fiona Trahe <fiona.trahe@intel.com>
5 years agocryptodev: free memzone when releasing device
Junxiao Shi [Fri, 28 Jun 2019 19:11:03 +0000 (13:11 -0600)]
cryptodev: free memzone when releasing device

When a cryptodev is created in a primary process,
rte_cryptodev_data_alloc reserves a memzone.
However, this memzone was not released when the cryptodev
is uninitialized. After that, new cryptodev cannot be
created due to memzone name conflict.

This commit frees the memzone when a cryptodev is
uninitialized, fixing this bug. This approach is chosen
instead of keeping and reusing the old memzone, because
the new cryptodev could belong to a different NUMA socket.

Also, rte_cryptodev_data pointer is now properly recorded
in cryptodev_globals.data array.

Bugzilla ID: 105

Signed-off-by: Junxiao Shi <git@mail1.yoursunny.com>
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
5 years agotest/ipsec: fix destroy SA
Bernard Iremonger [Fri, 28 Jun 2019 13:29:22 +0000 (14:29 +0100)]
test/ipsec: fix destroy SA

Call rte_cryptodev_sym_session_clear() function.

Fixes: 05fe65eb66b2 ("test/ipsec: introduce functional test")
Cc: stable@dpdk.org
Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
5 years agotest/ipsec: fix tear down
Bernard Iremonger [Fri, 28 Jun 2019 13:29:21 +0000 (14:29 +0100)]
test/ipsec: fix tear down

Set freed cop pointers to NULL
Set other freed pointers to NULL instead of 0

Fixes: 05fe65eb66b2 ("test/ipsec: introduce functional test")
Cc: stable@dpdk.org
Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
5 years agoexamples/ipsec-secgw: add bypass test case
Konstantin Ananyev [Tue, 25 Jun 2019 23:16:49 +0000 (00:16 +0100)]
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>
5 years agoexamples/ipsec-secgw: add multi-segment test cases
Konstantin Ananyev [Tue, 25 Jun 2019 23:16:48 +0000 (00:16 +0100)]
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>
5 years agoexamples/ipsec-secgw: support fragmentation and reassembly
Konstantin Ananyev [Tue, 25 Jun 2019 23:16:47 +0000 (00:16 +0100)]
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>
5 years agoexamples/ipsec-secgw: fix packet length
Konstantin Ananyev [Tue, 25 Jun 2019 23:16:46 +0000 (00:16 +0100)]
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: 906257e965b7 ("examples/ipsec-secgw: support IPv6")
Fixes: d299106e8e31 ("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>
5 years agoexamples/ipsec-secgw: fix inline modes
Mariusz Drost [Wed, 26 Jun 2019 13:26:17 +0000 (15:26 +0200)]
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: ec17993a145a ("examples/ipsec-secgw: support security offload")
Fixes: 9a0752f498d2 ("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>
5 years agonet/ixgbe: fix IP type for crypto session
Mariusz Drost [Wed, 26 Jun 2019 13:26:16 +0000 (15:26 +0200)]
net/ixgbe: fix IP type for crypto session

When ixgbe_crypto_add_sa() is called, it checks whether the ip type is
IPv6 or IPv4 to write correct addresses to the registers. Type itself
is never specified, and act as IPv4, which is the default value.
It causes lack of support for IPv6.

To fix that, ip type needs to be stored in device private data, based on
crypto session ip type field, before the checking is done.

Fixes: ec17993a145a ("examples/ipsec-secgw: support security offload")
Fixes: 9a0752f498d2 ("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>
Tested-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
5 years agoapp/compress-perf: fix reliance on integer endianness
Artur Trybula [Tue, 4 Jun 2019 12:41:01 +0000 (14:41 +0200)]
app/compress-perf: fix reliance on integer endianness

Reliance on integer endianness (INCOMPATIBLE_CAST) in function
*parse_window_sz*.

Coverity issue: 328524
Fixes: e0b6287c035d ("app/compress-perf: add parser")
Cc: stable@dpdk.org
Signed-off-by: Artur Trybula <arturx.trybula@intel.com>
Acked-by: Shally Verma <shallyv@marvell.com>
5 years agoapp/crypto-perf: check lcore job failure
Tomasz Jozwiak [Fri, 14 Jun 2019 20:56:45 +0000 (22:56 +0200)]
app/crypto-perf: check lcore job failure

Currently, there's no return status check from lcore's jobs.
In case of fail - crypto-perf tool returns success anyway.
This patch adds such a detection and returns proper status at the end.

Fixes: ce8af1a4398d ("app/crypto-perf: wait for cores launched by app")
Cc: stable@dpdk.org
Signed-off-by: Tomasz Jozwiak <tjozwiakgm@gmail.com>
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
5 years agoapp/crypto-perf: fix display once detection
Tomasz Jozwiak [Fri, 14 Jun 2019 22:28:35 +0000 (00:28 +0200)]
app/crypto-perf: fix display once detection

This patch changes 'only_once' variable to 'display_once',
which should be atomic type due to fact, that all runner functions
can be executed in paraller way on different lcores.

Fixes: df52cb3b6e13 ("app/crypto-perf: move verify as single test type")
Cc: stable@dpdk.org
Signed-off-by: Tomasz Jozwiak <tjozwiakgm@gmail.com>
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
5 years agocrypto/octeontx: remove unsupported capabilities
Anoob Joseph [Thu, 27 Jun 2019 05:16:43 +0000 (10:46 +0530)]
crypto/octeontx: remove unsupported capabilities

Removing capabilities not supported with latest firmware.

Signed-off-by: Anoob Joseph <anoobj@marvell.com>
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
5 years agobaseband/fpga_lte_fec: add driver for FEC on FPGA
Nicolas Chautru [Fri, 14 Jun 2019 16:17:36 +0000 (09:17 -0700)]
baseband/fpga_lte_fec: add driver for FEC on FPGA

Supports for FEC 4G PMD Driver on FPGA card PAC N3000

Signed-off-by: Nicolas Chautru <nicolas.chautru@intel.com>
Acked-by: Kamil Chalupnik <kamilx.chalupnik@intel.com>
5 years agobaseband/turbo_sw: support meson build
Nicolas Chautru [Wed, 19 Jun 2019 17:48:38 +0000 (10:48 -0700)]
baseband/turbo_sw: support meson build

Turbo_sw PMD driver now building with meson/ninja
with or without SDK libraries.

Signed-off-by: Nicolas Chautru <nicolas.chautru@intel.com>
Acked-by: Kamil Chalupnik <kamilx.chalupnik@intel.com>
Acked-by: Ferruh Yigit <ferruh.yigit@intel.com>
5 years agodoc: update turbo_sw build steps in bbdev guide
Nicolas Chautru [Wed, 19 Jun 2019 17:48:37 +0000 (10:48 -0700)]
doc: update turbo_sw build steps in bbdev guide

The documentation is clarified to point to steps on building the
SDK libraries which are now publicly available:
https://software.intel.com/en-us/articles/flexran-lte-and-5g-nr-fec-software-development-kit-modules

Signed-off-by: Nicolas Chautru <nicolas.chautru@intel.com>
Acked-by: Kamil Chalupnik <kamilx.chalupnik@intel.com>
Acked-by: Ferruh Yigit <ferruh.yigit@intel.com>
5 years agobaseband/turbo_sw: allow to build without SDK dependency
Nicolas Chautru [Wed, 19 Jun 2019 17:48:36 +0000 (10:48 -0700)]
baseband/turbo_sw: allow to build without SDK dependency

Adding compile flag to allow to build the turbo_sw PMD
without dependency to have the SDK libraries installed.

Signed-off-by: Nicolas Chautru <nicolas.chautru@intel.com>
Acked-by: Amr Mokhtar <amr.mokhtar@intel.com>
Acked-by: Ferruh Yigit <ferruh.yigit@intel.com>
5 years agotest/ipsec: improve debug in group tests
Bernard Iremonger [Fri, 7 Jun 2019 10:33:15 +0000 (11:33 +0100)]
test/ipsec: improve debug in group tests

Add dump_grp_pkt() function.
Dump invalid mbuf data in case of error in group tests 12 and 13.

Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
5 years agotest/ipsec: add extra test configuration
Bernard Iremonger [Fri, 7 Jun 2019 10:33:14 +0000 (11:33 +0100)]
test/ipsec: add extra test configuration

Add extra test configuration for BURST_SIZE packets

Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
5 years agotest/ipsec: fix log messages
Bernard Iremonger [Fri, 7 Jun 2019 10:33:13 +0000 (11:33 +0100)]
test/ipsec: fix log messages

Error log messages after the create_sa() function calls
were using the wrong function name.
The function name is replaced with create_sa.

Fixes: 05fe65eb66b2 ("test/ipsec: introduce functional test")
Cc: stable@dpdk.org
Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
5 years agoipsec: include high order bytes of ESN in packet length
Lukasz Bartosik [Wed, 5 Jun 2019 15:31:27 +0000 (17:31 +0200)]
ipsec: include high order bytes of ESN in packet length

When esn is used then high-order 32 bits are included in ICV
calculation however are not transmitted. Update packet length
to be consistent with auth data offset and length before crypto
operation. High-order 32 bits of esn will be removed from packet
length in crypto post processing.

Signed-off-by: Lukasz Bartosik <lbartosik@marvell.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
5 years agoipsec: support multi-segment packets
Konstantin Ananyev [Fri, 31 May 2019 00:00:06 +0000 (01:00 +0100)]
ipsec: support multi-segment packets

Add support for packets that consist of multiple segments.
Take into account that trailer bytes (padding, ESP tail, ICV)
can spawn across multiple segments.

Signed-off-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
5 years agodoc: clarify xform zeroing in crypto guide
Fiona Trahe [Wed, 15 May 2019 16:36:56 +0000 (17:36 +0100)]
doc: clarify xform zeroing in crypto guide

Signed-off-by: Fiona Trahe <fiona.trahe@intel.com>
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
5 years agotest/crypto: add NULL algo to loop test mechanism
Fiona Trahe [Fri, 26 Apr 2019 19:31:58 +0000 (20:31 +0100)]
test/crypto: add NULL algo to loop test mechanism

Added NULL algo tests into loop test mechanism used
by block cipher tests as easier to extend there.
Included chain, cipher-only and auth-only use-cases.
Extended to cover out-of-place use-cases and use-cases
where data length is not an 8-byte multiple.

Signed-off-by: Fiona Trahe <fiona.trahe@intel.com>
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
5 years agoexamples/ipsec-secgw: add scapy based tests
Marcin Smoczynski [Mon, 24 Jun 2019 13:40:00 +0000 (15:40 +0200)]
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>
5 years agoexamples/ipsec-secgw: support IPv6 options
Marcin Smoczynski [Mon, 24 Jun 2019 13:39:59 +0000 (15:39 +0200)]
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>
5 years agoipsec: fix transport mode for IPv6 with extensions
Marcin Smoczynski [Mon, 24 Jun 2019 13:39:58 +0000 (15:39 +0200)]
ipsec: fix transport mode for IPv6 with extensions

Reconstructing IPv6 header after encryption or decryption requires
updating 'next header' value in the preceding protocol header, which
is determined by parsing IPv6 header and iteratively looking for
next IPv6 header extension.

It is required that 'l3_len' in the mbuf metadata contains a total
length of the IPv6 header with header extensions up to ESP header.

Fixes: 4d7ea3e1459b ("ipsec: implement SA data-path API")
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>
Tested-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
5 years agonet: add IPv6 header extension parsing function
Marcin Smoczynski [Mon, 24 Jun 2019 13:39:57 +0000 (15:39 +0200)]
net: add IPv6 header extension parsing function

Introduce new function for IPv6 header extension parsing able to
determine extension length and next protocol number.

This function is helpful when implementing IPv6 header traversing.

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>
5 years agocrypto/aesni_mb: fix out-of-bounds access
Fan Zhang [Mon, 24 Jun 2019 15:40:52 +0000 (16:40 +0100)]
crypto/aesni_mb: fix out-of-bounds access

This patch fixes the out-of-bounds coverity issue by adding
missed algorithms to the array.

Coverity issue: 337683
Fixes: c68d7aa354f6 ("crypto/aesni_mb: use architecture independent macros")
Cc: stable@dpdk.org
Signed-off-by: Fan Zhang <roy.fan.zhang@intel.com>
5 years agocryptodev: add feature flags to disable
Anoob Joseph [Tue, 25 Jun 2019 05:39:24 +0000 (11:09 +0530)]
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>
5 years agomaintainers: claim maintainership of bbdev
Nicolas Chautru [Mon, 17 Jun 2019 18:21:28 +0000 (11:21 -0700)]
maintainers: claim maintainership of bbdev

Reorg within Intel teams causing transfer of maintainership

Signed-off-by: Nicolas Chautru <nicolas.chautru@intel.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
5 years agocryptodev: add option to support both IV and J0 for GCM
Arek Kusztal [Wed, 17 Apr 2019 15:57:51 +0000 (17:57 +0200)]
cryptodev: add option to support both IV and J0 for GCM

This patch adds an option to support both IV (of all supported sizes)
and J0 when using Galois Counter Mode of crypto operation.

Signed-off-by: Arek Kusztal <arkadiuszx.kusztal@intel.com>
Acked-by: Fiona Trahe <fiona.trahe@intel.com>
Acked-by: Anoob Joseph <anoobj@marvell.com>
5 years agocrypto/virtio: check PCI config read
Chenbo Xia [Fri, 19 Apr 2019 00:58:34 +0000 (00:58 +0000)]
crypto/virtio: check PCI config read

Fix unchecked return value issue for rte_pci_read_config.

Coverity issue: 302861
Fixes: 25500d4b8076 ("crypto/virtio: support device init")
Cc: stable@dpdk.org
Signed-off-by: Chenbo Xia <chenbo.xia@intel.com>
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
5 years agoapp/compress-perf: print socket id
Fiona Trahe [Tue, 30 Apr 2019 17:10:14 +0000 (17:10 +0000)]
app/compress-perf: print socket id

Added info about socket id used by compression perf
test process and by the driver

Signed-off-by: Tomasz Cel <tomaszx.cel@intel.com>
Signed-off-by: Fiona Trahe <fiona.trahe@intel.com>
Acked-by: Artur Trybula <arturx.trybula@intel.com>
5 years agodoc: clarify data plane error handling in compressdev
Fiona Trahe [Wed, 15 May 2019 11:16:07 +0000 (12:16 +0100)]
doc: clarify data plane error handling in compressdev

Fixed some typos and clarified how errors on ops which
fail to get submitted on the enqueue API should be handled.

Fixes: a584d3bea902 ("doc: add compressdev library guide")
Cc: stable@dpdk.org
Signed-off-by: Fiona Trahe <fiona.trahe@intel.com>
Acked-by: Tomasz Jozwiak <tomaszx.jozwiak@intel.com>
Acked-by: Shally Verma <shallyv@marvell.com>