Michal Krawczyk [Tue, 11 May 2021 06:45:54 +0000 (08:45 +0200)]
net/ena: update version to v2.3.0
This version update contains:
* memcpy mapping to the dpdk-optimized version.
* ena_com (HAL) update to the latest version (from 18.09.2020).
* Bug fixes for the large LLQ headers and devargs parsing.
* Bug fix for the default ring size.
Remove invalid ring size alignment logic and add default Rx and Tx port
ring sizes to the device info spec.
The logic in lines 1297 and 1371 is invalid. The
RTE_ETH_DEV_FALLBACK_RX_RINGSIZE (and the TX counterpart) is a value
that rte_eth_rx_queue_setup() will set if
dev_info.default_rxportconf.ring_size is 0 and user provided 0 in
nb_rx_desc argument. However the current code treats it as a hint for
the PMD to change the ring size to internal defaults.
Additionally since the ENA_DEFAULT_RING_SIZE is defined, report it in
the device capabilities so that both rte_ethdev code and the user can
utilize it for device configuration.
pthread_cond_timedwait() may spuriously wakeup according to POSIX.
Therefore it is required to check whether predicate is actually true
before finishing the waiting loop.
Signed-off-by: Stanislaw Kardach <kda@semihalf.com> Reviewed-by: Michal Krawczyk <mk@semihalf.com> Reviewed-by: Igor Chauskin <igorch@amazon.com> Reviewed-by: Shay Agroskin <shayagr@amazon.com>
Michal Krawczyk [Tue, 11 May 2021 06:45:47 +0000 (08:45 +0200)]
net/ena: fix crash with unsupported device argument
As the documentation of rte_kvargs_parse() states, the valid_keys
argument must be NULL terminated. Lack of this feature may cause
segmentation fault if the passed devarg will be different then the
supported value.
Fixes: 8a7a73f26cc9 ("net/ena: support large LLQ headers") Cc: stable@dpdk.org Signed-off-by: Michal Krawczyk <mk@semihalf.com> Reviewed-by: Igor Chauskin <igorch@amazon.com> Reviewed-by: Shay Agroskin <shayagr@amazon.com> Acked-by: Ferruh Yigit <ferruh.yigit@intel.com>
Igor Chauskin [Tue, 11 May 2021 06:45:46 +0000 (08:45 +0200)]
net/ena: fix parsing of large LLQ header device argument
The code incorrectly checked the return value of comparison when parsing
the argument key name. The return value of strcmp should be compared
to 0 to identify a match.
Fixes: 8a7a73f26cc9 ("net/ena: support large LLQ headers") Cc: stable@dpdk.org Signed-off-by: Igor Chauskin <igorch@amazon.com> Reviewed-by: Shay Agroskin <shayagr@amazon.com> Reviewed-by: Michal Krawczyk <mk@semihalf.com>
Amit Bernstein [Tue, 11 May 2021 06:45:45 +0000 (08:45 +0200)]
net/ena/base: adjust to latest ena-com
1. As memzone uses unique names, changed alloc coherent macro to use
64 bit size atomic variable to increase the memzone name space
2. "handle" param name change to be consistent with other macros
3. Variable definition displacement
4. Backslash alignment to column 80
Signed-off-by: Amit Bernstein <amitbern@amazon.com> Reviewed-by: Igor Chauskin <igorch@amazon.com> Reviewed-by: Shay Agroskin <shayagr@amazon.com> Reviewed-by: Michal Krawczyk <mk@semihalf.com>
Michal Krawczyk [Tue, 11 May 2021 06:45:44 +0000 (08:45 +0200)]
net/ena/base: prefetch cache with intention to write
As in the v20.11 rte_prefetch0_write API was added, it should be used
in the platform file for the definition of the macro prefetchw, instead
of using simply prefetch0.
Signed-off-by: Michal Krawczyk <mk@semihalf.com> Reviewed-by: Igor Chauskin <igorch@amazon.com> Reviewed-by: Amit Bernstein <amitbern@amazon.com>
Michal Krawczyk [Tue, 11 May 2021 06:45:41 +0000 (08:45 +0200)]
net/ena/base: destroy multiple wait events
Although the ENA DPDK PMD doesn't have to perform any actions for
destroying the wait event, some other platforms have to.
The macro "ENA_WAIT_EVENT_DESTROY" was renamed to
"ENA_WAIT_EVENTS_DESTROY" and also whole implementation responsible for
that was moved to a separate function for better readability.
Fixes: 3adcba9a8987 ("net/ena: update HAL to the newer version") Cc: stable@dpdk.org Signed-off-by: Michal Krawczyk <mk@semihalf.com> Reviewed-by: Igor Chauskin <igorch@amazon.com> Reviewed-by: Guy Tzalik <gtzalik@amazon.com>
Michal Krawczyk [Tue, 11 May 2021 06:45:40 +0000 (08:45 +0200)]
net/ena/base: fix type conversions by explicit casting
To silence error messages from the static code analysis, make the type
conversions explicit where they're intended.
Also fix the type for the DMA width value.
Fixes: 99ecfbf845b3 ("ena: import communication layer") Cc: stable@dpdk.org Signed-off-by: Michal Krawczyk <mk@semihalf.com> Reviewed-by: Igor Chauskin <igorch@amazon.com> Reviewed-by: Guy Tzalik <gtzalik@amazon.com>
Michal Krawczyk [Tue, 11 May 2021 06:45:39 +0000 (08:45 +0200)]
net/ena/base: improve style and comments
List of changes:
* Comment style was adjusted for the functions
* The keys_num at "struct ena_admin_feature_rss_flow_hash_control" was
renamed to the key_parts to better describe it's meaning
* The RSS indirection table was called "REDIRECTION" -> changed to
INDIRECTION
* Change AENQ field "syndrom" -> "syndrome"
* Calculate number of the RSS key parts or whole key by using the
common way: sizeof of the first element of the RSS key
* Add description of the "enum ena_admin_aq_feature_id"
* Rename "map_rx_buf_bidirectional" field as "rx_buf_mirroring"
* Other minor style fixes (remove extra spaces, add missing line break,
improve indentation)
* Remove unused macros ENA_ADMIN_EXTRA_PROPERTIES_*
* Restructure the "if {} else if {} else" conditional statement for
setting up the meta descriptor
Fixes: 99ecfbf845b3 ("ena: import communication layer") Fixes: b68309be44c0 ("net/ena/base: update communication layer for the ENAv2") Fixes: b2b02edeb0d6 ("net/ena/base: upgrade HAL for new HW features") Cc: stable@dpdk.org Signed-off-by: Michal Krawczyk <mk@semihalf.com> Reviewed-by: Igor Chauskin <igorch@amazon.com> Reviewed-by: Guy Tzalik <gtzalik@amazon.com>
Igor Chauskin [Tue, 11 May 2021 06:45:36 +0000 (08:45 +0200)]
net/ena: switch memcpy to optimized version
memcpy is now mapped to rte_memcpy macro on x86 architectures.
Fixes: 9ba7981ec992 ("ena: add communication layer for DPDK") Cc: stable@dpdk.org Signed-off-by: Igor Chauskin <igorch@amazon.com> Reviewed-by: Michal Krawczyk <mk@semihalf.com> Reviewed-by: Artur Rojek <ar@semihalf.com>
Kamil Vojanec [Fri, 5 Feb 2021 09:00:45 +0000 (10:00 +0100)]
net/mlx5/linux: fix firmware version
This patch fixes a bug where firmware version was not
copied from ibv_device_attr structure into mlx5_dev_attr
structure, resulting in inability to read firmware
version.
net/mlx5: fix Tx queue doorbell record field offset
If the Send Queue (backing one for PMD Tx queue) the was
created with DevX API the doorbell record offset for the
producer index field was incorrect. If hardware missed the
doorbell register write event the wrong content of doorbell
record might cause queue malfunction. For the Send Queues
created with Verbs API the doorbell record offset was
configured correctly.
Jiawei Wang [Fri, 7 May 2021 09:42:12 +0000 (12:42 +0300)]
net/mlx5: fix RSS flow item expansion for GRE key
The support of RSS expansion for the flows with IPv6 GRE item was added
to mlx5 PMD. And the GRE KEY item support in expansion was missed
and the flows with GRE and GRE KEY items were expanded in the wrong
way causing the flow creation failure.
This patch adds the RSS expansion support for GRE KEY and mlx5 PMD
performs RSS expansion correctly.
Fixes: 048f0d45e342 ("net/mlx5: support RSS expansion for IPv6 GRE") Cc: stable@dpdk.org Signed-off-by: Jiawei Wang <jiaweiw@nvidia.com> Acked-by: Xiaoyu Min <jackmin@nvidia.com> Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
Shiri Kuzin [Fri, 7 May 2021 07:01:22 +0000 (10:01 +0300)]
common/mlx5: fix mkey attributes initialization
The crypto driver added new fields to the mkey attributes struct:
crypto_en and set_remote_rw.
The entire mkey struct was not initialized, only specific fields in it,
which caused the new added fields not to be initialized resulting in a
mkey creation error.
This is fixed by initializing the entire mkey attributes struct to 0
which will prevent this issue from reoccurring if any fields are added
to the mkey struct in the future.
Wenjun Wu [Sat, 8 May 2021 08:40:41 +0000 (16:40 +0800)]
net/ice: remove redundant RSS configuration for GTPU
Originally, the default RSS for GTPU is inner fields. Now, we hope outer
RSS for GTPU to be the default.
Since RSS for IPv4, RSS for IPv6, RSS for UDP and RSS for TCP can cover
the cases of outer RSS for GTPU, this patch deletes redundant default
RSS configurations for GTPU.
Ting Xu [Sat, 8 May 2021 07:11:47 +0000 (15:11 +0800)]
net/ice: fix IP RSS configuration template
To enable IP fragment RSS hash, ICE_FLOW_SEG_HDR_IPV_FRAG is added to the
IP RSS configuration template, together with ICE_FLOW_SEG_HDR_IPV_OTHER.
It will cause error when associating flow profile. And packet id field
for RSS is not correctly added when IP fragment is enabled. To fix this
issue, this patch only selects one of the above two segment header types
based on RSS types.
Fixes: f1ea76eb6394 ("net/ice: support RSS hash for IP fragment") Cc: stable@dpdk.org Signed-off-by: Ting Xu <ting.xu@intel.com> Acked-by: Qi Zhang <qi.z.zhang@intel.com>
David Marchand [Thu, 6 May 2021 10:07:02 +0000 (12:07 +0200)]
net/ice/base: fix memory allocation wrapper
This is reported by our internal covscan:
1. dpdk-20.11/drivers/net/ice/base/ice_switch.c:4214: sign_extension:
Suspicious implicit sign extension: "s_rule_size" with type "u16" (16
bits, unsigned) is promoted in "num_unicast * s_rule_size" to type "int"
(32 bits, signed), then sign-extended to type "unsigned long" (64 bits,
unsigned).
If "num_unicast * s_rule_size" is greater than 0x7FFFFFFF, the upper bits
of the result will all be 1.
Hongbo Zheng [Wed, 12 May 2021 02:19:19 +0000 (10:19 +0800)]
power: fix sanity checks for guest channel read
In function power_guest_channel_read_msg, 'lcore_id' is used before
validity check, which may cause buffer 'global_fds' accessed by index
'lcore_id' overflow.
This patch moves the validity check of 'lcore_id' before the 'lcore_id'
being used for the first time.
Fixes: 9dc843eb273b ("power: extend guest channel API for reading") Cc: stable@dpdk.org Signed-off-by: Hongbo Zheng <zhenghongbo3@huawei.com> Signed-off-by: Min Hu (Connor) <humin29@huawei.com> Reviewed-by: Reshma Pattan <reshma.pattan@intel.com> Acked-by: David Hunt <david.hunt@intel.com>
Min Hu (Connor) [Tue, 4 May 2021 01:07:49 +0000 (09:07 +0800)]
test/timer: check memzone allocation
Segmentation fault may occur without checking if memzone
reserves succeed or not.
Fixes: 50247fe03fe0 ("test/timer: exercise new APIs in secondary process") Cc: stable@dpdk.org Signed-off-by: Min Hu (Connor) <humin29@huawei.com> Acked-by: Erik Gabriel Carrillo <erik.g.carrillo@intel.com>
Chengchang Tang [Thu, 6 May 2021 09:29:36 +0000 (17:29 +0800)]
examples/timer: fix time interval
Timer sample example assumes that the frequency of the timer is about
2Ghz to control the period of calling rte_timer_manage(). But this
assumption is easy to fail. For example. the frequency of tsc on ARM64
is much less than 2Ghz.
This patch uses the frequency of the current timer to calculate the
correct time interval to ensure consistent result on all platforms.
In addition, the rte_rdtsc() is replaced with the more recommended
rte_get_timer_cycles function in this patch.
Fixes: af75078fece3 ("first public release") Cc: stable@dpdk.org Signed-off-by: Chengchang Tang <tangchengchang@huawei.com> Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
Kevin Laatz [Wed, 12 May 2021 10:47:46 +0000 (10:47 +0000)]
raw/ioat: fix parameter shadow warning
In the function __idxd_completed_ops() we have a parameter shadow warning
due to a local variable having the same name as one of the function
parameters. This issue is fixed by simply renaming the local variable.
This warning was caught when additions were made to the OVS codebase,
which include adding calls the IOAT APIs. The OVS build passes the
-Wshadow flag by default, allowing the warning to be seen when building
OVS with DPDK 21.05-rc2.
Fixes: 245efe544d8e ("raw/ioat: report status of completed jobs") Reported-by: Sunil Pai G <sunil.pai.g@intel.com> Signed-off-by: Kevin Laatz <kevin.laatz@intel.com> Tested-by: Sunil Pai G <sunil.pai.g@intel.com> Acked-by: Bruce Richardson <bruce.richardson@intel.com>
For 32-bit targets, size_t is normally a 32-bit type and
does not have sufficient range to represent 64-bit offsets
that are needed when mapping PCI addresses.
Use uint64_t instead.
Found when attempting to run 32-bit Linux dpdk-testpmd
using VFIO driver:
Thomas Monjalon [Mon, 10 May 2021 20:45:37 +0000 (22:45 +0200)]
doc: fix build with Sphinx 4
Sphinx 4.0 became stricter with permalink configuration:
"
html_add_permalinks has been deprecated since v3.5.0.
Please use html_permalinks and html_permalinks_icon instead.
"
The new variable is used while keeping compatibility
with older Sphinx versions.
Cc: stable@dpdk.org Signed-off-by: Thomas Monjalon <thomas@monjalon.net> Acked-by: Bruce Richardson <bruce.richardson@intel.com> Reviewed-by: David Marchand <david.marchand@redhat.com>
David Marchand [Thu, 6 May 2021 14:25:19 +0000 (16:25 +0200)]
net: fix header include order for FreeBSD
Spotted by sparse in OVS build:
../../lib/netdev-dpdk.c: note: in included file (through
/home/runner/work/ovs/ovs/dpdk-dir/build/include/rte_ip.h,
/home/runner/work/ovs/ovs/dpdk-dir/build/include/rte_flow.h, ...):
../../include/sparse/arpa/inet.h:22:2: error: "Must include
<netinet/in.h> before <arpa/inet.h> for FreeBSD support"
This is a check enforced by OVS itself.
See [1] for some context.
Fixes: 89813a522e68 ("net: provide IP-related API on any OS") Signed-off-by: David Marchand <david.marchand@redhat.com> Acked-by: Dmitry Kozlyuk <dmitry.kozliuk@gmail.com> Acked-by: Olivier Matz <olivier.matz@6wind.com>
David Marchand [Thu, 6 May 2021 14:04:55 +0000 (16:04 +0200)]
net: add endianness annotations to ethernet headers
Spotted by sparse in OVS build:
/home/runner/work/ovs/ovs/dpdk-dir/build/include/rte_flow.h:789:27:
error: incorrect type in initializer (different base types)
/home/runner/work/ovs/ovs/dpdk-dir/build/include/rte_flow.h:789:27:
expected unsigned short [usertype] ether_type
/home/runner/work/ovs/ovs/dpdk-dir/build/include/rte_flow.h:789:27:
got restricted ovs_be16 [usertype]
/home/runner/work/ovs/ovs/dpdk-dir/build/include/rte_flow.h:829:25:
error: incorrect type in initializer (different base types)
/home/runner/work/ovs/ovs/dpdk-dir/build/include/rte_flow.h:829:25:
expected unsigned short [usertype] vlan_tci
/home/runner/work/ovs/ovs/dpdk-dir/build/include/rte_flow.h:829:25:
got restricted ovs_be16 [usertype]
/home/runner/work/ovs/ovs/dpdk-dir/build/include/rte_flow.h:830:26:
error: incorrect type in initializer (different base types)
/home/runner/work/ovs/ovs/dpdk-dir/build/include/rte_flow.h:830:26:
expected unsigned short [usertype] eth_proto
/home/runner/work/ovs/ovs/dpdk-dir/build/include/rte_flow.h:830:26:
got restricted ovs_be16 [usertype]
This was not caught before as no code in headers was using those fields.
This changed with commit 6f2168b69aee ("ethdev: reuse ethernet header
definition in flow item") and commit a56a262e3408 ("ethdev: reuse VLAN
header definition in flow item").
Signed-off-by: David Marchand <david.marchand@redhat.com> Acked-by: Olivier Matz <olivier.matz@6wind.com>
David Marchand [Mon, 26 Apr 2021 12:51:08 +0000 (14:51 +0200)]
log: register with standardized names
Let's try to enforce the convention where most drivers use a pmd. logtype
with their class reflected in it, and libraries use a lib. logtype.
Introduce two new macros:
- RTE_LOG_REGISTER_DEFAULT can be used when a single logtype is
used in a component. It is associated to the default name provided
by the build system,
- RTE_LOG_REGISTER_SUFFIX can be used when multiple logtypes are used,
and then the passed name is appended to the default name,
RTE_LOG_REGISTER is left untouched for existing external users
and for components that do not comply with the convention.
There is a new Meson variable log_prefix to adapt the default name
for baseband (pmd.bb.), bus (no pmd.) and mempool (no pmd.) classes.
Note: achieved with below commands + reverted change on net/bonding +
edits on crypto/virtio, compress/mlx5, regex/mlx5
$ git grep -l RTE_LOG_REGISTER drivers/ |
while read file; do
pattern=${file##drivers/};
class=${pattern%%/*};
pattern=${pattern#$class/};
drv=${pattern%%/*};
case "$class" in
baseband) pattern=pmd.bb.$drv;;
bus) pattern=bus.$drv;;
mempool) pattern=mempool.$drv;;
*) pattern=pmd.$class.$drv;;
esac
sed -i -e 's/RTE_LOG_REGISTER(\(.*\), '$pattern',/RTE_LOG_REGISTER_DEFAULT(\1,/' $file;
sed -i -e 's/RTE_LOG_REGISTER(\(.*\), '$pattern'\.\(.*\),/RTE_LOG_REGISTER_SUFFIX(\1, \2,/' $file;
done
$ git grep -l RTE_LOG_REGISTER lib/ |
while read file; do
pattern=${file##lib/};
pattern=lib.${pattern%%/*};
sed -i -e 's/RTE_LOG_REGISTER(\(.*\), '$pattern',/RTE_LOG_REGISTER_DEFAULT(\1,/' $file;
sed -i -e 's/RTE_LOG_REGISTER(\(.*\), '$pattern'\.\(.*\),/RTE_LOG_REGISTER_SUFFIX(\1, \2,/' $file;
done
Signed-off-by: David Marchand <david.marchand@redhat.com> Signed-off-by: Thomas Monjalon <thomas@monjalon.net> Acked-by: Bruce Richardson <bruce.richardson@intel.com>
rte_thash_adjust_tuple() uses random to generate a new subtuple if
fn() callback reports about collision. In some cases random changes
the subtuple in a way that after complementary bits are applied the
original tuple is obtained. This patch replaces random with subtuple
increment.
Fixes: 28ebff11c2dc ("hash: add predictable RSS") Cc: vladimir.medvedkin@intel.com Reported-by: David Marchand <david.marchand@redhat.com> Signed-off-by: Vladimir Medvedkin <vladimir.medvedkin@intel.com> Acked-by: Yipeng Wang <yipeng1.wang@intel.com> Tested-by: Stanislaw Kardach <kda@semihalf.com> Reviewed-by: Stanislaw Kardach <kda@semihalf.com>
David Marchand [Thu, 6 May 2021 10:06:37 +0000 (12:06 +0200)]
eal: fix leak in shared lib mode detection
This is reported by our internal covscan:
1. dpdk-20.11/lib/librte_eal/common/eal_common_options.c:508: alloc_fn:
Storage is returned from allocation function "dlopen".
6. dpdk-20.11/lib/librte_eal/common/eal_common_options.c:508:
leaked_storage: Failing to save or free storage allocated by
"dlopen("librte_eal.so.21.0", 5)" leaks it.
raw/ioat: skip VA requirement for bus without device
If after a bus scan, there are no devices using a particular bus, then
that bus should not be taken into account when deciding whether DPDK
should be run in VA or PA addressing mode. This becomes an issue when
the DSA bus driver code is used on a system without an IOMMU. The PCI
bus correctly reports that it only works in PA mode, while the DSA bus -
also correctly - reports that it works only in VA mode. The difference
is that there will be no devices found in a scan for the DSA bus, since
the kernel driver can only present those to userspace in the presence of
an IOMMU.
While we could change DSA instance to always report that it does not
care about the addressing mode, this would imply that it could be used
with DPDK in PA mode which is not the case. Therefore, this patch
changes the driver to report DC (don't care) in the case where no
devices are present, and VA otherwise.
NOTE: this addressing mode use of VA-only applies only in the case of
using DSA through the idxd kernel driver. The use of DSA though vfio-pci
is unaffected and works as with other PCI devices.
Fixes: b7aaf417f936 ("raw/ioat: add bus driver for device scanning automatically") Reported-by: Harry van Haaren <harry.van.haaren@intel.com> Signed-off-by: Bruce Richardson <bruce.richardson@intel.com> Tested-by: Anatoly Burakov <anatoly.burakov@intel.com> Tested-by: Harry van Haaren <harry.van.haaren@intel.com> Tested-by: Conor Walsh <conor.walsh@intel.com>
When reading the /dev directory as part of the bus scan for DSA devices,
the directory handle from opendir was not freed on function return,
leading to a resource leak.
Coverity issue: 370588 Fixes: b7aaf417f936 ("raw/ioat: add bus driver for device scanning automatically") Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
David Marchand [Fri, 7 May 2021 11:54:04 +0000 (13:54 +0200)]
build: fix default drivers list without Python
If no enable_drivers option is passed, the default is to build
the drivers list by calling list-dir-globs.py.
But if no Python interpreter is installed, no error is reported
and all drivers end up being disabled.
Example on a minimal FreeBSD VM:
dpdk@freebsd:~/dpdk $ meson setup build
...
drivers:
common/cpt: not in enabled drivers build config
common/dpaax: not in enabled drivers build config
common/iavf: not in enabled drivers build config
common/mvep: not in enabled drivers build config
common/octeontx: not in enabled drivers build config
common/octeontx2: not in enabled drivers build config
bus/dpaa: not in enabled drivers build config
bus/fslmc: not in enabled drivers build config
...
dpdk@freebsd:~/dpdk $ cd drivers/
dpdk@freebsd:~/dpdk/drivers $ ~/dpdk/buildtools/list-dir-globs.py */*
env: python3: No such file or directory
Rely on meson internal interpreter.
Check return code when calling this script.
Fixes: ab9407c3addd ("build: allow using wildcards to disable drivers") Fixes: 2e33309ebe03 ("config: enable/disable drivers in Arm builds") Cc: stable@dpdk.org Signed-off-by: David Marchand <david.marchand@redhat.com> Acked-by: Bruce Richardson <bruce.richardson@intel.com>
Thomas Monjalon [Fri, 7 May 2021 12:14:13 +0000 (14:14 +0200)]
net/hns3: fix debug build
The variable "dev" is not used in hns3_get_tx_prep_needed()
in the case of RTE_LIBRTE_ETHDEV_DEBUG:
drivers/net/hns3/hns3_rxtx.c:4213:45: error: unused parameter ‘dev’
Fixes: d7ec2c076579 ("net/hns3: select Tx prepare based on Tx offload") Cc: stable@dpdk.org Reported-by: David Marchand <david.marchand@redhat.com> Signed-off-by: Thomas Monjalon <thomas@monjalon.net> Acked-by: David Marchand <david.marchand@redhat.com>
Hemant Agrawal [Wed, 5 May 2021 12:16:52 +0000 (17:46 +0530)]
crypto/dpaa2_sec: fix close and uninit functions
The init function was calling the dpseci_open
while dpseci_close was called by the open function.
This is a mismatch un-init shall clean the init configurations and
close shall clear the configure function settings.
This was causing issue with recent changes in test framework, where
the close was being called and causing DPAA2 SEC to fail in configure
Hemant Agrawal [Mon, 3 May 2021 08:39:53 +0000 (14:09 +0530)]
crypto/dpaa_sec: affine the thread portal affinity
DPAA requires the I/O shall be done in a HW portal context only.
The portal affinity is currently only being done in session create
and config APIs with the assumption that same thread will be used
for IO. This is causing issue.
This patch add support during I/O to check the HW portal affinity
and affine portal- if not affined already.
Kai Ji [Tue, 4 May 2021 14:19:41 +0000 (15:19 +0100)]
test/crypto: fix auth-cipher compare length in OOP
For out-of-place operations, comparing expected ciphertext with
the operation result should skip cipher_offset bytes, as those
will not be copied from source to the destination buffer, making
the tests fail.
Fixes: 02ed7b3871d6 ("test/crypto: add SNOW3G test cases for auth-cipher") Cc: stable@dpdk.org Signed-off-by: Kai Ji <kai.ji@intel.com> Signed-off-by: Damian Nowak <damianx.nowak@intel.com> Acked-by: Fan Zhang <roy.fan.zhang@intel.com>
Recent patch to support UDP encapsulation introduced problem with
handling inbound IPv6 packets with header extensions.
This patch aims to fix the issue.
Bugzilla ID: 695 Fixes: 9a1cc8f1ed74 ("examples/ipsec-secgw: support UDP encapsulation") Reported-by: Vladimir Medvedkin <vladimir.medvedkin@intel.com> Signed-off-by: Konstantin Ananyev <konstantin.ananyev@intel.com> Acked-by: Akhil Goyal <gakhil@marvell.com>
Adam Dybkowski [Wed, 28 Apr 2021 14:41:42 +0000 (15:41 +0100)]
compress/qat: enable compression on GEN3
This patch enables the compression on QAT GEN3 (on hardware
versions that support it) and changes the error message shown
on older hardware versions that don't support the compression.
It also fixes the crash that happened on IM buffer allocation
failure (not enough memory) during the PMD cleaning phase.
Min Hu (Connor) [Mon, 26 Apr 2021 00:56:59 +0000 (08:56 +0800)]
app/bbdev: fix HARQ error messages
The logging should show context by printing the two variables which
compared to each other. 'nb_harq_inputs', not 'nb_hard_outputs';
'nb_harq_outputs', not 'nb_hard_outputs'.
This patch corrected misused variable.
Fixes: d819c08327f3 ("app/bbdev: update for 5GNR") Cc: stable@dpdk.org Signed-off-by: Min Hu (Connor) <humin29@huawei.com> Acked-by: Nicolas Chautru <nicolas.chautru@intel.com>
Min Hu (Connor) [Thu, 22 Apr 2021 09:25:05 +0000 (17:25 +0800)]
app/bbdev: check memory allocation
Return value of a function 'rte_malloc' is dereferenced without
checking, and may result in segmentation fault.
This patch fixed it.
Fixes: 31a7853d1ed9 ("baseband/turbo_sw: support large size code block") Cc: stable@dpdk.org Signed-off-by: Min Hu (Connor) <humin29@huawei.com> Acked-by: Nicolas Chautru <nicolas.chautru@intel.com>
VM channel number should not be validated against the
host vm_power_manager coremask core indexes, as VM
cores need not to be same as host cores.
So remove this check, to allow all the vm channels
to be added successfully.
David Marchand [Wed, 5 May 2021 14:21:05 +0000 (16:21 +0200)]
lib: restore developer mode checks
Most of the checks on developer_mode have been accidentally dropped.
Restore them.
Fixes: 7d611e35b077 ("lib: simplify main build file") Signed-off-by: David Marchand <david.marchand@redhat.com> Acked-by: Bruce Richardson <bruce.richardson@intel.com>
Bing Zhao [Wed, 5 May 2021 12:23:27 +0000 (15:23 +0300)]
net/mlx5: support connection tracking between two ports
After creating a connection tracking context, it can be used between
two ports. For each port, the flow for one direction traffic will
be created.
The context can only be shared between the owner port and the peer
port that was specified when being created. Only the owner port
could update the context or query it in current implementation.
Bing Zhao [Wed, 5 May 2021 12:23:26 +0000 (15:23 +0300)]
net/mlx5: validate connection tracking item
The item of ASO connection tracking will be translated into the
register value when matching. The validation of this item has no
dependency on other layers, since the flow including this item
should be jumped from another group. All the layers checking was
already done in the previous groups. Only the state bits conflict
should be checked.
It is assumed that the flow with CT item will always work on the
TCP traffic.
Bing Zhao [Wed, 5 May 2021 12:23:25 +0000 (15:23 +0300)]
net/mlx5: validate connection tracking action
The validation of a CT action contains two parts. The first is the
CT action configurations parameter. When creating a CT action
context, some members need to be verified.
The second is that when creating a flow, the DR action of CT should
be validated with other actions and items as well. Currently, only
the TCP protocol support connection tracking.
Bing Zhao [Wed, 5 May 2021 12:23:24 +0000 (15:23 +0300)]
net/mlx5: add connection tracking context update
When updating a connection tracking context, two separate parts
could be updated.
First, the direction. This will only update the traffic direction
recorded in the software for flow creation.
Second, the TCP parameters. The hardware context will be updated
via the WQE. This update will be blocked until the hardware status
is updated and ready for the next flow creation.
Bing Zhao [Wed, 5 May 2021 12:23:23 +0000 (15:23 +0300)]
net/mlx5: add translation of connection tracking item
The return register of the DR action will be used for matching.
After the ASO CT checking of a TCP packet, the syndrome is filled in
the register. Only the 8 LSB should be used. A converting from
RTE_FLOW_CONNTRACK_FLAG* to the syndrome should be done after
checking the spec and mask fields.
Bing Zhao [Wed, 5 May 2021 12:23:22 +0000 (15:23 +0300)]
net/mlx5: add translation of connection tracking action
When creating a flow with this action context for CT, it needs to be
translated in 2 levels.
First, retrieve from action context to rte_flow action.
Second, translate it to the corresponding DR action with traffic
direction that was specified when creating or updating via
rte_flow_action_handle* API.
Before using the DR action in a flow, the CT context should be
available to use in the hardware. A synchronization is done before
inserting the flow rule with CT action to check the HW availability
of this CT context.
In order to release the DR actions and reuse the context of a CT,
the reference count should also be handled in the flow rule
destroying.
The CT index will be recorded in the rte_flow by reusing the ASO age
index to save memory, since only one ASO action is supported in one
flow rule currently. The action context type should also be saved
for CT. When destroying a flow rule, if the context type is CT and
the index is valid (non-zero), the release process should be
handled. By default, the handling will fall back to try to release
the ASO age if any.
Bing Zhao [Wed, 5 May 2021 12:23:21 +0000 (15:23 +0300)]
net/mlx5: add ASO connection tracking destroy
When trying to destroy an ASO connection tracking context, the DR
action created on this context should also be destroyed. Before
inserting the related software object into the management free list,
the reference count should be checked.
Right now, the context object will not be freed to the system and
will be reused directly from the free list.
Bing Zhao [Wed, 5 May 2021 12:23:20 +0000 (15:23 +0300)]
net/mlx5: add ASO connection tracking query
After the connection tracking context is created and being used by
the flows, the context will be updated by the HW automatically after
a packet passed the CT validation. E.g., the ACK, SEQ, window and
state of CT can be updated with both direction traffic.
In order to query the updated contents of this context, a WQE should
be posted to the SQ with a return buffer. The data will be filled
into the buffer. And the profile will be filled with specific value.
During the execution of query command, the context may be updated.
The result of the query command may not be the latest one.
Bing Zhao [Wed, 5 May 2021 12:23:19 +0000 (15:23 +0300)]
net/mlx5: release connection tracking management
When freeing the IB shared context during stopping a device, the
ASO connection tracking management structure should also be cleaned
up.
All the DR actions created should be destroyed. The structures need
to be freed and ASO CT QP should be released. In the meanwhile, the
allocated and registered memory region for query should also be
deregistered and then freed.
Bing Zhao [Wed, 5 May 2021 12:23:18 +0000 (15:23 +0300)]
net/mlx5: add actions for connection tracking creation
Allocating a CT from the management pools and creating the DR actions
for both directions by default.
If there is no available connection tracking action, a new pool will
be created with a fixed size bulk allocation. Right now, all the
resources are controlled by the linked list.
The ASO connection tracking context associated with these actions
need to be updated via WQE before using for steering.
Bing Zhao [Wed, 5 May 2021 12:23:17 +0000 (15:23 +0300)]
net/mlx5: support connection tracking modify
After the connection tracking object bulk is allocated, all the
objects' contents are filled with zero by default. Every
new-allocated object must be modified via WQE operation before it is
used.
In order to reduce the latency for the flow creation, an asynchronous
way is used instead of busy waiting for the CQE to be generated.
Adding support for connection tracking ASO creation via Devx command.
Right now only bulk creation is supported.
By default, the objects with zero contents will be created. Before
using a single object, the modification via posting a WQE to the ASO
CT SQ is needed.
The definitions of ASO connection tracking objects management
structures are added.
Considering performance, the bulk allocation of ASO CT objects
should be used. The maximal value per bulk and the granularity could
be fetched from HCA capabilities 2. Right now, a fixed number of 64
is used for each bulk for a better management purpose.
The ASO QP for CT is initialized, the SQ will be used for both
modify and query command.
During startup, the ASO connection tracking offload capability could
be queried via HCA_CAP_QUERY command. If the HW doesn't support ASO
CT, the value would be 0 by default. The following initialization
should be skipped and the creation of the CT object should return
a failure directly.
The following CT creation should also check this capability. With
the old driver, the pre-processing macro should be used in order to
make the compiling pass.
Bing Zhao [Wed, 5 May 2021 12:23:12 +0000 (15:23 +0300)]
common/mlx5: add connection tracking object
The structures of ASO connection tracking offload object are added
based on the definitions in the PRM. One CT object context will be
loaded into the cache completely in a reversed order of dwords. The
valid bit should be the MSB of the last dword. This is used for the
conntrack context creation and update, as well as for the query.
The capabilities 2 (HCA_CAP_2) layout is also added. The connection
tracking related capabilities could be queried via the HCA_CAP_2.
Support the PMD power management API in MLX5 driver.
The monitor policy of this API puts a CPU core to sleep until
a data in some monitored memory address is changed by the NIC.
Implement the get_monitor_addr function to return an address
of a CQE owner bit to monitor the arrival of a new packet.
Signed-off-by: Alexander Kozyrev <akozyrev@nvidia.com> Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
Michael Baum [Mon, 26 Apr 2021 12:48:10 +0000 (15:48 +0300)]
net/mlx5: workaround ASO memory region creation
Due to kernel issue in direct MKEY creation using the DevX API for
physical memory, this patch replaces the ASO MR creation to use Verbs
API.
Fixes: f935ed4b645a ("net/mlx5: support flow hit action for aging") Cc: stable@dpdk.org Signed-off-by: Michael Baum <michaelba@nvidia.com> Acked-by: Matan Azrad <matan@nvidia.com>
Kalesh AP [Mon, 3 May 2021 05:21:50 +0000 (10:51 +0530)]
net/bnxt: prevent device access in error state
Driver should prevent any DMA with the device when it
detects an error. When firmware is in fatal state,
stop tx/rx by assigning them to dummy functions.
Fixes: be14720def9c ("net/bnxt: support FW reset") Fixes: 9d0cbaecc91a ("net/bnxt: support periodic FW health monitoring") Cc: stable@dpdk.org Signed-off-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com> Reviewed-by: Somnath Kotur <somnath.kotur@broadcom.com> Reviewed-by: Andy Gospodarek <gospo@broadcom.com> Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
net/bnxt: fix mismatched type comparison in MAC restore
dev_info.max_mac_addrs is of type uint32_t. But the counter i is
of type uint16_t. This mismatch may cause the loop condition may
always be true. Change the loop counter variable to uint32_t.
Fixes: b02f1573cd07 ("net/bnxt: restore MAC filters during reset recovery") Cc: stable@dpdk.org Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com> Reviewed-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Ensure that the current count of in-use VNICs is decremented
when a VNIC is freed. Don't attempt VNIC allocation when the
maximum supported number of VNICs is currently allocated.
Fixes: 49d0709b257f ("net/bnxt: delete and flush L2 filters cleanly") Fixes: d24610f7bfda ("net/bnxt: allow flow creation when RSS is enabled") Cc: stable@dpdk.org Signed-off-by: Lance Richardson <lance.richardson@broadcom.com> Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com> Reported-by: Stephen Hemminger <sthemmin@microsoft.com>
net/bnxt: fix Rx timestamp when FIFO pending bit is set
Fix to clear the Rx FIFO while reading the timestamp.
If the Rx FIFO has pending bit set, keep reading to clear it
and return the last valid timestamp instead of unconditionally
returning an error.
Eliminate separate codepath/handling for single queue
as the multiqueue code path takes care of it as well.
The only difference being the end_grp_id being 1
now instead of 0 for single queue, but that does not matter
for single queue and does not alter any functionality.