Guoyang Zhou [Fri, 20 Nov 2020 09:11:29 +0000 (17:11 +0800)]
net/hinic: fix hugepage memory leaks
The 'nic_io' memory is set to NULL before it is freed, this is wrong,
and the freeing of some private port resources should be moved from the
".remove(device)" function to the ".dev_close(port)" function.
Fixes: f30e69b41f94 ("ethdev: add device flag to bypass auto-filled queue xstats") Cc: stable@dpdk.org Signed-off-by: Guoyang Zhou <zhouguoyang@huawei.com>
Dekel Peled [Wed, 18 Nov 2020 08:59:56 +0000 (10:59 +0200)]
net/mlx5: fix input register for ASO object
Existing code uses the hard-coded value REG_C_5 as input for function
mlx5dv_dr_action_create_flow_hit().
This patch updates function mlx5_flow_get_reg_id() to return the
selected REG_C value for ASO Flow Hit operation.
The returned value is used, after reducing offset REG_C_0, as input
for function mlx5dv_dr_action_create_flow_hit().
Fixes: f935ed4b645a ("net/mlx5: support flow hit action for aging") Signed-off-by: Dekel Peled <dekelp@nvidia.com> Acked-by: Matan Azrad <matan@nvidia.com>
Dekel Peled [Wed, 18 Nov 2020 08:59:55 +0000 (10:59 +0200)]
net/mlx5: fix memory leak on ASO age close
Recent patch introduced the use of ASO flow hit action for age action.
The relevant management struct uses dynamically allocated memory.
This memory was not freed on closing.
This patch adds memory freeing as needed.
Fixes: f935ed4b645a ("net/mlx5: support flow hit action for aging") Signed-off-by: Dekel Peled <dekelp@nvidia.com> Acked-by: Matan Azrad <matan@nvidia.com>
Gregory Etelson [Thu, 19 Nov 2020 11:10:24 +0000 (13:10 +0200)]
app/testpmd: fix flow tunnel commands
testpmd provides commands to test tunnel offload rte_flow
capabilities. Testpmd tunnel commands allow to configure new ofloaded
tunnel types, list existing offloaded tunnels and destroy existing
offloaded tunnels.
Tunnel offload commands allowed parameters repetition. For example,
the following commands were accepted:
testpmd> flow tunnel create 0 create 1 type vxlan
or
testpmd> flow tunnel list 0 list 1
Current patch fixed that fault. Correct tunnel commands syntax is:
testpmd> flow tunnel create <port> type <tunnel type>
testpmd> flow tunnel list <port>
testpmd> flow tunnel destroy <port> id <tunnel id>
Fixes: 1b9f274623b8 ("app/testpmd: add commands for tunnel offload") Signed-off-by: Gregory Etelson <getelson@nvidia.com> Acked-by: Ori Kam <orika@nvidia.com> Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
Gregory Etelson [Wed, 18 Nov 2020 18:23:59 +0000 (20:23 +0200)]
net/mlx5: fix restore info in non-tunnel traffic
Tunnel offload API provides applications with ability to restore
packet outer headers after partial offload. Exact feature execution
depends on hardware abilities and PMD implementation. Hardware that is
supported by MLX5 PMD places a mark on a packet after partial offload.
PMD decodes that mark and provides application with required
information.
Application can call the restore API for packets that are part of
offloaded tunnel and not. It's up to a PMD to provide correct
information.
Current MLX5 tunnel offload implementation does not allow applications
to use flow MARK actions. It is restricted to tunnel offload use only.
This fault was triggered by application that did not activate tunnel
offload and called the restore API with a marked packet. The PMD tried
to decode the mark value and crashed. The patch decodes mark value
only if tunnel offload is active.
Bing Zhao [Thu, 19 Nov 2020 02:41:32 +0000 (10:41 +0800)]
net/mlx5: fix eCPRI item value with mask
When creating a flow with eCPRI item, the mask and the value are both
needed in order to build the matching criteria.
In the current implementation, the unused value bits clear operation
was missed when filling the mask and value fields. For the value, the
bits not required were not masked with the mask provided. Indeed,
this action is not mandatory. But when creating a flow in the root
table, the kernel driver got involved and a check would prevent this
flow from being created. The same flow could be created successfully
with the userspace rdma-core on the non-root tables.
An AND operation needs to be added to clear the unused bits in the
value when building the matching criteria. Then the same flow can be
created successfully no matter with kernel driver or with rdma-core.
Suanming Mou [Thu, 19 Nov 2020 01:19:47 +0000 (09:19 +0800)]
net/mlx5: fix sample and mirror flow action deletion
The sample and mirror action objects are maintained on the list
shared between the ports belonging to the same multiport Infiniband
device(between representors).
The actions in the NIC steering domains might contain the references
to the sub-flow action objects created over the given port. The action
deletion might happen in the context of the different port and on the
deletion of referenced objects the incorrect port might be specified.
To avoid this we should save the port on what the sub-flow actions
were created and then use this saved port for sub-flow action release.
This commit saves the create device in the sample and mirror actions
struct to avoid using the incorrect port device in releasing.
Fixes: 19784141692e ("net/mlx5: make sample and mirror action thread safe") Signed-off-by: Suanming Mou <suanmingm@nvidia.com> Reviewed-by: Jiawei Wang <jiaweiw@nvidia.com> Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
Suanming Mou [Wed, 18 Nov 2020 02:20:24 +0000 (10:20 +0800)]
net/mlx5: fix header reformat action hash key
Currently, header reformat action uses the hash list 32-bit key
generated in header reformat register function directly. The key will
not be recalculated in the hash list function.
As the 64-bit key is composed of the 32-bit attributes and 32-bit
reformat buffer csum, the hash list function only gets 32-bit key
directly will take the attribute part only, csum part will be ignored.
For different header reformat actions, the attributes can be the same,
while the buffer will be different. Only take the attribute part causes
lots of the conflicts.
This commits adds the attribute part and the significant different csum
part for the key.
The MLX5_ENCAPSULATION_DECISION_SIZE constant is used
to check the raw encap/decap actions for the raw header
size. The header is constructed of the rte_xxx_hdr
structures instead of rte items. Hence, constant
must be defined with rte_xxx_hdr structure sizes.
Fixes: 50f576d657d7 ("net/mlx5: fix VLAN actions in meter") Cc: stable@dpdk.org Signed-off-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com> Acked-by: Ori Kam <orika@nvidia.com> Acked-by: Suanming Mou <suanmingm@nvidia.com>
Xueming Li [Tue, 17 Nov 2020 11:01:38 +0000 (11:01 +0000)]
net/mlx5: set representor to first PF in bonding mode
When the representor device was set to PF1 in bonding mode, iterating
device iterator that looking for representors by bonding device failed
to match PF0 pci address with PF1 address. So detaching PF bonding
device only detached all representors on PF0.
This patch registers all representors of PF1 with PF0 as PCI device.
Signed-off-by: Xueming Li <xuemingl@nvidia.com> Reviewed-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
net/mlx5: fix WQE counter assert in free completion queue
The following assertion fails in case RTE_ENABLE_ASSERT is enabled:
PANIC in mlx5_tx_handle_completion():
assert "(txq->fcqs[txq->cq_ci & txq->cqe_m] >> 16)
== cqe->wqe_counter" failed
The free completion queue only contains an expected WQE counter if
RTE_LIBRTE_MLX5_DEBUG is enabled as well. Thus enabling
RTE_ENABLE_ASSERT alone causes the assert to fail.
Compile the assert conditionally only if RTE_ENABLE_ASSERT is enabled.
The kernel can use two approaches to distinguish the E-Switch
source vport in the packet metadata - either with dedicated
source_port field or register C0. To eliminate the extra source
vport matching in the hardware the source_port field can be
set to specific values (0xFFFF) for the wire source port.
This match can be applied to recognize wire port only in FDB
domain. Missing the register C0 match in the NIC Rx domain causes
incorrect representor steering within shared IB device ports
and must be always specified (if kernel uses this approach).
Harman Kalra [Mon, 16 Nov 2020 14:41:55 +0000 (20:11 +0530)]
common/octeontx2: fix mbox response by syncing data types
Syncing the data types of msix offset mbox response structure
fields wrt rvu_pfvf structure as in msix offset mbox handler,
respective block LFs response field is initialised with rvu_pfvf
and mismatch in the data types of respective fields may lead
to issues.
This mismatch in data types resulted in a bug where no sso msix
offsets are returned. For 256 SSO hwgrps, 256 msix offsets
are required, but since num of sso lf field (rsp->sso) in
response structure is u8 and is initialised with same field
in pfvf structure viz u16, value 256 corresponds to 0 hence
no sso_msixoff.
Similar mbox changes are required in kernel side also which are
available in marvell SDK version SDK-11.0.
Fixes: 2b71657c8660 ("common/octeontx2: add mbox request and response definition") Cc: stable@dpdk.org Signed-off-by: Harman Kalra <hkalra@marvell.com> Acked-by: Jerin Jacob <jerinj@marvell.com>
Didier Pallard [Tue, 17 Nov 2020 11:26:47 +0000 (12:26 +0100)]
net/mlx5: fix Rx descriptor status
Three bugs in rx_queue_count function:
- One entry may contain several segments, so 'used' must be multiplied
by number of segments per entry to properly reflect the queue usage.
- The number of cqes is equals to (1U << rxq->elts_n) - 1 in SPRQ mode.
The range returned by rx_queue_count should be the number of entries
used in queue, so it ranges from 0 to max number of entries
in queue, not this number minus one.
- For MPRQ mode, we need to take into account of the number of strd.
Maxime Leroy [Tue, 17 Nov 2020 11:26:46 +0000 (12:26 +0100)]
net/mlx5: fix Rx queue count calculation
The commit d2d57605522d ("net/mlx5: fix Rx queue count calculation") is
incorrect because the count calculation is wrong for the next cqe:
Example:
Compressed Set of packets 1 | Compressed Set of packets 2
C | a | e0 | e1 | e2 | e3 | e4 | e5 | C | a | e0
There are 2 compressed set of packets in the first queue. For the first
set, n is computed correctly.
But for the second, n is not computed properly. Because the zip context
is for the first set. The second set is not yet decompressed, so
there are no context.
To fix the issue, we should only use the zip context for the first CQEs
series.
Xiaoyu Min [Mon, 16 Nov 2020 02:07:59 +0000 (10:07 +0800)]
net/mlx5: fix RSS queue type validation
When the RSS queues' types are not uniformed, i.e, mixed with normal Rx
queue and hairpin queue, PMD accept this flow after commit[1] instead of
rejecting it.
This because commit[1] creates Rx queue object as DevX type via DevX API
instead of IBV type via Verbs, in which the latter will check the queues'
type when creating Verbs ind table but the former doesn't check when
creating DevX ind table.
However, in any case, logically PMD should check whether the input
configuration of RSS action is reasonable or not, which should
include queues' type check as well as the others.
So add the check of RSS queues' type in validation function to fix issue.
[1]:
commit 6deb19e1b2d2 ("net/mlx5: separate Rx queue object creations")
Fixes: 63bd16292c3a ("net/mlx5: support RSS on hairpin") Cc: stable@dpdk.org Signed-off-by: Xiaoyu Min <jackmin@nvidia.com> Acked-by: Matan Azrad <matan@nvidia.com>
Received packets can be aligned to the size of the cache line on
PCI transactions. This could improve performance by avoiding
partial cache line writes in exchange for increased PCI bandwidth.
This feature is supposed to be controlled by the rxq_pkt_pad_en
devarg and it is true for an RxQ created via the Verbs API.
But in the DevX API case, it is erroneously controlled by the
rxq_cqe_pad_en devarg instead, which is in charge of the CQE
padding instead and should not control the RxQ creation.
Fix DevX RxQ creation by using the proper configuration flag for
Rx packet padding that is being set by the rxq_pkt_pad_en devarg.
Fixes: dc9ceff73c99 ("net/mlx5: create advanced RxQ via DevX") Cc: stable@dpdk.org Signed-off-by: Alexander Kozyrev <akozyrev@nvidia.com> Acked-by: Matan Azrad <matan@nvidia.com>
Gregory Etelson [Mon, 16 Nov 2020 14:02:23 +0000 (16:02 +0200)]
net/mlx5: fix crash in tunnel offload setup
The new flow table resource management API triggered a PMD crash in
tunnel offload mode, when tunnel match flow rule was inserted before
tunnel set rule.
Reason for the crash was double flow table registration. The table was
registered by the tunnel offload code for the first time and once
more by PMD code, as part of general table processing. The table
counter was decremented only once during the rule destruction and
caused a resource leak that triggered the crash.
The patch updates PMD registration with tunnel offload parameters and
removes table registration in tunnel related code.
The original patch was removing active tunnel offload objects from a
tunnels db list without checking its reference counter value.
That action was leading to a PMD crash.
Current patch isolates tunnels db list into a separate API. That API
manages MT protection of the tunnel offload db.
Fixes: 5b38d8cd4663 ("net/mlx5: make tunnel hub list thread safe") Signed-off-by: Gregory Etelson <getelson@nvidia.com> Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
Gregory Etelson [Mon, 16 Nov 2020 14:02:21 +0000 (16:02 +0200)]
net/mlx5: fix tunnel offload object allocation
The original patch allocated tunnel offload objects with invalid
indexes. As the result, PMD tunnel object allocation failed.
In this patch indexed pool provides both an index and memory for a new
tunnel offload object.
Also tunnel offload ipool moved to dv enabled code only.
Fixes: 4ae8825c5085 ("net/mlx5: use indexed pool as id generator") Signed-off-by: Gregory Etelson <getelson@nvidia.com> Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
Gregory Etelson [Mon, 16 Nov 2020 14:02:20 +0000 (16:02 +0200)]
net/mlx5: fix structure passing method in function call
Tunnel offload implementation introduced 64 bit-field flow_grp_info
structure. Since the structure size is 64 bits, the code passed that
type by value in function calls.
The patch changes that structure passing method to reference.
Gregory Etelson [Mon, 16 Nov 2020 14:02:19 +0000 (16:02 +0200)]
net/mlx5: fix build with Direct Verbs disabled
Tunnel offload API is implemented for Direct Verbs environment only.
Current patch re-arranges tunnel related functions for compilation in
non Direct Verbs setups to prevent compilation failures. The patch
does not introduce new functions.
Ivan Malov [Mon, 16 Nov 2020 19:40:29 +0000 (22:40 +0300)]
net/sfc: rely on native thread safety in flow mechanism
The changeset that introduced common flow API thread safety
in fact introduced double locking to this particular PMD as
RTE flow API implementation in the PMD has been thread-safe
since the day zero. State this by setting the corresponding
device flag to skip locking imposed by generic RTE flow API.
Fixes: 80d1a9aff7f6 ("ethdev: make flow API thread safe") Signed-off-by: Ivan Malov <ivan.malov@oktetlabs.ru> Acked-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
Ivan Malov [Mon, 16 Nov 2020 19:23:03 +0000 (22:23 +0300)]
net/sfc: fix double free on encap transfer flow rule path
Don't free the outer match spec by its pointer in the parsing context
if it has already been tracked by an entry in the outer rule registry.
Fixes: dadff137931c ("net/sfc: support encap flow items in transfer rules") Signed-off-by: Ivan Malov <ivan.malov@oktetlabs.ru> Acked-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
Bruce Richardson [Mon, 16 Nov 2020 09:33:37 +0000 (09:33 +0000)]
examples/multi_process: add SPDX license tag to makefiles
The makefiles for some of the multi_process example files were missing
SPDX license headers, so add them. These Makefiles completely replaced
the older makefiles and were written from scratch, not based on previous
versions, so add a new copyright year on them.
Fixes: 13abe17c3cd4 ("examples/multi_process: convert to pkg-config-based build") Suggested-by: Stephen Hemminger <stephen@networkplumber.org> Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Thomas Monjalon [Tue, 17 Nov 2020 10:38:26 +0000 (11:38 +0100)]
devtools: rename build test verbosity variables
The verbosity was meant to be set with options -v and -vv,
or possibly with the environment variables TEST_MESON_BUILD_VERBOSE
and TEST_MESON_BUILD_VERY_VERBOSE.
It is decided to keep only the options -v and -vv,
so the variables are renamed with lower case, marking them as privates.
The handling of the verbosity level is also moved upper in the script,
closer to other initializations.
Signed-off-by: Thomas Monjalon <thomas@monjalon.net> Reviewed-by: David Marchand <david.marchand@redhat.com>
Anatoly Burakov [Thu, 19 Nov 2020 10:41:56 +0000 (10:41 +0000)]
doc: allow external build
Currently, when building sphinx documentation, the build will only
succeed if being run from the build system, because the conf.py script
expects DPDK_VERSION environment variable to be set, and crashes if it
is not.
However, there are certain external tools (such as sphinx documentation
preview extensions for certain IDE's) that use live preview and thus
rely on running their own sphinx commands. In these cases, it is useful
to permit building sphinx documentation without specifying the
DPDK_VERSION environment variable. The version string is the only thing
preventing manual sphinx build commands from working.
Fix the conf.py to use "None" as a version string in cases when
DPDK_VERSION environment variable is not set.
Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com> Acked-by: Bruce Richardson <bruce.richardson@intel.com>
Gaetan Rivet [Mon, 16 Nov 2020 10:12:12 +0000 (11:12 +0100)]
bus/pci: fix comment explaining device naming
The original triple negative was hard to read and the attempt
to improve the formulation was commendable, unfortunately the new
comment is the inverse of correct.
Fixes: a65a34a85ebf ("eal: replace usage of blacklist/whitelist in enums") Reported-by: David Marchand <david.marchand@redhat.com> Signed-off-by: Gaetan Rivet <grive@u256.net> Acked-by: Luca Boccassi <bluca@debian.org> Reviewed-by: David Marchand <david.marchand@redhat.com>
David Marchand [Mon, 16 Nov 2020 10:06:18 +0000 (11:06 +0100)]
bus/vdev: fix comment
RTE_DEV_WHITELISTED is now replaced with RTE_DEV_ALLOWED.
Fixes: a65a34a85ebf ("eal: replace usage of blacklist/whitelist in enums") Signed-off-by: David Marchand <david.marchand@redhat.com> Acked-by: Thomas Monjalon <thomas@monjalon.net>
eal: replace usage of blacklist/whitelist in enums
Rename the enum values in the EAL include files.
As a backward compatible temporary migration tool, define
a replacement mapping for old values.
The old names relating to blacklist and whitelist are replaced
by block list and allow list, but applications may be using the
older compatibility macros, marked as deprecated.
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org> Acked-by: Luca Boccassi <bluca@debian.org> Acked-by: Gaetan Rivet <grive@u256.net> Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com> Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Fix the detection of instruction pattern with multiple emits followed
by TX. Once detected, this is one of the instruction patterns that is
internally replaced with a single optimized instruction, as long as
none of the instructions to be replaced is referenced by a jump
instruction. The fix enforces this check for the TX instruction of
the pattern.
Conor Walsh [Tue, 10 Nov 2020 11:03:13 +0000 (11:03 +0000)]
test/ring: fix build for O1 optimization
When DPDK is compiled with gcc < 9 with the optimization level set to 1
gcc sees zcd in test_ring.h as possibly being uninitialised. To correct
this error if statements from _st_ring_dequeue_bulk and
_st_ring_enqueue_bulk were corrected within test_ring_mt_peek_stress_zc.c
Fixes: f72299fd157d ("test/ring: add stress tests for zero copy API") Signed-off-by: Conor Walsh <conor.walsh@intel.com> Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
David Marchand [Sat, 14 Nov 2020 09:05:33 +0000 (10:05 +0100)]
examples: restore trace point
Before make removal, those examples were built with experimental flag
for tracepoints to be compiled in but the pkg-config part of those
makefiles were missed.
Fixes: 78d44153de8f ("ethdev: add tracepoints") Cc: stable@dpdk.org Signed-off-by: David Marchand <david.marchand@redhat.com> Acked-by: Bruce Richardson <bruce.richardson@intel.com>
David Marchand [Sat, 14 Nov 2020 09:05:30 +0000 (10:05 +0100)]
examples/performance-thread: fix build with pkg-config
main.c: In function ‘lthread_tx’:
main.c:2091:25: error: implicit declaration of function ‘sched_getcpu’;
did you mean ‘sched_getparam’? [-Werror=implicit-function-declaration]
2091 | tx_conf->conf.cpu_id = sched_getcpu();
| ^~~~~~~~~~~~
| sched_getparam
cc1: all warnings being treated as errors
Explicitly pass _GNU_SOURCE and include missing header (rather than
rely on automagic inclusion from other system headers).
David Marchand [Sat, 14 Nov 2020 09:05:29 +0000 (10:05 +0100)]
examples/ntb: fix clean target
When introducing this example, the cleanup from commit 7e9562a107f1
("examples: fix make clean when using pkg-config") was missed.
Fixes: c5eebf85badc ("examples/ntb: add example for NTB") Cc: stable@dpdk.org Signed-off-by: David Marchand <david.marchand@redhat.com> Acked-by: Bruce Richardson <bruce.richardson@intel.com> Acked-by: Xiaoyun Li <xiaoyun.li@intel.com>
David Marchand [Sat, 14 Nov 2020 09:05:28 +0000 (10:05 +0100)]
examples/l3fwd-graph: fix pkg-config usage
This example missed the fixes from commit 69b1bb49ed82
("examples: hide error for missing pkg-config path flag") and
commit 12a652a02b08 ("examples: fix build with old pkg-config").
David Marchand [Sat, 14 Nov 2020 09:05:26 +0000 (10:05 +0100)]
examples/l2fwd-crypto: fix build with pkg-config
Two issues fixed here.
First add the experimental flag.
Then fix a link issue with the crypto scheduler driver:
/usr/bin/ld: /tmp/cchr7aHA.o: in function `main':
main.c:(.text.startup+0x1673): undefined reference to
`rte_cryptodev_scheduler_workers_get'
collect2: error: ld returned 1 exit status
Fixes: e3bcb99a5e13 ("examples/l2fwd-crypto: limit number of sessions") Fixes: 261bbff75e34 ("examples: use separate crypto session mempools") Cc: stable@dpdk.org Signed-off-by: David Marchand <david.marchand@redhat.com>
David Marchand [Sat, 14 Nov 2020 09:05:25 +0000 (10:05 +0100)]
examples/kni: fix build with pkg-config
rm -f build/kni build/kni-static build/kni-shared
test -d build && rmdir -p build || true
[...]
/usr/bin/ld: /tmp/cc72ssnK.o: undefined reference to symbol
'pthread_join@@GLIBC_2.2.5'
This example explicitly call pthread API and should be linked against
the pthread library.
Fixes: 724beb913b44 ("examples/kni: monitor and update link state continually") Cc: stable@dpdk.org Signed-off-by: David Marchand <david.marchand@redhat.com> Acked-by: Bruce Richardson <bruce.richardson@intel.com>
David Marchand [Sat, 14 Nov 2020 09:05:24 +0000 (10:05 +0100)]
examples/ipsec-gw: fix build with pkg-config
flow.c: In function ‘parse_flow_tokens’:
flow.c:153:23: error: taking address of packed member of ‘struct
rte_ipv4_hdr’ may result in an unaligned pointer value
[-Werror=address-of-packed-member]
153 | if (ipv4_addr_cpy(&rule->ipv4.spec.hdr.src_addr,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
flow.c:154:9: error: taking address of packed member of ‘struct
rte_ipv4_hdr’ may result in an unaligned pointer value
[-Werror=address-of-packed-member]
154 | &rule->ipv4.mask.hdr.src_addr,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
flow.c:170:23: error: taking address of packed member of ‘struct
rte_ipv4_hdr’ may result in an unaligned pointer value
[-Werror=address-of-packed-member]
170 | if (ipv4_addr_cpy(&rule->ipv4.spec.hdr.dst_addr,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
flow.c:171:9: error: taking address of packed member of ‘struct
rte_ipv4_hdr’ may result in an unaligned pointer value
[-Werror=address-of-packed-member]
171 | &rule->ipv4.mask.hdr.dst_addr,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
cc1: all warnings being treated as errors
Meson build is fine since we waive those warnings.
Replicate it for make.
Fixes: 8e693616fcb2 ("examples/ipsec-secgw: enable flow based distribution") Cc: stable@dpdk.org Signed-off-by: David Marchand <david.marchand@redhat.com> Acked-by: Bruce Richardson <bruce.richardson@intel.com>
David Marchand [Sat, 14 Nov 2020 09:05:23 +0000 (10:05 +0100)]
examples/fips_validation: fix build with pkg-config
When this example started using rte_cryptodev_sym_session_pool_create,
the part for pkg-config builds was not updated.
Fixes: 261bbff75e34 ("examples: use separate crypto session mempools") Cc: stable@dpdk.org Signed-off-by: David Marchand <david.marchand@redhat.com> Acked-by: Bruce Richardson <bruce.richardson@intel.com>
Fan Zhang [Thu, 5 Nov 2020 13:58:57 +0000 (13:58 +0000)]
test/crypto: fix out-of-place test
This patch fixes bypassed out of place test for PMDs that support it.
Fixes: 4868f6591c6f ("test/crypto: add cases for raw datapath API") Signed-off-by: Fan Zhang <roy.fan.zhang@intel.com> Acked-by: Adam Dybkowski <adamx.dybkowski@intel.com>
Ciara Power [Fri, 30 Oct 2020 13:11:26 +0000 (13:11 +0000)]
test/crypto: fix null dereference of crypto op
In two test cases, the op value is set by the return of the
process_crypto_request function, which may be NULL. The op->status
value was checked afterwards, which was causing a dereference issue.
To fix this, a temporary op variable is used to hold the return
from the process_crypto_request function, so the original op->status
can be checked after the possible NULL return value.
The original op value is then set to hold the temporary op value.
Coverity issue: 363452, 363465 Fixes: 4868f6591c6f ("test/crypto: add cases for raw datapath API") Signed-off-by: Ciara Power <ciara.power@intel.com> Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
Michael Baum [Wed, 11 Nov 2020 07:36:48 +0000 (07:36 +0000)]
common/mlx5: fix freeing on flex parser creation failure
The mlx5_devx_cmd_create_flex_parser function defines a local array
(with constant size) named in, and then allocates a pointer to
mlx5_devx_obj structure by the mlx5_malloc function.
If the allocation fails, the function releases the array in and returns
NULL. However, the array has been defined locally on the stack and the
mlx5_free function is not required to release it.
Remove the call to the mlx5_free function.
Fixes: 66914d19d135 ("common/mlx5: convert control path memory to unified malloc") Cc: stable@dpdk.org Signed-off-by: Michael Baum <michaelba@nvidia.com> Acked-by: Matan Azrad <matan@nvidia.com>
Michael Baum [Wed, 11 Nov 2020 07:36:46 +0000 (07:36 +0000)]
net/mlx5: fix leak on ASO age pools resize failure
In ASO age pools resize, the PMD starts ASO data-path.
When starting ASO data-path is failed, the pools memory was not freed
what caused a memory leak.
Free it.
Fixes: f935ed4b645a ("net/mlx5: support flow hit action for aging") Signed-off-by: Michael Baum <michaelba@nvidia.com> Acked-by: Matan Azrad <matan@nvidia.com>
Michael Baum [Wed, 11 Nov 2020 07:36:44 +0000 (07:36 +0000)]
net/mlx5: remove unused calculation in RSS expansion
The RSS flow expansion get a memory buffer to fill the new patterns of
the expanded flows.
This memory management saves the next address to write into the buffer
in a dedicated variable.
The calculation for the next address was wrongly also done when all the
patterns were ready.
Remove it.
Fixes: 4ed05fcd441b ("ethdev: add flow API to expand RSS flows") Cc: stable@dpdk.org Signed-off-by: Michael Baum <michaelba@nvidia.com> Acked-by: Matan Azrad <matan@nvidia.com>
Xueming Li [Mon, 9 Nov 2020 22:57:59 +0000 (22:57 +0000)]
net/mlx5: fix nested flow creation
If xmedata mode 1 enabled and create a flow with RSS and mark action,
there was an error that rdma-core failed to create RQT due to wrong
queue definition. This was due to mixed flow creation in thread specific
flow workspace.
This patch introduces nested flow workspace(context data), each flow
uses dedicate flow workspace, pop and restore workspace when nested flow
creation done, the original flow with continue with original flow
workspace. The total number of thread specific flow workspace should be
2 due to only one nested flow creation scenario so far.
Fixes: 8bb81f2649b1 ("net/mlx5: use thread specific flow workspace") Fixes: 3ac3d8234b82 ("net/mlx5: fix index when creating flow") Cc: stable@dpdk.org Signed-off-by: Xueming Li <xuemingl@nvidia.com> Acked-by: Matan Azrad <matan@nvidia.com>
Suanming Mou [Thu, 12 Nov 2020 08:51:43 +0000 (16:51 +0800)]
net/mlx5: fix detection of counter offset support
Currently, the counter offset support is discovered by creating the
rule with invalid offset counter and jump action in root table. If
the rule creation fails with EINVAL errno, that mean counter offset
is not supported in root table.
However, jump action may not be supported in some rdma-core version.
In this case, the discover code will not work properly.
This commits changes the jump action to generic drop action. That
makes the discover code to be more compatible.
Bing Zhao [Fri, 13 Nov 2020 07:05:33 +0000 (15:05 +0800)]
net/mlx5: fix hairpin unbind
In the implementation of mlx5_hairpin_unbind, a copy-paste error was
inside. If a single peer Rx port needed to be unbound, it would be
bound again by mistake.
All the hardware resources were released when stopping the device and
no mess of the configuration was introduced. But when trying to unbind
the ports again, the issue would appear.
The typo of the function call is fixed. If there is no hairpin queue
bound between two ports, the unbinding process should be considered
successful.
Fixes: 37cd4501e873 ("net/mlx5: support two ports hairpin mode") Signed-off-by: Bing Zhao <bingz@nvidia.com> Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
Xiaoyu Min [Tue, 10 Nov 2020 11:59:53 +0000 (19:59 +0800)]
net/mlx5: validate MPLSoGRE with GRE key
Currently PMD only accept flow which item_mpls directly follow item_gre,
means to match the GRE header without GRE optional field key in MPLSoGRE
encapsulation.
However, for the MPLSoGRE, the GRE header could have the optional field
(i.e, key) according to the RFC. So PMD need to accept this.
Add MLX5_FLOW_LAYER_GRE_KEY into allowed prev_layer to fix
Fixes: a7a0365565a4 ("net/mlx5: match GRE key and present bits") Cc: stable@dpdk.org Signed-off-by: Xiaoyu Min <jackmin@nvidia.com> Acked-by: Matan Azrad <matan@nvidia.com>
Bing Zhao [Wed, 11 Nov 2020 09:28:50 +0000 (17:28 +0800)]
net/mlx5: fix check of eCPRI previous layer
Based on the specification, eCPRI can only follow ETH (VLAN) layer
or UDP layer. When creating a flow with eCPRI item, this should be
checked and invalid layout of the layers should be rejected.
The number of descriptors configured is returned to a user
via the rxq_info_get API. This number is incorrect for MPRQ.
For SPRQ this number matches the number of mbufs allocated.
For MPRQ we have fewer external MPRQ buffers that can hold
multiple packets in strides of this big buffer. Take that
into account and return the number of MPRQ buffers multiplied
by the number of strides in this case.
There is a performance penalty for the replenish scheme
used in vectorized Rx burst for both MPRQ and SPRQ.
Mbuf elements are being filled at the end of the mbufs
array and being replenished at the beginning. That leads
to an increase in cache misses and the performance drop.
The more Rx descriptors are used the worse the situation.
Change the allocation scheme for vectorized MPRQ Rx burst:
allocate new mbufs only when consumed mbufs are almost
depleted (always have one burst gap between allocated and
consumed indices). Keeping a small number of mbufs allocated
improves cache locality and improves performance a lot.
Unfortunately, this approach cannot be applied to SPRQ Rx
burst routine. In MPRQ Rx burst we simply copy packets from
external MPRQ buffers or attach these buffers to mbufs.
In SPRQ Rx burst we allow the NIC to fill mbufs for us.
Hence keeping a small number of allocated mbufs will limit
NIC ability to fill as many buffers as possible. This fact
offsets the advantage of better cache locality.
Olivier Matz [Fri, 13 Nov 2020 10:39:57 +0000 (11:39 +0100)]
net/pcap: fix registration of timestamp dynamic field
In pcap pmd, the timestamp mbuf dynamic field is mandatory. When the
pcap pmd is created in a secondary process (this is the case for pdump),
it cannot be registered because this is not allowed from a secondary
process.
To ensure that the field is properly registered, do it from probe()
instead of configure(). Indeed, probe() is first invoked on the primary
process when a device is created in a secondary, this enables
registering dynfield from secondary process.
Ferruh Yigit [Fri, 13 Nov 2020 11:44:00 +0000 (11:44 +0000)]
app/testpmd: fix MTU after device configure
In 'rte_eth_dev_configure()', if 'DEV_RX_OFFLOAD_JUMBO_FRAME' is not set
the max frame size is limited to 'RTE_ETHER_MAX_LEN' (1518).
This is mistake because for the PMDs that has frame size bigger than
"RTE_ETHER_HDR_LEN + RTE_ETHER_CRC_LEN" (18 bytes), the MTU becomes
less than 1500, causing a valid frame with 1500 bytes payload to be
dropped.
Since 'rte_eth_dev_set_mtu()' works as expected, it is called after
'rte_eth_dev_configure()' to fix the MTU.
It may look redundant to set MTU after 'rte_eth_dev_configure()', both
with default values, but it is not, the resulting MTU config can be
different in the device based on frame overhead of the PMD.
And instead of setting the MTU to default value, it is first get via
'rte_eth_dev_get_mtu()' and set again, this is to cover cases MTU
changed from testpmd command line.
'rte_eth_dev_set_mtu()', '-ENOTSUP' error is ignored to prevent
irrelevant warning messages for the virtual PMDs.
Fixes: af75078fece3 ("first public release") Cc: stable@dpdk.org Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com> Reviewed-by: Qi Zhang <qi.z.zhang@intel.com> Acked-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru> Tested-by: Igor Romanov <igor.romanov@oktetlabs.ru>