Bing Zhao [Thu, 3 Mar 2022 15:26:58 +0000 (17:26 +0200)]
net/mlx5: fix configuration without Rx queue
None Rx queue configured in a DPDK application should be supported.
In this mode, the NIC can be used to generate packets without
receiving any ingress traffic.
In the current implementation, once there is no Rx queue specified,
the array to store the queues' pointers is NULL after allocation.
Then the checking of the array allocation prevents the application
from starting up.
By adding another condition checking of the Rx queue number, the
application with none Rx queue can start up successfully.
Fixes: 4cda06c3c35e ("net/mlx5: split Rx queue into shareable and private") Cc: stable@dpdk.org Signed-off-by: Bing Zhao <bingz@nvidia.com> Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
Michael Baum [Wed, 2 Mar 2022 19:14:31 +0000 (21:14 +0200)]
net/mlx5: fix E-Switch DV flow disabling
E-Switch DV flow is supported only when DV flow is supported and
enabled.
The mlx5_shared_dev_ctx_args_config() function ensures that when the
environment does not support DV, the "dv_esw_en" flag is turned off.
However, when the environment is supportive but the user has requested
to disable it, the "dv_esw_en" flag remains on and causes the PMD to try
to create an E-Switch through the Verbs engine.
This patch adds check to ensure that "dv_esw_en" flag will be turned off
when DV flow is disabled.
When using Verbs flow engine to create flows, GRE Verbs spec was put at
the end of specs list. This created problems for flows matching MPLSoGRE
packets. In generated specs list MPLS spec was put before GRE spec, but
Verbs API requires that MPLS spec must be put in its exact location in
protocol stack.
This patch fixes this behavior. Space for GRE Verbs spec is reserved at
its exact location. MPLS Verbs is inserted at its exact location as
well. GRE spec is filled after all flow items are parsed.
Fixes: 985b479267aa ("net/mlx5: fix GRE protocol type translation for Verbs") Cc: stable@dpdk.org Signed-off-by: Dariusz Sosnowski <dsosnowski@nvidia.com> Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
Shun Hao [Wed, 2 Mar 2022 10:33:01 +0000 (12:33 +0200)]
net/mlx5: fix meter policy creation assert
The meter policy creation doesn't belong to flow rule creation
process, so thread workspace was not initialized and there will be
assert error when using it.
This patch removes the incorrect using of thread workspace in meter
policy creation, and adds a flag in policy instead. When creating
flow rule, can use the flag to set the mark flag in thread workspace.
Fixes: 082becbf1f35 ("net/mlx5: fix mark enabling for Rx") Cc: stable@dpdk.org Signed-off-by: Shun Hao <shunh@nvidia.com> Acked-by: Matan Azrad <matan@nvidia.com>
Bing Zhao [Wed, 2 Mar 2022 07:57:35 +0000 (09:57 +0200)]
net/mlx5: remove unused reference counter
In the previous implementation, a count was used to record the number
of the references to a table resource, including the creation of the
table, the jumping to the table and the matchers created on the
table. Before releasing the table resource via the driver, it needed
to ensure that there is no reference to this table.
After the optimization of the resources management, the reference
count now is in the hash list entry as a unified solution for all the
resources management.
There is no need to keep the "refcnt" in the table resource
structure. It is removed in case that there is some unnecessary
memory overhead.
Dmitry Kozlyuk [Wed, 2 Mar 2022 01:34:29 +0000 (03:34 +0200)]
net/mlx5: fix modify port action validation
Certain flow rules containing a modify header action for an L4 port
could be erroneously rejected as invalid, because this action
was counted as consuming two HW actions, while it only requires one.
Jiawei Wang [Wed, 2 Mar 2022 15:30:51 +0000 (17:30 +0200)]
net/mlx5: fix NIC egress flow mismatch in switchdev mode
When E-Switch mode was enabled, the NIC egress flows was implicitly
appended with source vport to match on. If the metadata register C0
was used to maintain the source vport, it was initialized to zero
on packet steering engine entry, the flow could be hit only
if source vport was zero, the register C0 of the packet was not correct
to match in the TX side, this caused egress flow misses.
This patch:
- removes the implicit source vport match for NIC egress flow.
- rejects the NIC egress flows on the representor ports at validation.
- allows the internal NIC egress flows containing the TX_QUEUE items in
order to not impact hairpins.
Fixes: ce777b147bf8 ("net/mlx5: fix E-Switch flow without port item") Cc: stable@dpdk.org Signed-off-by: Jiawei Wang <jiaweiw@nvidia.com> Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com> Acked-by: Ori Kam <orika@nvidia.com>
Rongwei Liu [Wed, 2 Mar 2022 11:19:38 +0000 (13:19 +0200)]
net/mlx5: fix shared RSS destroy
When both shared and non-shared RSS actions are present in single
flow rule shared RSS index is unset by mistake.
For example:
1. flow indirect_action 0 create action_id 3 ingress action RSS ...
2. set sample_actions 0 mark id 43690 / queue index 0 / end
3. flow create 0 ingress group 107 pattern eth / sample ratio 2
index 0 / indirect 3 / end
PMD translates the indirect action to a shared RSS description at first.
In the split prefix flow, RSS->shared_RSS is unset when translating
sample queue action, the subfix flow will treat the RSS as non-shared.
Fixes: 8e61555657b2 ("net/mlx5: fix shared RSS and mark actions combination") Cc: stable@dpdk.org Signed-off-by: Rongwei Liu <rongweil@nvidia.com> Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
Gregory Etelson [Tue, 1 Mar 2022 15:18:55 +0000 (17:18 +0200)]
net/mlx5: fix next protocol RSS expansion
RSS expansion scheme has 2 operational modes: default and specific.
The default mode expands into all valid options for a given network
layer. For example, Ethernet expands by default into VLAN, IPv4 and
IPv6, L3 expands into TCP and UDP, etc.
The specific mode expands according to flow item next protocol
configuration provided by the item spec and mask parameters.
There are 3 outcomes for the specific expansion:
1. Back to default – that is the case when result of (spec & mask)
allows all possibilities.
For example: eth type mask 0 type spec 0
2. No results – in that case item configuration has no valid expansion.
For example: eth type mask 0xffff type spec 101
3. Direct - In that case flow item mask and spec configuration return
valid expansion option.
Example: eth type mask 0x0fff type spec 0x0800.
Current PMD expands flow items with explicit spec and mask
configuration into the Direct(3) or No results (2). Default expansions
were handled as No results.
Fixes: f3f1f576f438 ("net/mlx5: fix RSS expansion with explicit next protocol") Cc: stable@dpdk.org Signed-off-by: Gregory Etelson <getelson@nvidia.com> Acked-by: Matan Azrad <matan@nvidia.com>
Weiguo Li [Thu, 24 Feb 2022 15:53:59 +0000 (23:53 +0800)]
net/bnxt: fix null dereference in session cleanup
In tf_session_create(), there is a case that with 'tfp->session' still
be NULL and run 'goto cleanup', which will leads to a null dereference
by 'tfp_free(tfp->session->core_data)' in the cleanup.
Fixes: a46bbb57605b ("net/bnxt: update multi device design") Cc: stable@dpdk.org Signed-off-by: Weiguo Li <liwg06@foxmail.com> Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Thomas Monjalon [Tue, 8 Mar 2022 21:02:48 +0000 (22:02 +0100)]
devtools: fix symbols check
In some environments, the check of local symbols catch-all
was failing. Note: this script is called during the build.
The reason is that grep returns an error if nothing is found.
The option -e of the shell script makes this error fatal.
It is not always fatal because the grep is in a command substitution.
Fixes: b403498e1422 ("build: hide local symbols in shared libraries") Reported-by: Usama Arif <usama.arif@bytedance.com> Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Ferruh Yigit [Tue, 8 Mar 2022 09:47:00 +0000 (09:47 +0000)]
ethdev: fix doxygen comments for device info struct
API documentation for "struct rte_eth_dev_info" was missing some fields
'device' & 'max_hash_mac_addrs',
because of syntax error in doxygen comment, fixing it.
Bugzilla ID: 954 Fixes: 88ac4396ad29 ("ethdev: add VMDq support") Fixes: cd8c7c7ce241 ("ethdev: replace bus specific struct with generic dev") Cc: stable@dpdk.org Reported-by: Bruce Merry <bmerry@sarao.ac.za> Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
David Marchand [Tue, 8 Mar 2022 09:44:22 +0000 (10:44 +0100)]
vhost: fix external message handlers
Following a rework, external message handlers were receiving a pointer
to a vhost_user message (as stated in the API), but lost the ability to
interact with fds attached to the message.
Restore the original layout and put a build check and reminders.
Bugzilla ID: 953 Fixes: 5e0099dc709e ("vhost: remove payload size limitation") Reported-by: Fan Zhang <roy.fan.zhang@intel.com> Signed-off-by: David Marchand <david.marchand@redhat.com> Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com> Tested-by: Jakub Poczatek <jakub.poczatek@intel.com> Acked-by: Jakub Poczatek <jakub.poczatek@intel.com> Reviewed-by: Christophe Fontaine <cfontain@redhat.com>
Thomas Monjalon [Sun, 6 Mar 2022 09:20:23 +0000 (10:20 +0100)]
build: hide local symbols in shared libraries
The symbols which are not listed in the version script
are exported by default.
Adding a local section with a wildcard make non-listed functions
and variables as hidden, as it should be in all version.map files.
These are the changes done in the shared libraries:
- DF .text Base auxiliary_add_device
- DF .text Base auxiliary_dev_exists
- DF .text Base auxiliary_dev_iterate
- DF .text Base auxiliary_insert_device
- DF .text Base auxiliary_is_ignored_device
- DF .text Base auxiliary_match
- DF .text Base auxiliary_on_scan
- DF .text Base auxiliary_scan
- DO .bss Base auxiliary_bus_logtype
- DO .data Base auxiliary_bus
- DO .bss Base gpu_logtype
There is no impact on regexdev library.
Because these local symbols were exported as non-internal
in DPDK 21.11, any change in these functions would break the ABI.
Exception rules are added for these experimental libraries,
so the ABI check will skip them until the next ABI version.
A check is added to avoid such miss in future.
Fixes: 1afce3086cf4 ("bus/auxiliary: introduce auxiliary bus") Fixes: 8b8036a66e3d ("gpudev: introduce GPU device class library") Cc: stable@dpdk.org Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Thomas Monjalon [Sun, 6 Mar 2022 09:20:22 +0000 (10:20 +0100)]
regexdev: fix section attribute of symbols
The functions used by the drivers must be internal,
while the function and variables used in inline functions
must be experimental.
These are the changes done in the shared library:
- DF .text Base rte_regexdev_get_device_by_name
+ DF .text INTERNAL rte_regexdev_get_device_by_name
- DF .text Base rte_regexdev_register
+ DF .text INTERNAL rte_regexdev_register
- DF .text Base rte_regexdev_unregister
+ DF .text INTERNAL rte_regexdev_unregister
- DF .text Base rte_regexdev_is_valid_dev
+ DF .text EXPERIMENTAL rte_regexdev_is_valid_dev
- DO .bss Base rte_regex_devices
+ DO .bss EXPERIMENTAL rte_regex_devices
- DO .bss Base rte_regexdev_logtype
+ DO .bss EXPERIMENTAL rte_regexdev_logtype
Because these symbols were exported in the default section in DPDK 21.11,
any change in these functions would be seen as incompatible
by the ABI compatibility check.
An exception rule is added for this experimental library,
so the ABI check will skip it until the next ABI version.
Fixes: bab9497ef78b ("regexdev: introduce API") Cc: stable@dpdk.org Signed-off-by: Thomas Monjalon <thomas@monjalon.net> Acked-by: Ori Kam <orika@nvidia.com>
David Marchand [Tue, 1 Mar 2022 16:54:04 +0000 (17:54 +0100)]
devtools: use libabigail rule for mlx glue drivers
Convert the existing exception in the ABI script into a libabigail
suppression rule.
Note: file_name_regexp could be used to achieve the same with versions of
libabigail < 1.7 but soname_regexp has been preferred here since it is
already used with a recent change on common/mlx5.
While at it, fix indent from a recent change.
Signed-off-by: David Marchand <david.marchand@redhat.com> Acked-by: Ray Kinsella <mdr@ashroe.eu>
Aman Singh [Mon, 7 Mar 2022 14:27:06 +0000 (19:57 +0530)]
devtools/cocci: update script for ethdev namespace
Changed the filter from ETH_SPEED to ETH_SPEED_NUM to make the match
more specific. Added check for ETH_TUNNEL_FILTER and ETH_RSS_RETA
as these were missed before.
Signed-off-by: Aman Singh <aman.deep.singh@intel.com>
Tianli Lai [Mon, 7 Mar 2022 09:05:05 +0000 (17:05 +0800)]
examples/kni: add missing trailing newline in log
Add CR character at print link state information.
Fixes: db4e81351fb8 ("examples: use new link status print format") Cc: stable@dpdk.org Signed-off-by: Tianli Lai <laitianli@tom.com> Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
Wenwu Ma [Tue, 22 Feb 2022 10:51:27 +0000 (10:51 +0000)]
examples/multi_process: make RSS and checksum optional
The default values of rx mq_mode and rx offloads for port
will cause symmetric_mp startup failure if the port do not
support rss or csum. This patch makes the app to reconfigure
the NIC without them. Only quit the app if the second
reconfiguration fails.
Signed-off-by: Wenwu Ma <wenwux.ma@intel.com> Acked-by: Bruce Richardson <bruce.richardson@intel.com> Tested-by: Wei Ling <weix.ling@intel.com>
nb_rxd and nb_txd are used in polling mode and event mode of
operation. nb_rxd and nb_txd are already global in polling mode
but are not visible to event mode code. Make them visible to all
parts of the application.
Signed-off-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com> Reviewed-by: Kathleen Capella <kathleen.capella@arm.com> Reviewed-by: Ruifeng Wang <ruifeng.wang@arm.com> Acked-by: Bruce Richardson <bruce.richardson@intel.com> Tested-by: Yingya Han < yingyax.han@intel.com>
Sean Morrissey [Tue, 1 Mar 2022 14:49:08 +0000 (14:49 +0000)]
examples/l3fwd: support config file for EM
Add support to define ipv4 and ipv6 forwarding tables
from reading from a config file for EM with a format
similar to l3fwd-acl one.
Users can now use the default hardcoded route tables
or optionally config files for 'l3fwd_em'. Default
config files have been provided for use with EM.
Related l3fwd docs have been updated to reflect these
changes.
Signed-off-by: Sean Morrissey <sean.morrissey@intel.com> Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
Sean Morrissey [Tue, 1 Mar 2022 14:49:07 +0000 (14:49 +0000)]
examples/l3fwd: support config file for LPM/FIB
Add support to define ipv4 and ipv6 forwarding tables
from reading from a config file for LPM and FIB,
with format similar to l3fwd-acl one.
Users can now use the default hardcoded route tables
or optionally config files. Default config files have
been provided for use with LPM and FIB.
Signed-off-by: Sean Morrissey <sean.morrissey@intel.com> Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com> Tested-by: Yingya Han <yingyax.han@intel.com>
Ben Magistro [Tue, 25 Jan 2022 03:25:45 +0000 (03:25 +0000)]
app/dumpcap: allow help/version without primary process
Currently dumpcap tries to initialize dpdk before parsing command line
arguments, this makes it impossible to check version or help without
having the primary process running already.
If conversion of cBPF to eBPF fails (in rte_bpf_convert)
then the test should not try and print the result.
Coverity issue: 373661 Fixes: 2eccf6afbea9 ("bpf: add function to convert classic BPF to DPDK BPF") Cc: stable@dpdk.org Signed-off-by: Stephen Hemminger <stephen@networkplumber.org> Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
Reshma Pattan [Mon, 28 Feb 2022 09:58:56 +0000 (09:58 +0000)]
app/pdump: abort on multi-core capture limit
Check lcore id value is not the maximum core supported.
Using lcore id without this check might cause
out of bound access inside the rte_eal_wait_lcore.
Coverity issue: 375841 Fixes: b2854d5317e8 ("app/pdump: support multi-core capture") Cc: stable@dpdk.org Signed-off-by: Reshma Pattan <reshma.pattan@intel.com> Acked-by: Stephen Hemminger <stephen@networkplumber.org>
Wei Huang [Tue, 1 Mar 2022 08:47:03 +0000 (03:47 -0500)]
raw/ifpga: fix monitor thread
Monitor thread handles graceful shutdown according to the value of
specific sensors in device, two issues are found below.
1. Thread is not created when card is probed.
2. Thread is canceled without checking presence of other cards.
To fix them, thread is created in pci device probe function, a reference
count is checked before canceling the thread.
Haiyue Wang [Mon, 7 Mar 2022 10:25:56 +0000 (18:25 +0800)]
graph: remove useless duplicate name check
The node clone API parameter 'name' is the new node's postfix name, not
the final node name, so it makes no sense to check it. And the new name
will be checked duplicate when calling API '__rte_node_register'.
And update the test case to call clone API twice to check the real name
duplicate.
Signed-off-by: Haiyue Wang <haiyue.wang@intel.com> Acked-by: Jerin Jacob <jerinj@marvell.com>
Weiguo Li [Tue, 1 Mar 2022 20:32:57 +0000 (04:32 +0800)]
sched: remove useless malloc in PIE data init
'rte_pie_rt_data_init(NULL)' is not expected, and it's ought to
fail when this happen. The malloc inside the function didn't work.
So remove the malloc otherwise will lead to a memory leak.
Fixes: 44c730b0e37971 ("sched: add PIE based congestion management") Cc: stable@dpdk.org Signed-off-by: Weiguo Li <liwg06@foxmail.com> Acked-by: Stephen Hemminger <stephen@networkplumber.org> Acked-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
Wenxuan Wu [Fri, 11 Feb 2022 08:41:31 +0000 (08:41 +0000)]
eal/linux: fix device monitor stop return
The ret value in rte_dev_event_monitor_stop stands for whether the
monitor has been successfully closed, and should not bind with
rte_intr_callback_unregister, so once it goes to the right exit point of
rte_dev_event_monitor, the ret value should be set to 0.
Also, the refmonitor count has been carefully evaluated, the value
change from 1 to 0, so there is no potential memory leak failure.
David Marchand [Tue, 1 Mar 2022 10:53:54 +0000 (11:53 +0100)]
bus/pci: enhance driver pointer documentation
Setting driver pointer before mapping required for write combining
support since commit 4a928ef9f611 ("bus/pci: enable write combining
during mapping").
Move comments that got separated after different changes.
Also change the condition relying on dev->driver itself.
Signed-off-by: David Marchand <david.marchand@redhat.com>
Wenwu Ma [Fri, 4 Mar 2022 16:24:24 +0000 (16:24 +0000)]
examples/vhost: fix launch with physical port
dpdk-vhost will fail to launch with a 40G i40e port because
there are not enough mbufs. This patch adds a new option
--total-num-mbufs, through which the user can set larger
mbuf pool to avoid this problem.
Peng Yu [Tue, 15 Feb 2022 05:55:52 +0000 (05:55 +0000)]
vhost: fix linker script syntax
The punctuation after the `global` keyword should be colon, not
semicolon. The default gcc linker accepts both colon and semicolon, but
the gold linker will report syntax error if we use semicolon after the
`global` keyword.
Fixes: 94c16e89d779 ("vhost: mark vDPA driver API as internal") Cc: stable@dpdk.org Signed-off-by: Peng Yu <penyu@amazon.com> Reviewed-by: Chenbo Xia <chenbo.xia@intel.com>
Vamsi Attunuru [Wed, 2 Mar 2022 13:46:54 +0000 (19:16 +0530)]
common/cnxk: fix build with custom maximum port config
Build fails with custom max eth ports configuration, like
-Dmax_ethports=1024.
Build error is:
../drivers/common/cnxk/roc_nix_inl_dev.c:794:2:
note: in expansion of macro ‘PLT_STATIC_ASSERT’
| PLT_STATIC_ASSERT(sizeof(struct nix_inl_dev) <= ROC_NIX_INL_MEM_SZ);
| ^~~~~~~~~~~~~~~~~
Earlier soft expiry ring struct member was an array of pointers and it's
size is linked to number of RTE_MAX_ETHPORTS, and the whole struct size
is confined and protected by size assertion.
It resulted in build failure with -Dmax_ethports=1024 option and
assertion caught that failure.
Use dynamically allocated memory for storing soft expiry ring base
addresses which fixes the struct size against custom RTE_MAX_ETHPORTS
values and solves the static assertion failure.
Kevin Liu [Wed, 29 Dec 2021 09:37:01 +0000 (09:37 +0000)]
net/ice: fix Tx offload path choice
Testpmd forwards packets in checksum mode that it needs to calculate
the checksum of each layer's protocol.
When setting the hardware calculates the outer UDP checksum and the
software calculates the outer IP checksum, the dev->tx_pkt_burst in
ice_set_tx_function is set to ice_xmit_pkts_vec_avx2.
The inner and outer UDP checksum of the tunnel packet after forwarding
is wrong.The dev->tx_pkt_burst should be set to ice_xmit_pkts.
The patch adds RTE_ETH_TX_OFFLOAD_OUTER_UDP_CKSUM to
ICE_TX_NO_VECTOR_FLAGS, set dev->tx_pkt_burst to ice_xmit_pkts. After
the tunnel packet is forwarded, the inner and outer UDP checksum is
correct.
At the same time, the patch of "net/ice: fix Tx Checksum offload" will
cause interrupt errors in a special case that only inner IP and inner
UDP checksum are set for hardware calculation. The patch is updating
ICE_TX_NO_VECTOR_FLAGS, the problem can be solved, so I will restore the
code modification of that patch.
Harman Kalra [Thu, 3 Mar 2022 07:00:42 +0000 (12:30 +0530)]
common/cnxk: fix mbuf data offset for VF
If PF has PTP enabled the data offset should be adjusted for VF to
skip extra 8 bytes of timestamp as the MAC inserts 8 bytes before
the ethernet header.
Fixes: c443e0d326e1 ("common/cnxk: support NIX PTP") Cc: stable@dpdk.org Signed-off-by: Harman Kalra <hkalra@marvell.com> Acked-by: Jerin Jacob <jerinj@marvell.com>
Revert change [1] to return error on case where no slab of free
resources is found. That error check break's a case where
there is a spare schedule queue to be reused that was just
allocated for sake of contiguous static TM nodes.
[1] Fixes: 14f7e5d4bf2d ("common/cnxk: add missing checks of return values") Cc: stable@dpdk.org Signed-off-by: Nithin Dabilpuram <ndabilpuram@marvell.com> Acked-by: Jerin Jacob <jerinj@marvell.com>
Gregory Etelson [Tue, 1 Mar 2022 12:28:24 +0000 (14:28 +0200)]
net/mlx5: fix flex item header length translation
Flex item API provides support for network header with a fixed and
variable lengths.
When PMD compiles a new flex item object configuration it converts
RTE parameters into matching PMD PARSE_GRAPH parameters and checks
the parameter values against port capabilities.
Current implementation mismatched PARSE_GRAPH configuration fields
for the fixed size header.
Michael Baum [Tue, 1 Mar 2022 11:09:35 +0000 (13:09 +0200)]
common/mlx5: fix default devargs initialization
Device arguments list is provided along with its identifier as part of
EAL arguments.
The arguments specified in the list are taken from it, and the rest is
initialized to the default values.
When no list is provided at all, all arguments should have been
initialized to their default values. However, they are mistakenly
initialized to zero which may be a valid value for some.
This patch initializes the default values before checking whether
arguments have been specified.
Bing Zhao [Mon, 28 Feb 2022 11:41:49 +0000 (13:41 +0200)]
net/mlx5: fix matcher priority with ICMP or ICMPv6
On TCP/IP-based layered network, ICMP is considered and implemented
as part of layer 3 IP protocol. Actually, it is a user of the IP
protocol and must be encapsulated within IP packets. There is no
layer 4 protocol over ICMP.
The rule with layer 4 should be matched prior to the rule only with
layer 3 pattern when:
1. Both rules are created in the same table
2. Both rules could be hit
3. The rules has the same priority
The steering result of the packet is indeterministic if there are
rules with patterns IP and IP+ICMP in the same table with the same
priority. Like TCP / UDP, a packet should hit the rule with a longer
matching criterion.
By treating the priority of ICMP/ICMPv6 as a layer 4 priority in the
PMD internally, the IP+ICMP will be hit in prior to IP only.
Fixes: d53aa89aea91 ("net/mlx5: support matching on ICMP/ICMP6") Cc: stable@dpdk.org Signed-off-by: Bing Zhao <bingz@nvidia.com> Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
Gregory Etelson [Mon, 28 Feb 2022 09:53:01 +0000 (11:53 +0200)]
net/mlx5: fix GRE item translation in Verbs
GRE item translation must set inner protocol value.
For that reason the item is not translated inplace when PMD
translation iterates over flow items, but moved after the loop, when
all inner types are discovered.
If PMD does not translate GRE flow item inside the translation loop
it must save the GRE item for access outside the loop.
Fixes: 985b479267aa ("net/mlx5: fix GRE protocol type translation for Verbs") Cc: stable@dpdk.org Signed-off-by: Gregory Etelson <getelson@nvidia.com> Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
A pattern template creation shares the parsing mechanism with
a simple flow creation. The pattern template creation only consists
of pattern items while the flow creation continues with actions.
The parsing mechanism now accommodates both cases and allows to stop
at the item end token, which should not happen for the flow creation.
Fix parsing mechanism to differentiate between these two cases.
Bugzilla ID: 941 Fixes: 04cc665fab38 ("app/testpmd: add flow template management") Signed-off-by: Alexander Kozyrev <akozyrev@nvidia.com> Acked-by: Ori Kam <orika@nvidia.com> Tested-by: Zhimin Huang <zhiminx.huang@intel.com>
John Miller [Wed, 2 Mar 2022 19:26:47 +0000 (13:26 -0600)]
net/ark: support multi-port packet generation
Added support for packet generation in
multi-port Arkville implementations. The packet
generator is a singleton within the device but is
capable of generating packets for any port within
one device.
Signed-off-by: John Miller <john.miller@atomicrules.com>
Harold Huang [Thu, 3 Mar 2022 02:18:03 +0000 (10:18 +0800)]
net/kni: fix config initialization
When kni driver calls eth_kni_start to start device, some fields such as
min_mtu and max_mtu of rte_kni_conf are not initialized. It will cause
kni_ioctl_create create a kni netdevice with a random min_mtu and
max_mtu value. This is unexpected and sometimes we could not change the
kni device mtu with ip link command.
Fixes: ff1e35fb5f83 ("kni: calculate MTU from mbuf size") Cc: stable@dpdk.org Signed-off-by: Harold Huang <baymaxhuang@gmail.com> Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
Michael Baum [Mon, 28 Feb 2022 07:09:54 +0000 (09:09 +0200)]
net/mlx5: fix check in count action validation
The AGE action can be implemented by either counters or ASO mechanism.
ASO is more efficient than generating counters just for the purpose of
aging, so when ASO is supported its use is preferable. On the other
hand, when there is count in the list of actions, the counter is already
generated, and it is best to use it for aging even if ASO is supported.
On the other hand, when the count action is "indirect", it cannot be
used for aging since it may be updated from other flow rules in which it
participates.
Checking whether ASO is supported depends on both the capability of the
device and the flow rule group number, ASO is not supported for group 0.
However, the flow_dv_validate() function only checks the capability and
ignores the group, allowing inadmissible flow rules.
For example, when the device supports ASO and a flow rule is set that
combines an indirect counter with aging for group 0, the rule should be
rejected, but it is created and does not function properly.
This patch updates the counter validation which will also consider the
group number when deciding if there is ASO support.
Fixes: daed4b6e3db2 ("net/mlx5: use aging by counter when counter exists") Cc: stable@dpdk.org Signed-off-by: Michael Baum <michaelba@nvidia.com> Acked-by: Matan Azrad <matan@nvidia.com>
Michael Baum [Mon, 28 Feb 2022 07:09:53 +0000 (09:09 +0200)]
net/mlx5: fix shared counter flag in flow validation
The AGE action can be implemented by either counters or ASO mechanism.
When user ask count action in the flow rule, AGE action is implemented
by the same counter. However, if user ask indirect count action, it
cannot be used for AGE.
The flow_dv_validate() function has a flag named "shared_count" which
indicates whether AGE action validate depends on ASO support or not.
This flag is initialized to false and is updated if there is indirect
count action in the action list.
This flag is mistakenly set within the loop that reads the action list
and in each iteration it is reinitialized to false, regardless of the
existence of an indirect count action in the list.
This patch moves the flag initialization out of the loop.
Fixes: f3191849f2c2 ("net/mlx5: support flow count action handle") Cc: stable@dpdk.org Signed-off-by: Michael Baum <michaelba@nvidia.com> Acked-by: Matan Azrad <matan@nvidia.com>
Adham Masarwah [Wed, 23 Feb 2022 09:32:05 +0000 (11:32 +0200)]
net/mlx5: fix destroying empty matchers list
The table remove callback function is trying to destroy the
matchers list associated with table entries without checking
if the list is valid, which causes null pointer dereference.
Fixed by validating the matchers list before destroying it.
Issue can be reproduced with testpmd on Windows, when you run:
port close all
Fixes: 1872635570be ("net/mlx5: make matcher list thread safe") Cc: stable@dpdk.org Signed-off-by: Adham Masarwah <adham@nvidia.com> Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com> Acked-by: Tal Shnaiderman <talshn@nvidia.com> Tested-by: Idan Hackmon <idanhac@nvidia.com>
Suanming Mou [Wed, 23 Feb 2022 06:26:11 +0000 (08:26 +0200)]
net/mlx5: fix indexed pool fetch overlap
For indexed pool with local cache, when a new trunk is allocated,
half of the trunk's index was fetched to the local cache. In case
of local cache size was less then half of the trunk size, memory
overlap happened.
This commit adds the check of the fetch size, if local cache size
is less than fetch size, adjust the fetch size to be local cache
size.
Fixes: d15c0946beea ("net/mlx5: add indexed pool local cache") Cc: stable@dpdk.org Signed-off-by: Suanming Mou <suanmingm@nvidia.com> Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
Dmitry Kozlyuk [Tue, 1 Mar 2022 12:15:14 +0000 (14:15 +0200)]
net/mlx5: fix initial link status detection
Link status change takes time that depends on the HW and the kernel.
It was checked immediately after the change was issued at probing.
If the port had been down before probing, a "down" state may be read,
while the port would be "up" imminently.
After that, DPDK reported the port as "down" mistakenly
and "ifconfig $DEV up" did not trigger an LSC event,
because from the system's perspective the port was "up" already.
Install Netlink event handler at port probe before requesting the port
to come up in order to receive LSC event even if it comes up
between probe and start.
Fixes: a85a606ca501 ("net/mlx5: fix link status initialization") Cc: stable@dpdk.org Signed-off-by: Dmitry Kozlyuk <dkozlyuk@nvidia.com> Reviewed-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
Dmitry Kozlyuk [Tue, 1 Mar 2022 12:15:13 +0000 (14:15 +0200)]
net/mlx5: fix link status change detection
Sometimes net/mlx5 devices did not detect link status change to "up".
Each shared device was monitoring IBV_EVENT_PORT_{ACTIVE,ERR}
and queried the link status upon receiving the event.
IBV_EVENT_PORT_ACTIVE is delivered when the logical link status
(UP flag) is set, but the physical link status (RUNNING flag)
may be down at that time, in which case the new link status
would be erroneously considered down.
IBV interface is insufficient for the task.
Monitor interface events using Netlink.
Fixes: 198a3c339a8f ("mlx5: handle link status interrupts") Cc: stable@dpdk.org Signed-off-by: Dmitry Kozlyuk <dkozlyuk@nvidia.com> Reviewed-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
Dmitry Kozlyuk [Tue, 1 Mar 2022 12:15:12 +0000 (14:15 +0200)]
common/mlx5: add Netlink event helpers
Introduce mlx5_nl_read_events() to read Netlink events
(technically, messages) from a socket that was configured
to listen for them via a new mlx5_nl_init() parameter.
Add mlx5_nl_parse_link_status_update() helper
to extract information from link-related events.
This patch is a shared base for later fixes.
Kathleen Capella [Tue, 22 Feb 2022 22:48:18 +0000 (22:48 +0000)]
net/iavf: remove extra check in vector Tx
In the vector Tx path, the function iavf_xmit_pkts_vec_xxx compares
nb_pkts and the txq->rs_thresh and passes the minimum of these as an
argument to iavf_xmit_fixed_burst_vec_xxx.
Inside iavf_xmit_fixed_burst_vec_xxx, the same check is performed again.
This patch removes the redundant check from the
iavf_xmit_fixed_burst_vec_xxx function.
Steve Yang [Mon, 28 Feb 2022 09:48:59 +0000 (09:48 +0000)]
net/iavf: fix function pointer in multi-process
This patch uses the index value to call the function, instead of the
function pointer assignment to save the selection of Receive Flex
Descriptor profile ID.
Otherwise the secondary process will run with wrong function address
from primary process.
Fixes: 12b435bf8f2f ("net/iavf: support flex desc metadata extraction") Cc: stable@dpdk.org Signed-off-by: Steve Yang <stevex.yang@intel.com> Acked-by: Qi Zhang <qi.z.zhang@intel.com>
Radu Nicolau [Mon, 28 Feb 2022 15:00:22 +0000 (15:00 +0000)]
net/iavf: support NAT-T / UDP encapsulation
Add support for NAT-T / UDP encapsulated ESP.
This fixes the inline crypto feature for iAVF which will not
function properly without setting the UDP encapsulation options.
Fixes: 6bc987ecb860 ("net/iavf: support IPsec inline crypto") Cc: stable@dpdk.org Signed-off-by: Radu Nicolau <radu.nicolau@intel.com> Reviewed-by: Qi Zhang <qi.z.zhang@intel.com>
Stephen Douthit [Mon, 28 Feb 2022 15:29:35 +0000 (10:29 -0500)]
net/ixgbe: fix FSP check for X550EM devices
Currently all X500EM* MAC types fall through to the default case and get
reported as non-SFP regardless of media type, which isn't correct.
Fixes: 0790adeb5675 ("ixgbe/base: support X550em_a device") Cc: stable@dpdk.org Signed-off-by: Stephen Douthit <stephend@silicom-usa.com> Signed-off-by: Jeff Daly <jeffd@silicom-usa.com> Acked-by: Haiyue Wang <haiyue.wang@intel.com>
Huisong Li [Wed, 2 Mar 2022 00:35:01 +0000 (08:35 +0800)]
net/hns3: increase time waiting for PF reset completion
On the case that PF and VF need to be reset, after the hardware reset is
complete, VF needs wait for 1 second to restore the configuration so
that VF does not fail to recover because PF reset isn't complete. But
the estimated time is not sufficient. This patch fixes it to 5 seconds.
Fixes: 2790c6464725 ("net/hns3: support device reset") Cc: stable@dpdk.org Signed-off-by: Huisong Li <lihuisong@huawei.com> Acked-by: Min Hu (Connor) <humin29@huawei.com>
Huisong Li [Mon, 28 Feb 2022 03:21:46 +0000 (11:21 +0800)]
net/hns3: fix VF RSS TC mode entry
For packets with VLAN priorities destined for the VF, hardware still
assign Rx queue based on the Up-to-TC mapping PF configured. But VF has
only one TC. If other TC don't enable, it causes that the priority
packets that aren't destined for TC0 aren't received by RSS hash but is
destined for queue 0. So driver has to enable the unused TC by using TC0
queue mapping configuration.
Fixes: c37ca66f2b27 ("net/hns3: support RSS") Cc: stable@dpdk.org Signed-off-by: Huisong Li <lihuisong@huawei.com> Acked-by: Min Hu (Connor) <humin29@huawei.com>
Huisong Li [Mon, 28 Feb 2022 03:21:45 +0000 (11:21 +0800)]
net/hns3: fix RSS TC mode entry
The driver allocates queues only to valid TCs. But the driver also
configure queues for invalid TCs, which is unreasonable.
Fixes: c37ca66f2b27 ("net/hns3: support RSS") Cc: stable@dpdk.org Signed-off-by: Huisong Li <lihuisong@huawei.com> Acked-by: Min Hu (Connor) <humin29@huawei.com>
Jie Hai [Mon, 28 Feb 2022 03:21:41 +0000 (11:21 +0800)]
net/hns3: remove duplicate macro definition
This patch fixes duplicate macro definition of HNS3_RSS_CFG_TBL_SIZE.
Fixes: 737f30e1c3ab ("net/hns3: support command interface with firmware") Cc: stable@dpdk.org Signed-off-by: Jie Hai <haijie1@huawei.com> Acked-by: Min Hu (Connor) <humin29@huawei.com>
Anoob Joseph [Fri, 4 Mar 2022 10:40:38 +0000 (16:10 +0530)]
app/crypto-perf: add IPsec operations population routine
Ops population functions are called in datapath. Keeping it common for
PDCP & DOCSIS would mean ops population would have additional
conditional checks causing the throughput reported to be lower than what
the PMD is capable of.
Separate out routine for IPsec cases and split vector population and op
preparation into two loops to allow 2 rte_rdtsc_precise() calls to
capture cycles consumed for memcpying the vector. Checking the cycle
count from the loop would mean more calls to the same API.
Signed-off-by: Anoob Joseph <anoobj@marvell.com> Acked-by: Akhil Goyal <gakhil@marvell.com>
Kai Ji [Tue, 1 Mar 2022 15:02:54 +0000 (23:02 +0800)]
crypto/qat: fix process type handling
This patch fix the memory corruptions issue reported by
coverity. The process type handling in QAT PMDs where only
primary and secondary process are supported in qat build
request.
Coverity issue: 376551, 376570, 376534 Fixes: fb3b9f492205 ("crypto/qat: rework burst data path") Signed-off-by: Kai Ji <kai.ji@intel.com>
Raja Zidane [Tue, 1 Mar 2022 14:15:02 +0000 (16:15 +0200)]
compressdev: fix socket ID type
Socket ID is used and interpreted as integer, one of the possible
values for socket id is -1 (SOCKET_ID_ANY).
here socket_id is defined as unsigned 8 bit integer, so when putting
-1, it is interpreted as 255, which causes allocation errors when
trying to allocate from socket_id (255).
change socket_id from unsigned 8 bit integer to integer.
Raja Zidane [Wed, 2 Mar 2022 08:41:31 +0000 (10:41 +0200)]
app/compress-perf: fix number of queue pairs to setup
The number of QPs is limited by the number of cores, such that in
case the user requests more QPs than possible, the number of QPs
actually configured on the device is equal to the number of cores,
but the app tries to setup the original number of QPs.
Align the number of QPs setup'ed to the limited number.
Fixes: 424dd6c8c1a8 ("app/compress-perf: add weak functions for multicore test") Cc: stable@dpdk.org Signed-off-by: Raja Zidane <rzidane@nvidia.com> Acked-by: Matan Azrad <matan@nvidia.com>
Raja Zidane [Sun, 27 Feb 2022 14:00:52 +0000 (16:00 +0200)]
compress/mlx5: support out-of-space status
When trying to dequeue, an OP may fail due to insufficient
space for the OP output, the compressdev API defines out-of-space
for OP status. The driver can detect out-of-space errors and
report them to the user. Check if hw_error_syndrome specifies
out-of-space and set the OP status accordingly.
Also added an error message for a case of missing B-final flag.
Raja Zidane [Wed, 23 Feb 2022 13:33:07 +0000 (15:33 +0200)]
app/compress-perf: optimize operations pool allocation
An array of the size of total operations needed for the de/compression is
reserved for ops while enqueueing, although only first burst_size entries
of the array are used.
Reduce the size of the array allocated.
Fixes: b68a82425da4 ("app/compress-perf: add performance measurement") Cc: stable@dpdk.org Signed-off-by: Raja Zidane <rzidane@nvidia.com> Acked-by: Matan Azrad <matan@nvidia.com> Acked-by: Fan Zhang <roy.fan.zhang@intel.com>
In cyclecount main_loop function, each iteration it tries to
enqueue X ops, in case Y<X ops were enqueued, the rest of the
X-Y ops are moved to the beginning of the ops array, to preserve
ops order, and next Y ops are allocated for the next enqueue
action, the allocation of the ops occurs on the first Y entries
in the array, when it should have skipped the first X-Y
array entries and allocate the following Y entries.
Fix the allocation by adding the correct offset.
Fixes: 2695db95a147 ("test/compress: add cycle-count mode to perf tool") Cc: stable@dpdk.org Signed-off-by: Raja Zidane <rzidane@nvidia.com> Acked-by: Matan Azrad <matan@nvidia.com>
Thomas Monjalon [Sat, 26 Feb 2022 18:36:51 +0000 (19:36 +0100)]
ci: remove redundant drivers enabling
No need to explicitly enable drivers bus/vdev and mempool/ring.
bus/vdev is always enabled since
commit 2e33309ebe03 ("config: enable/disable drivers in Arm builds")
mempool/ring is always enabled since
commit 81c2337e044d ("build: make ring mempool driver mandatory")
The driver net/null is kept to allow running test-null.sh.
Signed-off-by: Thomas Monjalon <thomas@monjalon.net> Acked-by: Bruce Richardson <bruce.richardson@intel.com> Acked-by: David Marchand <david.marchand@redhat.com>
Thomas Monjalon [Tue, 8 Feb 2022 13:47:15 +0000 (14:47 +0100)]
ci: remove outdated default versions for ABI check
The variables REF_GIT_TAG and LIBABIGAIL_VERSION are set
in the CI configuration like .travis.yml or .github/workflows/build.yml.
The default values are outdated and probably unused.
The default values are removed completely
to avoid forgetting an update in future.
The use of the variables is quoted to make sure
a missing value will trigger an appropriate failure.
Signed-off-by: Thomas Monjalon <thomas@monjalon.net> Acked-by: Aaron Conole <aconole@redhat.com> Acked-by: David Marchand <david.marchand@redhat.com>
Huisong Li [Wed, 9 Feb 2022 07:35:25 +0000 (15:35 +0800)]
kni: fix freeing order in device release
The "kni_dev" is the private data of the "net_device" in kni, and allocated
with the "net_device" by calling "alloc_netdev()". The "net_device" is
freed by calling "free_netdev()" when kni release. The freed memory
includes the "kni_dev". So after "kni_dev" should not be accessed after
"net_device" is released.
Fixes: e77fec694936 ("kni: fix possible mbuf leaks and speed up port release") Cc: stable@dpdk.org
KASAN trace:
Michal Krawczyk [Wed, 19 Jan 2022 14:50:37 +0000 (15:50 +0100)]
bus/pci: assign driver pointer before mapping
Patch changing the way of accessing interrupt handle also changed order
of the rte_pci_map_device() call and rte_pci_device:driver assignment.
It was causing issues with Write Combine mapping on the Linux platform
if it was used with the igb_uio module.
Linux implementation of pci_uio_map_resource_by_index(), which is called
by rte_pci_map_device(), needs access to the device's driver. Otherwise
it won't be able to check the driver's flags and won't respect them.
Fixes: d61138d4f0e2 ("drivers: remove direct access to interrupt handle") Cc: stable@dpdk.org Signed-off-by: Michal Krawczyk <mk@semihalf.com>
Steve Yang [Wed, 23 Feb 2022 08:49:50 +0000 (08:49 +0000)]
eal/linux: fix illegal memory access in uevent handler
'recv()' fills the 'buf', later 'strlcpy()' used to copy from this buffer.
But as coverity warns 'recv()' doesn't guarantee that 'buf' is
null-terminated, but 'strlcpy()' requires it.
Enlarge 'buf' size to 'EAL_UEV_MSG_LEN + 1' and ensure the last one can
be set to 0 when received buffer size is EAL_UEV_MSG_LEN.
CID 375864: Memory - illegal accesses (STRING_NULL)
Passing unterminated string "buf" to "dev_uev_parse", which expects
a null-terminated string.
Coverity issue: 375864 Fixes: 0d0f478d0483 ("eal/linux: add uevent parse and process") Cc: stable@dpdk.org Signed-off-by: Steve Yang <stevex.yang@intel.com> Acked-by: Ferruh Yigit <ferruh.yigit@intel.com>