Remove setting ALLOW_EXPERIMENTAL_API individually for each Makefile and
meson.build. Instead, enable ALLOW_EXPERIMENTAL_API flag across app, lib
and drivers.
This changes reduces the clutter across the project while still
maintaining the functionality of ALLOW_EXPERIMENTAL_API i.e. warning
external applications about experimental API usage.
In nitrox_sym_pmd_create() the name array will overflow if the pci
device name is greater than 57 bytes. To fix this issue subtract pci
device name length from array length while appending substring to the
name.
If the NPS_PKT ring/port is greater than 8191 the NPS_PKT*() macros will
evaluate to incorrect values due to unintended sign extension from int
to unsigned long. To fix this, add UL suffix to the constants in these
macros. The same problem is with AQMQ_QSZX() macro also.
Adam Dybkowski [Thu, 26 Mar 2020 16:22:08 +0000 (17:22 +0100)]
crypto/qat: handle mixed hash-cipher on GEN2
This patch adds handling of mixed hash-cipher algorithms
available on GEN2 QAT in particular firmware versions.
Also the documentation is updated to show the mixed crypto
algorithms are supported on QAT GEN2.
Signed-off-by: Adam Dybkowski <adamx.dybkowski@intel.com> Acked-by: Fiona Trahe <fiona.trahe@intel.com>
Nicolas Chautru [Thu, 26 Mar 2020 03:27:48 +0000 (20:27 -0700)]
app/bbdev: update test vectors
Modification to vectors parameters used for unit test
for coverage and performance test of bbdev drivers
across all devices.
Updating and reducing list for focused coverage on relevant
code blocks for 4G and 5G. Less focus on 4G TB mode as there is
some question how to best support this with mbuf limitations and
if effect are not used.
Removing scenarios with negative LLR assumptions which are not
used with any PMDs and historical only.
Signed-off-by: Nicolas Chautru <nicolas.chautru@intel.com> Acked-by: Dave Burley <dave.burley@accelercomm.com> Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
Nicolas Chautru [Thu, 26 Mar 2020 03:27:45 +0000 (20:27 -0700)]
app/bbdev: add performance tests
Includes support for BLER (Block Error Rate) wireless
performance test with new arguments for SNR and number
of iterations for 5G. This generates LLRs for a given
SNR level then measures the ratio of code blocks being
successfully decoded or not.
Signed-off-by: Nicolas Chautru <nicolas.chautru@intel.com> Acked-by: Dave Burley <dave.burley@accelercomm.com> Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
Nicolas Chautru [Thu, 26 Mar 2020 03:27:44 +0000 (20:27 -0700)]
app/bbdev: support HARQ validation
Adding functionality to validate HARQ for different
devices implementation.
Adding capacity to fetch HARQ data when required as
part of this validation.
Signed-off-by: Nicolas Chautru <nicolas.chautru@intel.com> Acked-by: Dave Burley <dave.burley@accelercomm.com> Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
Nicolas Chautru [Thu, 26 Mar 2020 03:27:42 +0000 (20:27 -0700)]
baseband/turbo_sw: support large size code block
This is to support cases when the input data for
decoding a code block is larger than 64kB and would
not fit as a contiguous block of data into one
mbuf. In that case the length from the operation
supersedes the mbuf default structure.
Signed-off-by: Nicolas Chautru <nicolas.chautru@intel.com> Acked-by: Dave Burley <dave.burley@accelercomm.com> Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
The actual LLR representation was incorrectly assumed to be 2
instead of 4. This would impact wireless performance but is not
critical to be back ported on LTS branches.
Fixes: c769c711757a ("baseband/turbo_sw: extend for 5G") Cc: stable@dpdk.org Signed-off-by: Nicolas Chautru <nicolas.chautru@intel.com> Acked-by: Dave Burley <dave.burley@accelercomm.com> Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
Data corruption happens due to incorrect destroy of session. Security
session needs process different from crypto session.
Destroy corresponding sessions according to different security actions.
Fixes: 05fe65eb66b2 ("test/ipsec: introduce functional test") Cc: stable@dpdk.org Signed-off-by: Ruifeng Wang <ruifeng.wang@arm.com> Reviewed-by: Phil Yang <phil.yang@arm.com> Reviewed-by: Gavin Hu <gavin.hu@arm.com> Tested-by: Konstantin Ananyev <konstantin.ananyev@intel.com> Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
Improve case where application set m_dst to same as m_src
so really an in-place operation, though would have been treated
as out-of-place. No functional change but this path can now benefit
from DMA alignment.
Adam Dybkowski [Thu, 20 Feb 2020 15:04:15 +0000 (16:04 +0100)]
cryptodev: fix missing device id range checking
This patch adds range-checking of the device id passed from
the user app code. It prevents out-of-range array accesses
which in some situations resulted in an
application crash (segfault).
Fixes: 3dd4435cf473 ("cryptodev: fix checks related to device id") Cc: stable@dpdk.org Signed-off-by: Adam Dybkowski <adamx.dybkowski@intel.com> Acked-by: Fiona Trahe <fiona.trahe@intel.com> Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
Lukasz Bartosik [Thu, 27 Feb 2020 16:18:35 +0000 (17:18 +0100)]
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>
Lukasz Bartosik [Thu, 27 Feb 2020 16:18:33 +0000 (17:18 +0100)]
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>
Lukasz Bartosik [Thu, 27 Feb 2020 16:18:30 +0000 (17:18 +0100)]
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>
Lukasz Bartosik [Thu, 27 Feb 2020 16:18:29 +0000 (17:18 +0100)]
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>
Anoob Joseph [Thu, 27 Feb 2020 16:18:27 +0000 (17:18 +0100)]
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>
Anoob Joseph [Thu, 27 Feb 2020 16:18:26 +0000 (17:18 +0100)]
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>
Anoob Joseph [Thu, 27 Feb 2020 16:18:25 +0000 (17:18 +0100)]
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>
Anoob Joseph [Thu, 27 Feb 2020 16:18:24 +0000 (17:18 +0100)]
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>
Ankur Dwivedi [Thu, 27 Feb 2020 16:18:23 +0000 (17:18 +0100)]
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>
Change format for uint64_t to %"PRIu64" to make compiler happy.
Fixes: 103809d032cd ("app/test-fib: add test application for FIB") Cc: stable@dpdk.org Signed-off-by: Vladimir Medvedkin <vladimir.medvedkin@intel.com>
app/test-fib: fix possible use of uninitialized data
Compiler can throw warning message for routes and lookup files.
Fixes: 103809d032cd ("app/test-fib: add test application for FIB") Cc: stable@dpdk.org Signed-off-by: Vladimir Medvedkin <vladimir.medvedkin@intel.com>
Asim Jamshed [Mon, 16 Mar 2020 18:42:36 +0000 (18:42 +0000)]
fib: fix headers for C++ support
This patch allows C++ programs to use librte_fib library routines.
Previously C++ programs were not able to link this library and programs
would fail to get linked. With this patch compilation and linking
will be successful.
Fixes: 39e927248416 ("fib: add FIB library") Fixes: 40d41a8a7b34 ("fib: support IPv6") Cc: stable@dpdk.org Signed-off-by: Asim Jamshed <asim.jamshed@gmail.com> Signed-off-by: Saikrishna Edupuganti <saikrishna.edupuganti@intel.com> Reviewed-by: David Marchand <david.marchand@redhat.com> Acked-by: Vladimir Medvedkin <vladimir.medvedkin@intel.com>
None of the public functions modify IPv6 address passed. So their
parameters are made const - with the exception of bulk functions.
This exception is due to compatibility problems - some compilers report
problems with const-casting of array of arrays.
Previously only lookup and add were updated to have addresses passed as
const so I'm adding this fixline.
Fixes: d82927d2f81d ("lpm6: make IPv6 address immutable") Cc: stable@dpdk.org Signed-off-by: Andrzej Ostruszka <aostruszka@marvell.com> Acked-by: Vladimir Medvedkin <vladimir.medvedkin@intel.com>
Thomas Monjalon [Fri, 27 Mar 2020 01:15:38 +0000 (02:15 +0100)]
eal: move common header files
The EAL API (with doxygen documentation) is moved from
common/include/ to include/, which makes more clear that
it is the global API for all environments and architectures.
Note that the arch-specific and OS-specific include files are not
in this global include directory, but include/generic/ should
cover the doxygen documentation for them.
Signed-off-by: Thomas Monjalon <thomas@monjalon.net> Acked-by: David Marchand <david.marchand@redhat.com>
Thomas Monjalon [Fri, 27 Mar 2020 01:15:37 +0000 (02:15 +0100)]
eal: simplify meson build of common directory
The variable common_sources allows to change the list of common files
from an arch-specific or OS-specific meson file.
For consistency and least surprise principle, this variable is removed.
Now the list of common sources is defined only in common/meson.build.
As a consequence, the temporary list of files which are currently supported
on Windows, is moved from windows/eal/meson.build.
Signed-off-by: Thomas Monjalon <thomas@monjalon.net> Acked-by: David Marchand <david.marchand@redhat.com>
Thomas Monjalon [Fri, 27 Mar 2020 01:15:36 +0000 (02:15 +0100)]
eal: move arch-specific header files
The arch-specific directories arm, ppc and x86 in common/include/arch/
are moved as include/ sub-directories of respective arch directories:
- arm/include/
- ppc/include/
- x86/include/
Signed-off-by: Thomas Monjalon <thomas@monjalon.net> Reviewed-by: Gavin Hu <gavin.hu@arm.com> Reviewed-by: David Christensen <drc@linux.vnet.ibm.com> Acked-by: David Marchand <david.marchand@redhat.com>
Thomas Monjalon [Fri, 27 Mar 2020 01:15:35 +0000 (02:15 +0100)]
eal: move arch-specific C files
The arch-specific directories arm, ppc and x86 in common/arch/
are moved at the same level as the OS-specific directories.
It makes more clear that EAL is covering a matrix combining OS and arch.
Signed-off-by: Thomas Monjalon <thomas@monjalon.net> Reviewed-by: David Christensen <drc@linux.vnet.ibm.com> Acked-by: David Marchand <david.marchand@redhat.com>
Thomas Monjalon [Fri, 27 Mar 2020 01:15:34 +0000 (02:15 +0100)]
build: rename ppc sub-directories
The directories ppc_64 are renamed as ppc in
- config/
- lib/librte_eal/common/arch/
- lib/librte_eal/common/include/arch/
The EAL directories are not really renamed, but symbolically linked,
because they will be moved with their new name in the next commits.
If ppc_32 needs to be supported, it can be in the same directory.
The arch directories arm and x86 are already covering both 32 and 64-bit
sub-architectures.
Signed-off-by: Thomas Monjalon <thomas@monjalon.net> Reviewed-by: David Christensen <drc@linux.vnet.ibm.com> Acked-by: David Marchand <david.marchand@redhat.com>
Introduction of pinned external buffers doubled memory loads in the
rte_pktmbuf_prefree_seg() function. Analysis of the generated assembly
code shows unnecessary load of the pool field of the rte_mbuf structure.
Here is the snippet of the assembly for "if (!RTE_MBUF_DIRECT(m))":
Before the change the code was:
movq 0x18(%rbx), %rax // load the ol_flags field
test %r13, %rax // check if ol_flags equals to 0x60...0
jz 0x9a8718 <Block 2> // jump out to "if (m->next != NULL)"
After the change the code became:
movq 0x18(%rbx), %rax // load ol_flags
test %r14, %rax // check if ol_flags equals to 0x60...0
jnz 0x9bea38 <Block 2> // jump in to "if (!RTE_MBUF_HAS_EXTBUF(m)"
movq 0x48(%rbx), %rax // load the pool field
jmp 0x9bea78 <Block 7> // jump out to "if (m->next != NULL)"
Look like this absolutely unneeded memory load of the pool field is an
optimization for the external buffer case in GCC (4.8.5), since Clang
generates the same assembly for both before and after the change versions.
Plus, GCC favors the external buffer case over the simple case.
This assembly code layout causes the performance degradation because the
rte_pktmbuf_prefree_seg() function is a part of a very hot path.
Workaround this compilation issue by moving the check for pinned buffer
apart from the check for external buffer and restore the initial code
flow that favors the direct mbuf case over the external one.
Somnath Kotur [Fri, 14 Feb 2020 06:43:53 +0000 (12:13 +0530)]
bus/pci: fix devargs on probing again
As per the comments in this code section, since there is a matching device,
it is now its responsibility to manage the devargs we've just inserted.
But the matching device ptr's devargs is still uninitialized or not pointing
to the newest dev_args that were passed as a parameter to local_dev_probe().
This is needed particularly in the case when *probe is called again* on an
already probed device as part of adding a representor port to OVS-DPDK.
Yunjian Wang [Fri, 27 Mar 2020 08:09:55 +0000 (09:09 +0100)]
kvargs: fix buffer overflow when parsing list
When the input string is "key=[", the ending '\0' is replaced
by a ',', leading to a heap buffer overflow.
Check the content of ctx1 to avoid this problem.
Fixes: cc0579f2339a ("kvargs: support list value") Cc: stable@dpdk.org Signed-off-by: Yunjian Wang <wangyunjian@huawei.com> Signed-off-by: Olivier Matz <olivier.matz@6wind.com> Reviewed-by: David Marchand <david.marchand@redhat.com>
Olivier Matz [Fri, 27 Mar 2020 08:09:54 +0000 (09:09 +0100)]
test/kvargs: fix invalid cases check
The return was not properly placed, and only the first test case
was validated.
Fixes: e495f5435524 ("kvargs: add test case in app/test") Cc: stable@dpdk.org Signed-off-by: Olivier Matz <olivier.matz@6wind.com> Reviewed-by: David Marchand <david.marchand@redhat.com>
Olivier Matz [Fri, 27 Mar 2020 08:09:53 +0000 (09:09 +0100)]
test/kvargs: fix to consider empty elements as valid
Empty elements passed to the kvargs parser are silently
ignored. Examples of valid strings:
""
","
",,,,,,key=val,,,,"
Fix the unit tests to conform to this behavior.
Note: the test_invalid_kvargs() function is currently broken, which
explain why the tests were not failing. It is fixed in the next commit.
Fixes: e495f5435524 ("kvargs: add test case in app/test") Cc: stable@dpdk.org Signed-off-by: Olivier Matz <olivier.matz@6wind.com> Reviewed-by: David Marchand <david.marchand@redhat.com>
Ferruh Yigit [Fri, 13 Mar 2020 14:51:59 +0000 (14:51 +0000)]
log: add API to check if a logtype can log in a given level
This is a helper function in case components would like to do more work
than just logging a message based on log level, like for example
collecting some stats if the log type is DEBUG etc..
A few existing relevant usage converted to this new API.
Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com> Acked-by: Hyong Youb Kim <hyonkim@cisco.com> Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com> Reviewed-by: Andrzej Ostruszka <aostruszka@marvell.com> Acked-by: David Marchand <david.marchand@redhat.com>
Anatoly Burakov [Fri, 7 Feb 2020 11:11:14 +0000 (11:11 +0000)]
mem: preallocate VA space in no-huge mode
When --no-huge mode is used, the memory is currently allocated with
mmap(NULL, ...). This is fine in most cases, but can fail in cases
where DPDK is run on a machine with an IOMMU that is of more limited
address width than that of a VA, because we're not specifying the
address hint for mmap() call.
Fix it by preallocating VA space before mapping it.
Cc: stable@dpdk.org Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com> Tested-by: David Marchand <david.marchand@redhat.com> Tested-by: Jun W Zhou <junx.w.zhou@intel.com>
Anatoly Burakov [Tue, 25 Feb 2020 13:24:48 +0000 (13:24 +0000)]
vfio: map contiguous areas in one go
Currently, when we are creating DMA mappings for memory that's
either external or is backed by hugepages in IOVA as PA mode, we
assume that each page is necessarily discontiguous. This may not
actually be the case, especially for external memory, where the
user is able to create their own IOVA table and make it
contiguous. This is a problem because VFIO has a limited number
of DMA mappings, and it does not appear to concatenate them and
treats each mapping as separate, even when they cover adjacent
areas.
Fix this so that we always map contiguous memory in a single
chunk, as opposed to mapping each segment separately.
Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com> Acked-by: Ray Kinsella <ray.kinsella@intel.com>
The source callback list grows infinitely when more than alarm
is queued.
This fix recognizes that an alarm interrupt in FreeBSD should never
have more than one callback on its list, so if
rte_intr_callback_register() is called with an interrupt handle type
of RTE_INTR_HANDLE_ALARM, so if such an interrupt type already has a
non-empty list, then a new callback is not created, but the kevent
timer is restarted properly.
Fixes: 23150bd8d8a8 ("eal/bsd: add interrupt thread") Cc: stable@dpdk.org Signed-off-by: Mit Matelske <mit@pt.net> Acked-by: Bruce Richardson <bruce.richardson@intel.com>
Ruifeng Wang [Mon, 23 Mar 2020 19:59:25 +0000 (20:59 +0100)]
ci: run tests even without hugepage
As fast-tests suite generated with only applicable cases included,
hugepage is not a mandatory to run the test.
Ignore the result of hugepage set up, so that validation in environment
without hugepage can proceed.
Signed-off-by: Ruifeng Wang <ruifeng.wang@arm.com> Reviewed-by: Gavin Hu <gavin.hu@arm.com> Acked-by: Aaron Conole <aconole@redhat.com>
Ruifeng Wang [Mon, 23 Mar 2020 19:59:24 +0000 (20:59 +0100)]
test: allow no-huge mode for fast-tests
In environments where hugepage are not available, such as
containers, many cases in fast-tests suite should also run
if no-huge EAL option is used.
Flag is appended to each case in fast-tests suite to indicate
whether it lives with no-huge mode.
With the flag, fast-tests suite can be generated based on
detected hugepage availability of building environment.
All cases will be valid if hugepage is available, whereas
only applicable cases will be added if environment has no
hugepage support.
Suggested-by: Aaron Conole <aconole@redhat.com> Signed-off-by: Ruifeng Wang <ruifeng.wang@arm.com> Reviewed-by: Gavin Hu <gavin.hu@arm.com> Acked-by: Aaron Conole <aconole@redhat.com> Signed-off-by: David Marchand <david.marchand@redhat.com>
Ruifeng Wang [Mon, 23 Mar 2020 19:59:23 +0000 (20:59 +0100)]
test: skip some subtests in no-huge mode
When running with '--no-huge' flag, tests failed with messages as:
ACL context creation with invalid NUMA should have failed!
fbk hash creation should have failed
test_table_pipeline: Check pipeline invalid params failed.
These cases test against invalid socket ID as input parameter, and
expect error return. But function calls return success because
invalid sock ID is overwritten to SOCKET_ID_ANY when in no-huge mode.
The tests against invalid socket ID are skipped in no-huge mode.
Fixes: 5640171c528a ("malloc: fix external heap allocation in no-huge mode") Cc: stable@dpdk.org Signed-off-by: Ruifeng Wang <ruifeng.wang@arm.com> Reviewed-by: Gavin Hu <gavin.hu@arm.com> Acked-by: Aaron Conole <aconole@redhat.com> Acked-by: Yipeng Wang <yipeng1.wang@intel.com>
David Marchand [Mon, 23 Mar 2020 19:59:22 +0000 (20:59 +0100)]
test: load drivers when required
Concatenating to test_args if event_eth_tx_adapter_autotest is executed
makes all subsequent tests inherit from the drivers loading while this
is unneeded.
Fixes: 207b1c813f39 ("test: fix build without ring PMD") Cc: stable@dpdk.org Signed-off-by: David Marchand <david.marchand@redhat.com> Reviewed-by: Ruifeng Wang <ruifeng.wang@arm.com> Acked-by: Aaron Conole <aconole@redhat.com>
David Marchand [Tue, 17 Mar 2020 16:25:21 +0000 (17:25 +0100)]
devtools: silence meson install
Installing with ninja is quite verbose by default, hide ninja output under
TEST_MESON_BUILD_VERBOSE and TEST_MESON_BUILD_VERY_VERBOSE options.
Signed-off-by: David Marchand <david.marchand@redhat.com> Acked-by: Bruce Richardson <bruce.richardson@intel.com> Acked-by: Thomas Monjalon <thomas@monjalon.net>
Fix check symbol change script to detect new diff file when
it is in between "--- /dev/null" to "b/lib/...".
Current awk line expects line to start with "a/..."
which is not always true for all diffs.
As a result if in_map was '1' earlier, it will not be changed
to '0' and we get check patch errors which are not true.
Fixes: 4bec48184e33 ("devtools: add checks for ABI symbol addition") Cc: stable@dpdk.org Signed-off-by: David Marchand <david.marchand@redhat.com> Signed-off-by: Nithin Dabilpuram <ndabilpuram@marvell.com> Acked-by: Neil Horman <nhorman@tuxdriver.com> Tested-by: Jerin Jacob <jerinj@marvell.com>
Phil Yang [Mon, 9 Mar 2020 17:19:55 +0000 (01:19 +0800)]
ring: fix unaligned memory access on aarch32
The 32-bit arm machine doesn't support unaligned memory access. It
will cause a bus error on aarch32 with the custom element size ring.
Thread 1 "test" received signal SIGBUS, Bus error.
__rte_ring_enqueue_elems_64 (n=1, obj_table=0xf5edfe41, prod_head=0, \
r=0xf5edfb80) at /build/dpdk/build/include/rte_ring_elem.h:177
177 ring[idx++] = obj[i++];
Fixes: cc4b218790f6 ("ring: support configurable element size") Signed-off-by: Phil Yang <phil.yang@arm.com> Reviewed-by: Ruifeng Wang <ruifeng.wang@arm.com> Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
Jim Harris [Mon, 9 Mar 2020 10:00:25 +0000 (03:00 -0700)]
contigmem: cleanup properly when load fails
If contigmem is not able to allocate all of the
requested buffers, it frees whatever buffers were
able to be allocated up until that point.
But the pointers are not set to NULL in that case.
After the load fails, the FreeBSD kernel will
immediately call the contigmem unload handler, which
tries to free the buffers again since the pointers
were not set to NULL.
It's not clear that we should just rely on the unload
handler getting called after load failure. So let's
keep the existing cleanup code in the load handler,
but explicitly set the pointers to NULL after freeing
them.
Fixes: 5f51eca22489 ("contigmem: free allocated memory on error") Cc: stable@dpdk.org Signed-off-by: Jim Harris <james.r.harris@intel.com> Acked-by: Bruce Richardson <bruce.richardson@intel.com>
There is a non-optimal check if doorbell is needed present in the
mlx5_tx_handle_completion() function. Advancing a copy of the txq
consumer index and checking this copy with initial value causes
unnecessary memory loads and hurts the performance. It is better to
have a simple small boolean variable for this purpose. That allows
to eliminate all the excessive memory operations with the txq consumer
index and restore the performance of the tx completions.
Dekel Peled [Mon, 16 Mar 2020 08:57:39 +0000 (10:57 +0200)]
net/mlx5: fix CVLAN tag set in IP item translation
Previous fix added, at the end of functions
flow_dv_translate_item_ipv4() and flow_dv_translate_item_ipv6(), the
setting of cvlan_tag mask.
In the case of unspecified item (item->spec == null) these functions
return, and the new code section is not reached.
This patch moves the setting of cvlan_tag mask to be done before the
check of item->spec, to make sure it is always executed.
Fixes: 797329d6c4a1 ("net/mlx5: fix match on ethertype and CVLAN tag") Cc: stable@dpdk.org Signed-off-by: Dekel Peled <dekelp@mellanox.com> Acked-by: Matan Azrad <matan@mellanox.com>
Xiaoyun Wang [Sat, 14 Mar 2020 10:02:06 +0000 (18:02 +0800)]
net/hinic: allocate IO memory with socket id
This patch makes IO memory allocation with socketid,
the txq or rxq descriptor and IO resource can be allocated with
socketid that passed by queue setup ops, which can improve
performance for cross-numa scene.
Cc: stable@dpdk.org Signed-off-by: Xiaoyun Wang <cloud.wangxiaoyun@huawei.com>
Wisam Jaddo [Thu, 12 Mar 2020 09:24:40 +0000 (11:24 +0200)]
net/mlx5: fix zero metadata action
There is no reason to prevent the user from using zero metadata,
it indeed means no metadata, but sometimes the user may need to
report to datapath that there is no metadata anymore, which is
valid case.
Guinan Sun [Wed, 11 Mar 2020 09:06:51 +0000 (09:06 +0000)]
net/ixgbe: fix setting VF MAC address
The reason why PF cannot receive data normally is that vf performed
the clear_rar operation through dev close without adding a mac address.
This will cause the association between the index and rx address set
by VMDq to be cancelled,thus affecting the data reception of PF. The
correction method is to add a check action, and do not perform the
set_rar operation without adding a mac address to prevent affecting the
reception of data.
Fixes: 3c4270187518 ("net/ixgbe: support VF MAC address add/remove") Cc: stable@dpdk.org Signed-off-by: Guinan Sun <guinanx.sun@intel.com> Acked-by: Xiaolong Ye <xiaolong.ye@intel.com>
Karra Satwik [Wed, 11 Mar 2020 09:05:51 +0000 (14:35 +0530)]
net/cxgbe: add devargs to control filtermode and filtermask
Apart from the 4-tuple (IP src/dst addresses and TCP/UDP src/dst
port addresses), there are only 40-bits available to match other
fields in packet headers. Not all combinations of packet header
fields can fit in the 40-bit tuple.
Currently, the combination of packet header fields to match are
configured via filterMode for LETCAM filters and filterMask for
HASH filters in firmware config files (t5/t6-config.txt). So, add
devargs to allow User to dynamically select the filterMode and
filterMask combination during runtime, without having to modify the
firmware config files and reflashing them onto the adapter. A table
of supported combinations is maintained by the driver to internally
translate the User specified devargs combination to hardware's internal
format before writing the requested combination to hardware
Signed-off-by: Karra Satwik <kaara.satwik@chelsio.com> Signed-off-by: Rahul Lakkireddy <rahul.lakkireddy@chelsio.com>
Karra Satwik [Wed, 11 Mar 2020 09:05:50 +0000 (14:35 +0530)]
net/cxgbe: use firmware API for validating filter spec
Add new firmware API FW_PARAM_DEV_FILTER_MODE_MASK to fetch
the filtermode and filtermask values configured in hardware,
which are used to validate the match combinations in the filter
spec before offloading the filter rules to hardware. For older
firmware that doesn't support the new API, fallback to older way
of directly reading from indirect registers
Signed-off-by: Karra Satwik <kaara.satwik@chelsio.com> Signed-off-by: Rahul Lakkireddy <rahul.lakkireddy@chelsio.com>
Karra Satwik [Wed, 11 Mar 2020 09:05:49 +0000 (14:35 +0530)]
net/cxgbe: support flow API for source MAC rewrite
Add support to rewrite Source MAC addresses. The new Source
MAC address is written into a free entry in the SMT table
and the corresponding SMT index is used by hardware to
rewrite the Source MAC address of the packets hitting the
flow.
Signed-off-by: Karra Satwik <kaara.satwik@chelsio.com> Signed-off-by: Rahul Lakkireddy <rahul.lakkireddy@chelsio.com>
Karra Satwik [Wed, 11 Mar 2020 09:05:48 +0000 (14:35 +0530)]
net/cxgbe: support Source MAC Table
Source MAC Table (SMT) is used for storing Source MAC
addresses to be written in packets transmitted on the
wire. Hence, the SMT table can be used for overwriting
Source MAC addresses in packets, hitting corresponding
filter rules inserted by the rte_flow API.
Query firmware for SMT start and size information available
to the underlying PF. Allocate and maintain the corresponding
driver's copy of the hardware SMT table, with appropriate
refcount mechanism. If SMT information is not available, then
use the entire hardware SMT table.
Signed-off-by: Karra Satwik <kaara.satwik@chelsio.com> Signed-off-by: Rahul Lakkireddy <rahul.lakkireddy@chelsio.com>
Karra Satwik [Wed, 11 Mar 2020 09:05:47 +0000 (14:35 +0530)]
net/cxgbe: support flow API for destination MAC rewrite
Add support for overwriting destination MAC addresses.
The new MAC address is written into a free entry in the
L2T table and the corresponding L2T index is used by
hardware to overwrite the destination MAC address of the
packets hitting the flow
Signed-off-by: Karra Satwik <kaara.satwik@chelsio.com> Signed-off-by: Rahul Lakkireddy <rahul.lakkireddy@chelsio.com>
Karra Satwik [Wed, 11 Mar 2020 09:05:46 +0000 (14:35 +0530)]
net/cxgbe: support flow API for matching all packets on VF
Add support to match all packets received on the underlying VF.
Use new firmware API to fetch the Virtual Interface Number (VIN)
allocated to each VF by the firmware. The VIN is required to
write filter rules to match all packets on VFs, whose identifier
is beyond max 7-bit value (i.e. 127) in VIID.
If firmware doesn't support fetching the VIN information, then
fallback to manually retrieving the VIN value from the 7-bit field
in the VIID, which only supports in range of 0..127. In this case,
packets belonging to VFs, whose identifier is beyond 127 can't be
matched.
Signed-off-by: Karra Satwik <kaara.satwik@chelsio.com> Signed-off-by: Rahul Lakkireddy <rahul.lakkireddy@chelsio.com>
Karra Satwik [Wed, 11 Mar 2020 09:05:45 +0000 (14:35 +0530)]
net/cxgbe: support flow API for matching all packets on PF
Add support to match all packets received on the underlying PF
Note that the same 17-bit hardware tuple is shared between QinQ
and PF match. Hence, match on either QinQ or PF only can be done
at a time. Both QinQ and PF match can't be enabled at the same time.
Also, remove check to reject rules without spec because
RTE_FLOW_ITEM_TYPE_PF doesn't require a spec. Due to this check
removal, RTE_FLOW_ITEM_TYPE_PHY_PORT item needs to be updated to
handle NULL spec
Signed-off-by: Karra Satwik <kaara.satwik@chelsio.com> Signed-off-by: Rahul Lakkireddy <rahul.lakkireddy@chelsio.com>
Karra Satwik [Wed, 11 Mar 2020 09:05:43 +0000 (14:35 +0530)]
net/cxgbe: support flow API for matching QinQ VLAN
Add support to match fields in 802.1ad Q-in-Q VLAN packets.
Relax check for repeated pattern items for RTE_FLOW_ITEM_TYPE_VLAN
item, since the same item is used to represent both QinQ and VLAN
packets.
When QinQ match is enabled, the ethertype field in the hardware
spec must contain the innermost VLAN header's ethertype field,
and not the Ethernet header's ethertype field. The hardware
automatically searches for ethertype 0x88A8/0x8100 in Ethernet
header, when parsing incoming packet against QinQ/VLAN pattern,
respectively.
Signed-off-by: Karra Satwik <kaara.satwik@chelsio.com> Signed-off-by: Rahul Lakkireddy <rahul.lakkireddy@chelsio.com>
Igor Romanov [Tue, 10 Mar 2020 09:48:39 +0000 (09:48 +0000)]
net/sfc/base: handle manual and auto filter clashes in EF10
Make user filters a priority in EF10 datapath. When a manual
filter with a specification that is equal to an existing auto
filter is inserted, the manual filter:
- replaces auto filter if the specification is exclusive;
- is inserted along existing auto filter otherwise;
In the first case the auto filter that was replaced is saved.
This saved filter can be updated on filter reconfiguration and
is restored on the manual filter removal.
Fixes: e7cd430c864f ("net/sfc/base: import SFN7xxx family support") Cc: stable@dpdk.org Signed-off-by: Igor Romanov <igor.romanov@oktetlabs.ru> Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>