Akhil Goyal [Fri, 11 Jan 2019 12:24:30 +0000 (12:24 +0000)]
net/dpaa2: enable optional timestamp in mbuf
This patch enables the population of timestamp field
in mbuf on packet receive.
It may give performance impact on LX2xxx platforms.
So, it has been made optional for Lx2xxx platform.
One shall call, rte_dpaa2_enable_ts() to enable it.
Shreyansh Jain [Fri, 11 Jan 2019 12:24:23 +0000 (12:24 +0000)]
bus/fslmc: fix parse method for bus devices
Current code expects that bus->parse() would get a string containing
the name of the bus. That is incorrect. bus->parse() is expected
to have strings like:
dpni.1,key=val
dpio.2,key=val
Jens Freimann [Fri, 11 Jan 2019 09:39:28 +0000 (10:39 +0100)]
net/virtio: check head desc with correct wrap counter
In virtio_pq_send_command() we check for a used descriptor
and wait in an idle loop until it becomes used. We can't use
vq->used_wrap_counter here to check for the first descriptor
we made available because the ring could have wrapped. Let's use
the used_wrap_counter that matches the state of the head descriptor.
Fixes: ec194c2f1895 ("net/virtio: support packed queue in send command") Signed-off-by: Jens Freimann <jfreimann@redhat.com> Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Ilya Maximets [Wed, 9 Jan 2019 14:50:15 +0000 (17:50 +0300)]
net/virtio: support platform memory ordering
VIRTIO_F_ORDER_PLATFORM is required to use proper memory barriers
in case of HW vhost implementations like vDPA.
DMA barriers (rte_cio_*) are sufficent for that purpose.
Previously known as VIRTIO_F_IO_BARRIER.
Signed-off-by: Ilya Maximets <i.maximets@samsung.com> Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com> Acked-by: Michael S. Tsirkin <mst@redhat.com>
Ilya Maximets [Wed, 9 Jan 2019 14:50:14 +0000 (17:50 +0300)]
net/virtio: update memory ordering comment for VQ notify
We're not using IO ports in case of modern device even on IA.
Also, this comment useless for other architectures.
Signed-off-by: Ilya Maximets <i.maximets@samsung.com> Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com> Acked-by: Michael S. Tsirkin <mst@redhat.com>
Ilya Maximets [Wed, 9 Jan 2019 14:50:13 +0000 (17:50 +0300)]
net/virtio: add barrier before reading the flags
Reading the used->flags could be reordered with avail->idx update.
vhost in kernel disables notifications for the time of packets
receiving, like this:
1. disable notify
2. process packets
3. enable notify
4. has more packets ? goto 1
In case of reordering, virtio driver could read the flags on
step 2 while notifications disabled and update avail->idx after
the step 4, i.e. vhost will exit the loop on step 4 with
notifications enabled, but virtio will not notify.
Fixes: c1f86306a026 ("virtio: add new driver") Cc: stable@dpdk.org Reported-by: Shahaf Shuler <shahafs@mellanox.com> Signed-off-by: Ilya Maximets <i.maximets@samsung.com> Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com> Acked-by: Michael S. Tsirkin <mst@redhat.com>
Rami Rosen [Wed, 9 Jan 2019 14:57:30 +0000 (16:57 +0200)]
examples/vhost: remove unnecessary method and constant
This cleanup patch removes a method and a constant which
are now unnecessary in the VHOST sample application, namely
the validate_num_devices() method and the MAX_DEVICES
constant.
Signed-off-by: Rami Rosen <ramirose@gmail.com> Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Ivan Malov [Wed, 9 Jan 2019 11:06:39 +0000 (11:06 +0000)]
net/sfc: discard last seen VLAN TCI if Tx packet is dropped
Early processing of a packet on transmit may change last seen
VLAN TCI in the queue context. If such a packet is eventually
dropped, last seen VLAN TCI must be set to its previous value.
Fixes: 7fd636815a43 ("net/sfc: support VLAN offload on transmit path") Cc: stable@dpdk.org Signed-off-by: Ivan Malov <ivan.malov@oktetlabs.ru> Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Ivan Malov [Wed, 9 Jan 2019 11:05:13 +0000 (11:05 +0000)]
net/sfc: add missing header guard to TSO header file
Add missing header guard, including compiler directive for cplusplus.
Fixes: f1f575be9b76 ("net/sfc: put generalised TSO declarations in a header") Cc: stable@dpdk.org Signed-off-by: Ivan Malov <ivan.malov@oktetlabs.ru> Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
app/testpmd: fix quit to stop all ports before close
This patch proposes a slightly different test-pmd quit operation: stop
all devices before starting to close any device. Basically, stop all
moving parts before beginning to remove them. The current test-pmd quit
is stopping and closing each device before moving to the next device.
If all devices in the system are independent of each other, this
difference is usually not important. In case of Soft NIC devices, any
such virtual device typically depends on one or more physical devices
being alive, as it accesses their queues, so this difference becomes
important.
Without this straightforward fix, all the Soft NIC devices need to be
manually stopped before the quit command is issued, otherwise the quit
command can sometimes crash the test-pmd application.
Fixes: d3a274ce9dee ("app/testpmd: handle SIGINT and SIGTERM") Cc: stable@dpdk.org Signed-off-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com> Acked-by: Bernard Iremonger <bernard.iremonger@intel.com>
Rami Rosen [Fri, 4 Jan 2019 09:10:46 +0000 (11:10 +0200)]
doc: fix a parameter name in testpmd guide
There is no parameter called "eth-peer-configfile" in testpmd.
It should be "eth-peers-configfile". See the usage() method in
app/test-pmd/parameters.c.
Fixes: a67857e97ba8 ("doc: clarify usage of testpmd MAC forward mode") Cc: stable@dpdk.org Signed-off-by: Rami Rosen <ramirose@gmail.com> Acked-by: Bernard Iremonger <bernard.iremonger@intel.com>
Dekel Peled [Tue, 25 Dec 2018 07:42:18 +0000 (09:42 +0200)]
examples/flow_filtering: fix example documentation
Previous patch removed the VLAN item from example code.
This patch fixes the code and documentation accordingly.
Code update includes fix of comments, and removal of redundant
variables and their initialization.
Documentation update reflects the code changes done in previous
patch and in this patch.
Fixes: 9af4eb565710 ("examples/flow_filtering: remove VLAN item") Cc: stable@dpdk.org Signed-off-by: Dekel Peled <dekelp@mellanox.com> Acked-by: Ori Kam <orika@mellanox.com>
Hemant Agrawal [Wed, 26 Dec 2018 11:33:51 +0000 (11:33 +0000)]
net/dpaa: fix secondary process
In order to support I/O from secondary process, the
burst APIs and OPS APIs shall be mapped/plugged. This
patch fixes the code to remap the ops and burst apis.
Julien Meunier [Wed, 2 Jan 2019 15:57:45 +0000 (17:57 +0200)]
net/fm10k: fix internal switch initial status
sm_down is a boolean in order to check if the internal switch of the
fm10k is up or down. This variable is configured though an interrupt by
fm10k_dev_interrupt_handler_pf.
If sm_down is uninitialized, we are not sure of its value at the first
bring up. For example, if FM10K_EICR_SWITCHREADY is raised, the PMD will
try to reconfigure the switch, but it does not make sense, as it's the
first startup.
The sm_down implementation has been introduced
commit 6c9f37245583 ("net/fm10k: support switch restart on PF").
Fixes: 6f22f2f67268 ("net/fm10k: redefine link status semantics") Cc: stable@dpdk.org Signed-off-by: Julien Meunier <julien.meunier@nokia.com> Acked-by: Xiao Wang <xiao.w.wang@intel.com>
Fan Zhang [Fri, 4 Jan 2019 11:22:46 +0000 (11:22 +0000)]
vhost/crypto: fix possible out of bound access
This patch fixes a out of bound access possbility in vhost
crypto. Originally the incorrect next descriptor index may
cause the library read invalid memory content and crash
the application.
Fixes: 3bb595ecd682 ("vhost/crypto: add request handler") Cc: stable@dpdk.org Signed-off-by: Fan Zhang <roy.fan.zhang@intel.com> Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Tiwei Bie [Fri, 4 Jan 2019 04:06:42 +0000 (12:06 +0800)]
vhost: ensure event idx is mapped when negotiated
Fixes: 30920b1e2b15 ("vhost: ensure all range is mapped when translating QVAs") Cc: stable@dpdk.org Signed-off-by: Tiwei Bie <tiwei.bie@intel.com> Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Tiwei Bie [Fri, 4 Jan 2019 04:06:40 +0000 (12:06 +0800)]
vhost: fix possible out of bound access in vector filling
Fixes: 7f74b95c444f ("vhost: pre update used ring for Tx and Rx") Cc: stable@dpdk.org Signed-off-by: Tiwei Bie <tiwei.bie@intel.com> Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Tiwei Bie [Fri, 4 Jan 2019 04:06:39 +0000 (12:06 +0800)]
vhost: fix possible dead loop in relay helpers
Fix a possible dead loop which may happen, e.g. when
driver created a loop in the desc list.
Fixes: b13ad2decc83 ("vhost: provide helpers for virtio ring relay") Signed-off-by: Tiwei Bie <tiwei.bie@intel.com> Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Tiwei Bie [Fri, 4 Jan 2019 04:06:38 +0000 (12:06 +0800)]
vhost: fix possible out of bound access in relay helpers
Fixes: b13ad2decc83 ("vhost: provide helpers for virtio ring relay") Signed-off-by: Tiwei Bie <tiwei.bie@intel.com> Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Tiwei Bie [Fri, 4 Jan 2019 04:06:37 +0000 (12:06 +0800)]
vhost: fix desc access in relay helpers
Descs in desc table should be indexed using the desc idx
instead of the idx of avail ring and used ring.
Fixes: b13ad2decc83 ("vhost: provide helpers for virtio ring relay") Signed-off-by: Tiwei Bie <tiwei.bie@intel.com> Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Tiwei Bie [Thu, 3 Jan 2019 02:40:06 +0000 (10:40 +0800)]
net/virtio-user: fix packed vq option parsing
Add the RING_PACKED feature to dev->unsupported_features
when it's disabled, and add the missing packed vq param
string. And also revert the unexpected change to MAC option
introduced when adding packed vq option.
Fixes: 34f3966c7f81 ("net/virtio-user: add option to use packed queues") Signed-off-by: Tiwei Bie <tiwei.bie@intel.com> Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Wei Zhao [Mon, 7 Jan 2019 07:22:56 +0000 (15:22 +0800)]
net/ixgbe: fix over using multicast table for VF
According to the current implementation, all VFs will set bit
IXGBE_VMOLR_ROMPE during initialization, this cause any VF
will accept packets that match the MTA table. Since the MTA
table is shared by all VFs which means if one VF update MTA
table in function ixgbe_vf_set_multicast, then all other VFs
will receive multicast packets which cause unnecessary
performance overhead.
So it's better to set VF's ROPE bit of register VMOLR only
if multicast address filter is required on that VF.
Also, the ROPE bit should be reset when multicast address
filter is requested to clean.
This patch also aligns to the related fix on ixgbe
kernel driver 5.3.7.
Moti Haimovsky [Thu, 3 Jan 2019 15:06:37 +0000 (15:06 +0000)]
net/mlx5: support flow counters using devx
This commit adds counters support when creating flows via direct
verbs. The implementation uses devx interface in order to create
query and delete the counters.
This support requires MLNX_OFED_LINUX-4.5-0.1.0.1 installation.
Moti Haimovsky [Thu, 3 Jan 2019 15:06:36 +0000 (15:06 +0000)]
net/mlx5: add devx functions to glue
This patch adds glue functions for operations:
- dv_open_device.
- devx object create, destroy, query and modify.
- devx general command
The new operations depend on HAVE_IBV_DEVX_OBJ.
Moti Haimovsky [Thu, 3 Jan 2019 15:06:36 +0000 (15:06 +0000)]
net/mlx5: fix shared counter allocation logic
This commit fixes the logic for searching and allocating a shared
counter in mlx5_flow_verbs.
Now only the shared counters in the counters list are checked for
a match and not all the counters as before.
Ilya Maximets [Mon, 14 Jan 2019 16:14:42 +0000 (19:14 +0300)]
eal: fix build of external app with clang on armv8
In case DPDK built using GCC, RTE_TOOLCHAIN_CLANG is not defined.
But 'rte_atomic.h' is a generic header that included to the
external apps like OVS while building with DPDK. As a result,
clang build of OVS fails on armv8 if DPDK built using gcc:
include/generic/rte_atomic.h:215:9: error:
implicit declaration of function '__atomic_exchange_2'
is invalid in C99
include/generic/rte_atomic.h:494:9: error:
implicit declaration of function '__atomic_exchange_4'
is invalid in C99
include/generic/rte_atomic.h:772:9: error:
implicit declaration of function '__atomic_exchange_8'
is invalid in C99
We need to check for current compiler, not the compiler used for
DPDK build.
Fixes: 7bdccb93078e ("eal: fix ARM build with clang") Cc: stable@dpdk.org Signed-off-by: Ilya Maximets <i.maximets@samsung.com> Acked-by: Thomas Monjalon <thomas@monjalon.net>
Ferruh Yigit [Mon, 14 Jan 2019 15:49:35 +0000 (15:49 +0000)]
mk: fix scope of disabling AVX512F support
AVX512 was disabled for GCC because of Bugzilla issue 97 [1],
the GCC defect submitted for the issue [2] highlighted that this is
a known binutils version 2.30 issue.
Narrowed the scope of no-avx512 to the this specific binutils version.
Harry van Haaren [Fri, 11 Jan 2019 11:32:39 +0000 (11:32 +0000)]
mbuf: fix C++ compatibility by making sched struct visible
Although C compilation works with the struct rte_mbuf_sched
declared inside the struct rte_mbuf namespace, C++ fails to
compile. This fix moves the rte_mbuf_sched struct up to the
global namespace, instead of declaring it inside the struct
mbuf namespace.
The struct rte_mbuf_sched is being used on the stack in
rte_mbuf_sched_get() and as a cast in _set(). For this
reason, it must be exposed as an available type.
Fixes: 5d3f72100904 ("mbuf: implement generic format for sched field") Signed-off-by: Harry van Haaren <harry.van.haaren@intel.com> Acked-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com> Acked-by: Olivier Matz <olivier.matz@6wind.com>
Anatoly Burakov [Tue, 8 Jan 2019 16:46:28 +0000 (16:46 +0000)]
mem: fix storing old policy
The original code was supposed to overwrite the value pointed to
by the pointer, but the new one is instead overwriting the
pointer value itself, which has no effect outside that function.
Fix it by adding a pointer dereference.
Fixes: 582bed1e1d1d ("mem: support mapping hugepages at runtime") Cc: stable@dpdk.org Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
Anatoly Burakov [Thu, 10 Jan 2019 11:34:08 +0000 (11:34 +0000)]
eal/bsd: remove clean up of files at startup
On FreeBSD, closing the file descriptor drops the lock even if the
file descriptor was mmap'ed. This leads to the cleanup at the end
of EAL init to remove fbarray files that are still in use by the
process itself.
However, instead of working around this issue, we can take advantage
of the fact that FreeBSD doesn't really create any per-process
files in the first place, so no cleanup is actually needed.
Fixes: 0a529578f162 ("eal: clean up unused files on initialization") Cc: stable@dpdk.org Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
Anatoly Burakov [Thu, 10 Jan 2019 13:38:59 +0000 (13:38 +0000)]
eal: fix strdup usages in internal config
Currently, we use strdup in a few places to store command-line
parameter values for certain internal config values. There are
several issues with that.
First of all, they're never freed, so memory ends up leaking
either after EAL exit, or when these command-line options are
supplied multiple times.
Second of all, they're defined as `const char *`, so they
*cannot* be freed even if we wanted to.
Finally, strdup may return NULL, which will be stored in the
config. For most fields, NULL is a valid value, but for the
default prefix, the value is always expected to be valid.
To fix all of this, three things are done. First, we change
the definitions of these values to `char *` as opposed to
`const char *`. This does not break the ABI, and previous
code assumes constness (which is more restrictive), so it's
safe to do so.
Then, fix all usages of strdup to check return value, and add
a cleanup function that will free the memory occupied by
these strings, as well as freeing them before assigning a new
value to prevent leaks when parameter is specified multiple
times.
And finally, add an internal API to query hugefile prefix, so
that, absent of a valid value, a default value will be
returned, and also fix up all usages of hugefile prefix to
use this API instead of accessing hugefile prefix directly.
Xiao Liang [Wed, 19 Dec 2018 07:07:58 +0000 (15:07 +0800)]
kni: fix build on RHEL 8
'ndo_change_mtu_rh74' was changed to 'ndo_change_mtu' in RHEL8.
Build error log:
/home/dpdk-18.11/kernel/linux/kni/compat.h:107:24: error: ‘const struct
net_device_ops’ has no member named ‘ndo_change_mtu_rh74’; did you mean
‘ndo_change_mtu’?
#define ndo_change_mtu ndo_change_mtu_rh74
^~~~~~~~~~~~~~~~~~~
Bruce Richardson [Fri, 11 Jan 2019 11:48:34 +0000 (11:48 +0000)]
maintainers: resign from maintainership of distributor lib
The distributor library doesn't see much in the way of changes, and Dave
is well able to manage the library on his own, so remove my name against
it in the MAINTAINERS file.
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Bruce Richardson [Thu, 10 Jan 2019 10:37:26 +0000 (10:37 +0000)]
devtools: fix build check for whether meson has run
The current check to see whether we need to call meson or just ninja
simply checked if the build directory existed. However, if meson was run
but failed, the build directory would still exist. We can fix this by
instead checking for the build.ninja file inside the directory. Once that
is present, we can use ninja safely and let it worry about rerunning
meson if necessary.
Fixes: a55277a788df ("devtools: add test script for meson builds") Cc: stable@dpdk.org Signed-off-by: Bruce Richardson <bruce.richardson@intel.com> Acked-by: Luca Boccassi <bluca@debian.org>
Bruce Richardson [Thu, 10 Jan 2019 10:29:19 +0000 (10:29 +0000)]
build: fix variable name in dependency error message
The variable name in the error message had an extra '_' which caused
an actual meson error when the message would otherwise be printed to
give meaningful information about what was going wrong.
Fixes: 203b61dc5e18 ("build: improve error message for missing dependency") Cc: stable@dpdk.org Signed-off-by: Bruce Richardson <bruce.richardson@intel.com> Acked-by: Luca Boccassi <bluca@debian.org>
Luca Boccassi [Fri, 11 Jan 2019 16:12:44 +0000 (16:12 +0000)]
build: use static deps for pkg-config libs.private
Dependencies of the RTE libraries were not being added to the
Requires.private field of the pc file since the variable used for
dynamic linking was passed to the related field of pkg.generate.
Use the static one so that dependencies are included.
Fixes: 57ae0ec62620 ("build: add dependency on telemetry to apps with meson") Cc: stable@dpdk.org Signed-off-by: Luca Boccassi <bluca@debian.org>
Akhil Goyal [Wed, 9 Jan 2019 15:14:21 +0000 (15:14 +0000)]
crypto/dpaa2_sec: fix FLC address for physical mode
Fixes: 547a4d40e7bf ("crypto/dpaa2_sec: support out of place protocol offload") Fixes: 0a23d4b6f4c2 ("crypto/dpaa2_sec: support protocol offload IPsec") Cc: stable@dpdk.org Signed-off-by: Akhil Goyal <akhil.goyal@nxp.com>
Akhil Goyal [Wed, 9 Jan 2019 15:14:17 +0000 (15:14 +0000)]
crypto/dpaa_sec: support same session flows on multi-cores
In dpaa_sec, each session should have a separate in-queue,
and each in-queue should be mapped to an outq.
So if multiple flows of same SA comes to different cores
due to rss distribution of NIC, enqueue from any core will
try to do re-assignment of inq - outq mapping which will fail.
In this patch, for each core a separate inq is allocated and
used from each of the core. But the number of outq will remain
the same and we save the pointer to outq in session for each
of the cores.
examples/ipsec-secgw: add scripts for functional test
The purpose of these scripts is to automate ipsec-secgw functional testing.
The scripts require two machines (SUT and DUT) connected through
at least 2 NICs and running linux (so far tested only on Ubuntu 18.04).
Introduced test-cases for the following scenarios:
- Transport/Tunnel modes
- AES-CBC SHA1
- AES-GCM
- ESN on/off
- legacy/librte_ipsec code path
Signed-off-by: Konstantin Ananyev <konstantin.ananyev@intel.com> Acked-by: Radu Nicolau <radu.nicolau@intel.com> Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
examples/ipsec-secgw: make data-path to use IPsec library
Changes to make ipsec-secgw data-path code to utilize librte_ipsec library.
Note that right now by default current (non-librte_ipsec) code-path will
be used. User has to run application with new command-line option ('-l')
to enable new codepath.
Signed-off-by: Mohammad Abdul Awal <mohammad.abdul.awal@intel.com> Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com> Signed-off-by: Konstantin Ananyev <konstantin.ananyev@intel.com> Acked-by: Radu Nicolau <radu.nicolau@intel.com> Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
examples/ipsec-secgw: make app to use IPsec library
Changes to make ipsec-secgw to utilize librte_ipsec library.
That patch provides:
- changes in the related data structures.
- changes in the initialization code.
- new command-line parameters to enable librte_ipsec codepath
and related features.
Note that right now by default current (non-librte_ipsec) code-path will
be used. User has to run application with new command-line option ('-l')
to enable new codepath.
The main reason for that:
- current librte_ipsec doesn't support all ipsec algorithms
and features that the app does.
- allow users to run both versions in parallel for some time
to figure out any functional or performance degradation with the
new code.
It is planned to deprecate and remove non-librte_ipsec code path
in future releases.
Signed-off-by: Mohammad Abdul Awal <mohammad.abdul.awal@intel.com> Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com> Signed-off-by: Konstantin Ananyev <konstantin.ananyev@intel.com> Acked-by: Radu Nicolau <radu.nicolau@intel.com> Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
examples/ipsec-secgw: fix outbound codepath for single SA
Looking at process_pkts_outbound_nosp() there seems few issues:
- accessing mbuf after it was freed
- invoking ipsec_outbound() for ipv4 packets only
- copying number of packets, but not the mbuf pointers itself
that patch provides fixes for that issues.
Fixes: 906257e965b7 ("examples/ipsec-secgw: support IPv6") Cc: stable@dpdk.org Signed-off-by: Konstantin Ananyev <konstantin.ananyev@intel.com> Acked-by: Radu Nicolau <radu.nicolau@intel.com> Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
examples/ipsec-secgw: fix crypto-op might never get dequeued
In some cases crypto-ops could never be dequeued from the crypto-device.
The easiest way to reproduce:
start ipsec-secgw with crypto-dev and send to it less then 32 packets.
none packets will be forwarded.
Reason for that is that the application does dequeue() from crypto-queues
only when new packets arrive.
This patch makes the app to call dequeue() on a regular basis.
Also to make code cleaner and easier to understand,
it separates crypto-dev enqueue() and dequeue() code paths.
pkt_process() now only enqueues packets into crypto device,
dequeuing and final processing is done by drain_crypto_queues().
Fixes: c64278c0c18b ("examples/ipsec-secgw: rework processing loop") Cc: stable@dpdk.org Signed-off-by: Konstantin Ananyev <konstantin.ananyev@intel.com> Acked-by: Radu Nicolau <radu.nicolau@intel.com> Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
examples/ipsec-secgw: allow to specify neighbour MAC address
In some cases it is useful to allow user to specify destination
ether address for outgoing packets.
This patch adds such ability by introducing new 'neigh' config
file option.
Signed-off-by: Konstantin Ananyev <konstantin.ananyev@intel.com> Acked-by: Radu Nicolau <radu.nicolau@intel.com> Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
examples/ipsec-secgw: allow disabling some Rx/Tx offloads
Right now ipsec-secgw always enables TX offloads
(DEV_TX_OFFLOAD_MULTI_SEGS, DEV_TX_OFFLOAD_SECURITY),
even when they are not requested by the config.
That causes many PMD to choose full-featured TX function,
which in many cases is much slower then one without offloads.
That patch adds ability for the user to disable unneeded HW offloads.
If DEV_TX_OFFLOAD_IPV4_CKSUM is disabled by user, then
SW version of ip cksum calculation is used.
That allows to use vector TX function, when inline-ipsec is not
requested.
Signed-off-by: Remy Horton <remy.horton@intel.com> Signed-off-by: Konstantin Ananyev <konstantin.ananyev@intel.com> Acked-by: Radu Nicolau <radu.nicolau@intel.com> Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
Create functional test for librte_ipsec.
Note that the test requires null crypto pmd to pass successfully.
Signed-off-by: Mohammad Abdul Awal <mohammad.abdul.awal@intel.com> Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com> Signed-off-by: Konstantin Ananyev <konstantin.ananyev@intel.com> Acked-by: Declan Doherty <declan.doherty@intel.com> Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
ipsec: rework SA replay window/SQN for MT environment
With these changes functions:
- rte_ipsec_pkt_crypto_prepare
- rte_ipsec_pkt_process
can be safely used in MT environment, as long as the user can guarantee
that they obey multiple readers/single writer model for SQN+replay_window
operations.
To be more specific:
for outbound SA there are no restrictions.
for inbound SA the caller has to guarantee that at any given moment
only one thread is executing rte_ipsec_pkt_process() for given SA.
Note that it is caller responsibility to maintain correct order
of packets to be processed.
Provide implementation for rte_ipsec_pkt_crypto_prepare() and
rte_ipsec_pkt_process().
Current implementation:
- supports ESP protocol tunnel mode.
- supports ESP protocol transport mode.
- supports ESN and replay window.
- supports algorithms: AES-CBC, AES-GCM, HMAC-SHA1, NULL.
- covers all currently defined security session types:
- RTE_SECURITY_ACTION_TYPE_NONE
- RTE_SECURITY_ACTION_TYPE_INLINE_CRYPTO
- RTE_SECURITY_ACTION_TYPE_INLINE_PROTOCOL
- RTE_SECURITY_ACTION_TYPE_LOOKASIDE_PROTOCOL
For first two types SQN check/update is done by SW (inside the library).
For last two type it is HW/PMD responsibility.
Signed-off-by: Mohammad Abdul Awal <mohammad.abdul.awal@intel.com> Signed-off-by: Konstantin Ananyev <konstantin.ananyev@intel.com> Acked-by: Declan Doherty <declan.doherty@intel.com> Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
Introduce Security Association (SA-level) data-path API
Operates at SA level, provides functions to:
- initialize/teardown SA object
- process inbound/outbound ESP/AH packets associated with the given SA
(decrypt/encrypt, authenticate, check integrity,
add/remove ESP/AH related headers and data, etc.).
Signed-off-by: Mohammad Abdul Awal <mohammad.abdul.awal@intel.com> Signed-off-by: Konstantin Ananyev <konstantin.ananyev@intel.com> Acked-by: Declan Doherty <declan.doherty@intel.com> Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
Introduce librte_ipsec library.
The library is supposed to utilize existing DPDK crypto-dev and
security API to provide application with transparent IPsec processing API.
That initial commit provides some base API to manage
IPsec Security Association (SA) object.
Signed-off-by: Mohammad Abdul Awal <mohammad.abdul.awal@intel.com> Signed-off-by: Konstantin Ananyev <konstantin.ananyev@intel.com> Acked-by: Declan Doherty <declan.doherty@intel.com> Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
Signed-off-by: Konstantin Ananyev <konstantin.ananyev@intel.com> Acked-by: Mohammad Abdul Awal <mohammad.abdul.awal@intel.com> Acked-by: Declan Doherty <declan.doherty@intel.com> Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
security: add opaque userdata pointer into security session
Add 'uint64_t opaque_data' inside struct rte_security_session.
That allows upper layer to easily associate some user defined
data with the session.
Signed-off-by: Konstantin Ananyev <konstantin.ananyev@intel.com> Acked-by: Mohammad Abdul Awal <mohammad.abdul.awal@intel.com> Acked-by: Declan Doherty <declan.doherty@intel.com> Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
Fan Zhang [Thu, 10 Jan 2019 14:50:21 +0000 (14:50 +0000)]
cryptodev: add reference count to session private data
This patch adds a refcnt field to every session private data in the
cryptodev symmetric session. The counter is used to prevent freeing
symmetric session blindly before it is not cleared by every type of
crypto device in use.
Fan Zhang [Thu, 10 Jan 2019 14:50:20 +0000 (14:50 +0000)]
cryptodev: add user data size to symmetric session
This patch adds a user_data_sz field to cryptodev symmetric session.
The field is used to check if reading or writing the session's user
data field is eligible.
Fan Zhang [Thu, 10 Jan 2019 14:50:19 +0000 (14:50 +0000)]
cryptodev: update symmetric session structure
This patch updates the rte_cryptodev_sym_session structure for
cryptodev library. The updates include a changed session private
data array and an added nb_drivers field. They are used to
calculate the correct session header size and ensure safe access
of the session private data.
Fan Zhang [Thu, 10 Jan 2019 14:50:17 +0000 (14:50 +0000)]
test/crypto: use separate session mempools
This patch uses the two session mempool approach to crypto unit
test. One mempool is for session header objects, and the other is
for session private data.
Fan Zhang [Thu, 10 Jan 2019 14:50:16 +0000 (14:50 +0000)]
vhost/crypto: use separate session mempools
This patch uses the two session mempool approach to vhost crypto.
One mempool is for session header objects, and the other is for
session private data.
Fan Zhang [Thu, 10 Jan 2019 14:50:15 +0000 (14:50 +0000)]
examples: use separate crypto session mempools
This patch uses the two session mempool approach to all cryptodev
sample applications. One mempool is for session header objects, and
the other is for session private data.
Fan Zhang [Thu, 10 Jan 2019 14:50:13 +0000 (14:50 +0000)]
app/crypto-perf: use separate session mempools
This patch uses the two session mempool approach to crypto perf
application. One mempool is for session header objects, and the other
is for session private data.