dpdk.git
2 years agoraw/ifpga: fix interrupt handle allocation
Wei Huang [Fri, 18 Feb 2022 07:38:48 +0000 (02:38 -0500)]
raw/ifpga: fix interrupt handle allocation

Allocate FPGA interrupt handle instance for each card.

Fixes: e0a1aafe2af9 ("raw/ifpga: introduce IRQ functions")
Cc: stable@dpdk.org
Signed-off-by: Wei Huang <wei.huang@intel.com>
Acked-by: Tianfei Zhang <tianfei.zhang@intel.com>
2 years agoraw/ifpga: fix variable initialization in probing
Wei Huang [Mon, 21 Feb 2022 07:52:22 +0000 (02:52 -0500)]
raw/ifpga: fix variable initialization in probing

Scalar variable sub_brg_bdf may be used uninitialized in function
ifpga_rawdev_fill_info(). It is initialized now in this fix.

Coverity issue: 375805
Fixes: 9c006c45d0c5 ("raw/ifpga: scan PCIe BDF device tree")
Cc: stable@dpdk.org
Signed-off-by: Wei Huang <wei.huang@intel.com>
Acked-by: Tianfei Zhang <tianfei.zhang@intel.com>
2 years agogpu/cuda: fix dependency loading path
Elena Agostini [Tue, 1 Mar 2022 19:42:05 +0000 (19:42 +0000)]
gpu/cuda: fix dependency loading path

A slash was missing in libcuda.so path for dlopen.

Signed-off-by: Elena Agostini <eagostini@nvidia.com>
2 years agograph: remove useless duplicate name check
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>
2 years agosched: remove useless malloc in PIE data init
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>
2 years agoeal/linux: fix device monitor stop return
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.

Fixes: 1fef6ced07f3 ("eal/linux: allow multiple starts of event monitor")
Cc: stable@dpdk.org
Signed-off-by: Wenxuan Wu <wenxuanx.wu@intel.com>
2 years agobus/pci: enhance driver pointer documentation
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>
2 years agoexamples/vhost: fix launch with physical port
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.

Fixes: 4796ad63ba1f ("examples/vhost: import userspace vhost application")
Cc: stable@dpdk.org
Signed-off-by: Wenwu Ma <wenwux.ma@intel.com>
Reviewed-by: Chenbo Xia <chenbo.xia@intel.com>
2 years agovhost: fix linker script syntax
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>
2 years agocommon/cnxk: fix build with custom maximum port config
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.

Bugzilla ID: 940
Fixes: bea5d990a93b ("net/cnxk: support outbound soft expiry notification")
Cc: stable@dpdk.org
Reported-by: Wei Ling <weix.ling@intel.com>
Reported-by: Yu Jiang <yux.jiang@intel.com>
Signed-off-by: Vamsi Attunuru <vattunuru@marvell.com>
Signed-off-by: Srikanth Yalavarthi <syalavarthi@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
2 years agonet/ice: fix Tx offload path choice
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.

Fixes: 28f9002ab67f ("net/ice: add Tx AVX512 offload path")
Fixes: 295968d17407 ("ethdev: add namespace")
Fixes: 17c7d0f9d6a4 ("net/ice: support basic Rx/Tx")
Cc: stable@dpdk.org
Signed-off-by: Kevin Liu <kevinx.liu@intel.com>
Acked-by: Ting Xu <ting.xu@intel.com>
Reviewed-by: Qi Zhang <qi.z.zhang@intel.com>
2 years agocommon/cnxk: fix mbuf data offset for VF
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>
2 years agocommon/cnxk: fix bitmap usage for TM
Nithin Dabilpuram [Thu, 3 Mar 2022 07:00:41 +0000 (12:30 +0530)]
common/cnxk: fix bitmap usage for TM

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>
2 years agonet/iavf: fix AES-GMAC IV size
Radu Nicolau [Tue, 1 Mar 2022 13:41:31 +0000 (13:41 +0000)]
net/iavf: fix AES-GMAC IV size

Fix AES-GMAC size, set it to the required value, unlike lookaside
where it also includes salt length.

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>
2 years agonet/mlx5: fix flex item header length translation
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.

Fixes: b293e8e49d78 ("net/mlx5: translate flex item configuration")
Cc: stable@dpdk.org
Signed-off-by: Gregory Etelson <getelson@nvidia.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
2 years agocommon/mlx5: fix default devargs initialization
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.

Bugzilla ID: 945
Fixes: a729d2f093e9 ("common/mlx5: refactor devargs management")

Signed-off-by: Michael Baum <michaelba@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
2 years agonet/mlx5: fix matcher priority with ICMP or ICMPv6
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>
2 years agonet/mlx5: reduce flex item flow handle size
Gregory Etelson [Mon, 28 Feb 2022 10:01:24 +0000 (12:01 +0200)]
net/mlx5: reduce flex item flow handle size

Reduce flex item flow handle size from 32 bits to 8 bits for each
flow.
The patch will save memory in setups with millions of flows.

Fixes: a23e9b6e3ee9 ("net/mlx5: handle flex item in flows")
Cc: stable@dpdk.org
Signed-off-by: Gregory Etelson <getelson@nvidia.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
2 years agonet/mlx5: fix GRE item translation in Verbs
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>
2 years agoapp/testpmd: fix flow rule creation parsing
Alexander Kozyrev [Tue, 1 Mar 2022 22:47:39 +0000 (00:47 +0200)]
app/testpmd: fix flow rule creation parsing

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>
2 years agodoc: fix typos and punctuation in flow API guide
Ali Alnubani [Tue, 1 Mar 2022 12:17:09 +0000 (14:17 +0200)]
doc: fix typos and punctuation in flow API guide

This fixes typos and punctuation in the rte flow API guide.

Fixes: 2f82d143fb31 ("ethdev: add group jump action")
Fixes: 4d73b6fb9907 ("doc: add generic flow API guide")
Cc: stable@dpdk.org
Signed-off-by: Ali Alnubani <alialnu@nvidia.com>
Acked-by: Ferruh Yigit <ferruh.yigit@intel.com>
2 years agonet/ark: support multi-port packet generation
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>
2 years agonet/kni: fix config initialization
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>
2 years agonet/txgbe: fix queue statistics mapping
Weiguo Li [Tue, 1 Mar 2022 06:08:30 +0000 (14:08 +0800)]
net/txgbe: fix queue statistics mapping

Since boolean value is in 0 and 1, it's strange to combines a boolean
value with a bit operator.

Thus it's highly possible a typo error with "if (A & !B)", and more
probably to use "if (A & ~B)" instead.

Fixes: c1d4e9d37abd ("net/txgbe: add queue stats mapping")
Cc: stable@dpdk.org
Signed-off-by: Weiguo Li <liwg06@foxmail.com>
Acked-by: Jiawen Wu <jiawenwu@trustnetic.com>
2 years agonet/mlx5: fix check in count action validation
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>
2 years agonet/mlx5: fix shared counter flag in flow validation
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>
2 years agonet/mlx5: fix destroying empty matchers list
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>
2 years agonet/mlx5: fix indexed pool fetch overlap
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>
2 years agonet/mlx5: fix initial link status detection
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>
2 years agonet/mlx5: fix link status change detection
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>
2 years agocommon/mlx5: add Netlink event helpers
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.

Cc: stable@dpdk.org
Signed-off-by: Dmitry Kozlyuk <dkozlyuk@nvidia.com>
Reviewed-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
2 years agonet/iavf: remove extra check in vector Tx
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.

Signed-off-by: Kathleen Capella <kathleen.capella@arm.com>
Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
2 years agonet/iavf: fix function pointer in multi-process
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>
2 years agonet/iavf: support NAT-T / UDP encapsulation
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>
2 years agonet/ixgbe: fix FSP check for X550EM devices
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>
2 years agonet/hns3: increase time waiting for PF reset completion
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>
2 years agonet/hns3: fix VF RSS TC mode entry
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>
2 years agonet/hns3: fix RSS TC mode entry
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>
2 years agonet/hns3: remove duplicate macro definition
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>
2 years agoapp/crypto-perf: add IPsec operations population routine
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>
2 years agocrypto/qat: fix process type handling
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>
2 years agocrypto/qat: fix smaller modulus cases for mod exp
Arek Kusztal [Tue, 1 Mar 2022 14:16:16 +0000 (14:16 +0000)]
crypto/qat: fix smaller modulus cases for mod exp

This patch fixes not working cases when modulus is
smaller than other arguments.

Fixes: 3b78aa7b2317 ("crypto/qat: refactor asymmetric crypto functions")

Signed-off-by: Arek Kusztal <arkadiuszx.kusztal@intel.com>
Acked-by: Fan Zhang <roy.fan.zhang@intel.com>
2 years agocrypto/qat: fix RSA clearing
Arek Kusztal [Mon, 28 Feb 2022 16:05:55 +0000 (16:05 +0000)]
crypto/qat: fix RSA clearing

This patch fixes structurally dead code in QAT
asym pmd.

Coverity issue: 376563
Fixes: 002486db239e ("crypto/qat: refactor asymmetric session")

Signed-off-by: Arek Kusztal <arkadiuszx.kusztal@intel.com>
2 years agocompressdev: fix socket ID type
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.

Fixes: ed7dd94f7f66 ("compressdev: add basic device management")
Cc: stable@dpdk.org
Signed-off-by: Raja Zidane <rzidane@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
2 years agoapp/compress-perf: fix number of queue pairs to setup
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>
2 years agoapp/compress-perf: fix socket ID type during init
Raja Zidane [Wed, 2 Mar 2022 08:39:27 +0000 (10:39 +0200)]
app/compress-perf: fix socket ID type during init

Socket ID is obtained by function rte_compressdev_socket_id, which
returns it as integer, but is interpreted as unsigned byte integer.

change type from uint8_t to int.

Fixes: ed7dd94f7f66 ("compressdev: add basic device management")
Cc: stable@dpdk.org
Signed-off-by: Raja Zidane <rzidane@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
2 years agocompress/mlx5: support out-of-space status
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.

Fixes: f8c97babc9f4 ("compress/mlx5: add data-path functions")
Cc: stable@dpdk.org
Signed-off-by: Raja Zidane <rzidane@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
2 years agoapp/compress-perf: optimize operations pool allocation
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>
2 years agoapp/compress-perf: fix cycle count operations allocation
Raja Zidane [Wed, 23 Feb 2022 13:32:17 +0000 (15:32 +0200)]
app/compress-perf: fix cycle count operations allocation

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>
2 years agoevent/dlb2: add shift value check in sparse dequeue
Timothy McDaniel [Wed, 2 Mar 2022 15:12:08 +0000 (09:12 -0600)]
event/dlb2: add shift value check in sparse dequeue

Add a check to ensure that all shift counts are valid.
Shifting by more than 63 bits may result in undefined behavior, as
noted during coverity scan.

Coverity issue: 376527
Fixes: e697f35dbdd1 ("event/dlb2: update rolling mask used for dequeue")
Cc: stable@dpdk.org
Signed-off-by: Timothy McDaniel <timothy.mcdaniel@intel.com>
2 years agoevent/cnxk: fix Rx adapter config check
Pavan Nikhilesh [Tue, 1 Mar 2022 22:53:09 +0000 (04:23 +0530)]
event/cnxk: fix Rx adapter config check

The rx_queue_flags should be checked against
RTE_EVENT_ETH_RX_ADAPTER_QUEUE_FLOW_ID_VALID flag.

Fixes: cb4bfd6e7bdf ("event/cnxk: support Rx adapter")
Cc: stable@dpdk.org
Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
2 years agoevent/cnxk: fix sub-event clearing mask length
Pavan Nikhilesh [Tue, 1 Mar 2022 22:53:08 +0000 (04:23 +0530)]
event/cnxk: fix sub-event clearing mask length

Fix incorrect mask used when clearing subevent type masking out
useful data.

Fixes: e239e0d3faf7 ("event/cnxk: add SSO HW device operations")
Cc: stable@dpdk.org
Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
2 years agoci: remove redundant drivers enabling
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>
2 years agoci: remove outdated default versions for ABI check
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>
2 years agoversion: 22.03-rc2
Thomas Monjalon [Sun, 27 Feb 2022 20:52:48 +0000 (21:52 +0100)]
version: 22.03-rc2

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
2 years agoadd missing newline at EOF
Stephen Hemminger [Fri, 25 Feb 2022 17:47:03 +0000 (09:47 -0800)]
add missing newline at EOF

The text files did not end with newline.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
2 years agoremove extra blank line at EOF
Stephen Hemminger [Fri, 25 Feb 2022 17:47:02 +0000 (09:47 -0800)]
remove extra blank line at EOF

These source files all had unnecessary blank line at end of file.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
2 years agokni: fix freeing order in device release
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:

[   85.263717] ==========================================================
[   85.264418] BUG: KASAN: use-after-free in kni_net_release_fifo_phy+
0x30/0x84 [rte_kni]
[   85.265139] Read of size 8 at addr ffff000260668d60 by task kni/341
[   85.265703]
[   85.265857] CPU: 0 PID: 341 Comm: kni Tainted: G     U     O
5.15.0-rc4+ #1
[   85.266525] Hardware name: linux,dummy-virt (DT)
[   85.266968] Call trace:
[   85.267220]  dump_backtrace+0x0/0x2d0
[   85.267591]  show_stack+0x24/0x30
[   85.267924]  dump_stack_lvl+0x8c/0xb8
[   85.268294]  print_address_description.constprop.0+0x74/0x2b8
[   85.268855]  kasan_report+0x1e4/0x200
[   85.269224]  __asan_load8+0x98/0xd4
[   85.269577]  kni_net_release_fifo_phy+0x30/0x84 [rte_kni]
[   85.270116]  kni_dev_remove.isra.0+0x50/0x64 [rte_kni]
[   85.270630]  kni_ioctl_release+0x254/0x320 [rte_kni]
[   85.271136]  kni_ioctl+0x64/0xb0 [rte_kni]
[   85.271553]  __arm64_sys_ioctl+0xdc/0x120
[   85.271955]  invoke_syscall+0x68/0x1a0
[   85.272332]  el0_svc_common.constprop.0+0x90/0x200
[   85.272807]  do_el0_svc+0x94/0xa4
[   85.273144]  el0_svc+0x78/0x240
[   85.273463]  el0t_64_sync_handler+0x1a8/0x1b0
[   85.273895]  el0t_64_sync+0x1a0/0x1a4
[   85.274264]
[   85.274427] Allocated by task 341:
[   85.274767]  kasan_save_stack+0x2c/0x60
[   85.275157]  __kasan_kmalloc+0x90/0xb4
[   85.275533]  __kmalloc_node+0x230/0x594
[   85.275917]  kvmalloc_node+0x8c/0x190
[   85.276286]  alloc_netdev_mqs+0x70/0x6b0
[   85.276678]  kni_ioctl_create+0x224/0xf40 [rte_kni]
[   85.277166]  kni_ioctl+0x9c/0xb0 [rte_kni]
[   85.277581]  __arm64_sys_ioctl+0xdc/0x120
[   85.277980]  invoke_syscall+0x68/0x1a0
[   85.278357]  el0_svc_common.constprop.0+0x90/0x200
[   85.278830]  do_el0_svc+0x94/0xa4
[   85.279172]  el0_svc+0x78/0x240
[   85.279491]  el0t_64_sync_handler+0x1a8/0x1b0
[   85.279925]  el0t_64_sync+0x1a0/0x1a4
[   85.280292]
[   85.280454] Freed by task 341:
[   85.280763]  kasan_save_stack+0x2c/0x60
[   85.281147]  kasan_set_track+0x2c/0x40
[   85.281522]  kasan_set_free_info+0x2c/0x50
[   85.281930]  __kasan_slab_free+0xdc/0x140
[   85.282331]  slab_free_freelist_hook+0x90/0x250
[   85.282782]  kfree+0x128/0x580
[   85.283099]  kvfree+0x48/0x60
[   85.283402]  netdev_freemem+0x34/0x44
[   85.283770]  netdev_release+0x50/0x64
[   85.284138]  device_release+0xa0/0x120
[   85.284516]  kobject_put+0xf8/0x160
[   85.284867]  put_device+0x20/0x30
[   85.285204]  free_netdev+0x22c/0x310
[   85.285562]  kni_dev_remove.isra.0+0x48/0x64 [rte_kni]
[   85.286076]  kni_ioctl_release+0x254/0x320 [rte_kni]
[   85.286573]  kni_ioctl+0x64/0xb0 [rte_kni]
[   85.286992]  __arm64_sys_ioctl+0xdc/0x120
[   85.287392]  invoke_syscall+0x68/0x1a0
[   85.287769]  el0_svc_common.constprop.0+0x90/0x200
[   85.288243]  do_el0_svc+0x94/0xa4
[   85.288579]  el0_svc+0x78/0x240
[   85.288899]  el0t_64_sync_handler+0x1a8/0x1b0
[   85.289332]  el0t_64_sync+0x1a0/0x1a4
[   85.289699]
[   85.289862] The buggy address belongs to the object at ffff000260668000
[   85.289862]  which belongs to the cache kmalloc-cg-8k of size 8192
[   85.291079] The buggy address is located 3424 bytes inside of
[   85.291079]  8192-byte region [ffff000260668000ffff00026066a000)
[   85.292213] The buggy address belongs to the page:
[   85.292684] page:(____ptrval____) refcount:1 mapcount:0 mapping:
0000000000000000 index:0x0 pfn:0x2a0668
[   85.293585] head:(____ptrval____) order:3 compound_mapcount:0
compound_pincount:0
[   85.294305] flags: 0xbfff80000010200(slab|head|node=0|zone=2|
lastcpupid=0x7fff)
[   85.295020] raw: 0bfff80000010200 0000000000000000 dead000000000122
ffff0000c000d680
[   85.295767] raw: 0000000000000000 0000000080020002 00000001ffffffff
0000000000000000
[   85.296512] page dumped because: kasan: bad access detected
[   85.297054]
[   85.297217] Memory state around the buggy address:
[   85.297688]  ffff000260668c00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb
fb fb
[   85.298384]  ffff000260668c80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb
fb fb
[   85.299088] >ffff000260668d00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb
fb fb
[   85.299781]                                                        ^
[   85.300396]  ffff000260668d80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb
fb fb
[   85.301092]  ffff000260668e00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb
fb fb
[   85.301787] ===========================================================

Signed-off-by: Huisong Li <lihuisong@huawei.com>
Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
Acked-by: Ferruh Yigit <ferruh.yigit@intel.com>
2 years agobus/pci: assign driver pointer before mapping
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>
2 years agodevargs: fix crash with uninitialized parsing
Madhuker Mythri [Mon, 14 Feb 2022 17:08:11 +0000 (22:38 +0530)]
devargs: fix crash with uninitialized parsing

The function rte_devargs_parse() previously was safe to call with
non-initialized devargs structure as parameter.

When adding the support for the global device syntax,
this assumption was broken.
Restore it by forcing memset as part of the call itself.

Bugzilla ID: 933
Fixes: b344eb5d941a ("devargs: parse global device syntax")
Cc: stable@dpdk.org
Signed-off-by: Madhuker Mythri <madhuker.mythri@oracle.com>
Signed-off-by: Gaetan Rivet <grive@u256.net>
2 years agoeal/linux: fix illegal memory access in uevent handler
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>
2 years agodistributor: fix potential overflow
Bruce Richardson [Thu, 17 Feb 2022 15:02:39 +0000 (15:02 +0000)]
distributor: fix potential overflow

Coverity flags the fact that the tag values used in distributor are
32-bit, which means that when we use bit-manipulation to convert a tag
match/no-match to a bit in an array, we need to typecast to a 64-bit
type before shifting past 32 bits.

Coverity issue: 375808
Fixes: 08ccf3faa6a9 ("distributor: new packet distributor library")
Cc: stable@dpdk.org
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: David Hunt <david.hunt@intel.com>
2 years agoefd: fix uninitialized structure
Pablo de Lara [Fri, 25 Feb 2022 09:27:45 +0000 (09:27 +0000)]
efd: fix uninitialized structure

Coverity flags that both elements of efd_online_group_entry
are used uninitialized. This is OK because this structure
is initially used for starting values, so any value is OK.

Coverity ID: 375868
Fixes: 56b6ef874f80 ("efd: new Elastic Flow Distributor library")
Cc: stable@dpdk.org
Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Acked-by: Yipeng Wang <yipeng1.wang@intel.com>
2 years agotest/efd: fix sockets mask size
Pablo de Lara [Fri, 25 Feb 2022 09:27:44 +0000 (09:27 +0000)]
test/efd: fix sockets mask size

Constant value 1 has a size of 32 bits, and shifting it more than 32 bits
to the left overflows. 1ULL is needed to be able to get a 64-bit value.

Coverity ID: 375846
Fixes: 8751a7e9832b ("efd: allow more CPU sockets in table creation")
Cc: stable@dpdk.org
Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Acked-by: Yipeng Wang <yipeng1.wang@intel.com>
2 years agogpu/cuda: map GPU memory with GDRCopy
Elena Agostini [Fri, 25 Feb 2022 03:12:26 +0000 (03:12 +0000)]
gpu/cuda: map GPU memory with GDRCopy

To enable the gpudev rte_gpu_mem_cpu_map feature to expose
GPU memory to the CPU, the GPU CUDA driver library needs
the GDRCopy library and driver.

If DPDK is built without GDRCopy, the GPU CUDA driver returns
error if the is invoked rte_gpu_mem_cpu_map.

All the others GPU CUDA driver functionalities are not affected by
the absence of GDRCopy, thus this is an optional functionality
that can be enabled in the GPU CUDA driver.

CUDA driver documentation has been updated accordingly.

Signed-off-by: Elena Agostini <eagostini@nvidia.com>
2 years agodoc: add CUDA driver features
Elena Agostini [Fri, 25 Feb 2022 03:12:25 +0000 (03:12 +0000)]
doc: add CUDA driver features

The features list were missed when introducing the driver.

Fixes: 1306a73b1958 ("gpu/cuda: introduce CUDA driver")
Cc: stable@dpdk.org
Signed-off-by: Elena Agostini <eagostini@nvidia.com>
2 years agoraw/cnxk_gpio: stop device once tests are complete
Tomasz Duszynski [Fri, 25 Feb 2022 14:55:46 +0000 (15:55 +0100)]
raw/cnxk_gpio: stop device once tests are complete

Started device should eventually be stopped.

Fixes: 0e6557b448fa ("raw/cnxk_gpio: add self test")

Signed-off-by: Tomasz Duszynski <tduszynski@marvell.com>
Reviewed-by: Jerin Jacob <jerinj@marvell.com>
2 years agonet/mlx5: support queue/RSS actions for external Rx queue
Michael Baum [Thu, 24 Feb 2022 23:25:11 +0000 (01:25 +0200)]
net/mlx5: support queue/RSS actions for external Rx queue

Add support queue/RSS action for external Rx queue.
In indirection table creation, the queue index will be taken from
mapping array.

This feature supports neither LRO nor Hairpin.

Signed-off-by: Michael Baum <michaelba@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
2 years agonet/mlx5: add external Rx queue mapping API
Michael Baum [Thu, 24 Feb 2022 23:25:10 +0000 (01:25 +0200)]
net/mlx5: add external Rx queue mapping API

External queue is a queue that has been created and managed outside the
PMD. The queues owner might use PMD to generate flow rules using these
external queues.

When the queue is created in hardware it is given an ID represented by
32 bits. In contrast, the index of the queues in PMD is represented by
16 bits. To enable the use of PMD to generate flow rules, the queue
owner must provide a mapping between the HW index and a 16-bit index
corresponding to the ethdev API.

This patch adds an API enabling to insert/cancel a mapping between HW
queue id and ethdev queue id.

Signed-off-by: Michael Baum <michaelba@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
2 years agonet/mlx5: optimize queue type checks
Michael Baum [Thu, 24 Feb 2022 23:25:09 +0000 (01:25 +0200)]
net/mlx5: optimize queue type checks

The RxQ/TxQ control structure has a field named type. This type is enum
with values for standard and hairpin.
The use of this field is to check whether the queue is of the hairpin
type or standard.

This patch replaces it with a boolean variable that saves whether it is
a hairpin.

Signed-off-by: Michael Baum <michaelba@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
2 years agocommon/mlx5: support remote PD and CTX
Michael Baum [Thu, 24 Feb 2022 23:25:08 +0000 (01:25 +0200)]
common/mlx5: support remote PD and CTX

Add option to probe common device using import CTX/PD functions instead
of create functions.
This option requires accepting the context FD and the PD handle as
devargs.

This sharing can be useful for applications that use PMD for only some
operations. For example, an app that generates queues itself and uses
PMD just to configure flow rules.

Signed-off-by: Michael Baum <michaelba@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
2 years agocommon/mlx5: glue device and PD import
Michael Baum [Thu, 24 Feb 2022 23:25:07 +0000 (01:25 +0200)]
common/mlx5: glue device and PD import

Add support for rdma-core API to import device.
The API gets ibv_context file descriptor and returns an ibv_context
pointer that is associated with the given file descriptor.
Add also support for rdma-core API to import PD.
The API gets ibv_context and PD handle and returns a protection domain
(PD) that is associated with the given handle in the given context.

Signed-off-by: Michael Baum <michaelba@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
2 years agocommon/mlx5: consider local functions as internal
Michael Baum [Thu, 24 Feb 2022 23:25:06 +0000 (01:25 +0200)]
common/mlx5: consider local functions as internal

The functions which are not explicitly marked as internal
were exported because the local catch-all rule was missing in the
version script.
After adding the missing rule, all local functions are hidden.
The function mlx5_get_device_guid is used in another library,
so it needs to be exported (as internal).

Because the local functions were exported as non-internal
in DPDK 21.11, any change in these functions would break the ABI.
An ABI exception is added for this library, considering that all
functions are either local or internal.

Signed-off-by: Michael Baum <michaelba@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
2 years agonet/mlx5: support matching GRE optional fields
Sean Zhang [Fri, 25 Feb 2022 01:14:17 +0000 (03:14 +0200)]
net/mlx5: support matching GRE optional fields

This patch adds matching on the optional fields (checksum/key/sequence)
of GRE header. The matching on checksum and sequence fields requests
support from rdma-core with the capability of misc5 and tunnel_header 0-3.

For patterns without checksum and sequence specified, keep using misc for
matching as before, but for patterns with checksum or sequence, validate
capability first and then use misc5 for the matching.

Signed-off-by: Sean Zhang <xiazhang@nvidia.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
2 years agodoc: add GRE option flow item to feature list
Ferruh Yigit [Fri, 25 Feb 2022 18:27:59 +0000 (18:27 +0000)]
doc: add GRE option flow item to feature list

'gre_option' flow item was missing in the feature list, adding it.

Fixes: f61490bdf218 ("ethdev: support GRE optional fields")

Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Thomas Monjalon <thomas@monjalon.net>
2 years agoapp/testpmd: fix build without drivers
Thomas Monjalon [Fri, 25 Feb 2022 15:26:53 +0000 (16:26 +0100)]
app/testpmd: fix build without drivers

When ixgbe and bnxt are disabled, compilation was failing:

app/test-pmd/cmdline.c:9396:11: error:
variable 'vf_rxmode' set but not used

Fixes: 4cfe399f6550 ("net/bnxt: support to set VF rxmode")
Cc: stable@dpdk.org
Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
2 years agoapp/testpmd: fix raw encap of GENEVE option
Bing Zhao [Thu, 24 Feb 2022 07:02:14 +0000 (09:02 +0200)]
app/testpmd: fix raw encap of GENEVE option

The structure "rte_flow_item_geneve_opt" is not a protocol header of
geneve tunnel option from rfc8926. The field "data" is a pointer
which points to the actual variable-length option data. So the
structure is not packed.

There is 4 bytes hole before the pointer in a 64-bit system. The
option header is just 4 bytes. When using offsetof() to get the
fixed part's size of option header, the wrong value 8 was got. When
constructing the encap header, a wrong size and offset was used due
to this hole.

With this commit, the fixed part's size is calculated explicitly
based on all fields.

Fixes: 55c074f3ba1d ("app/testpmd: support GENEVE option item")
Cc: stable@dpdk.org
Signed-off-by: Bing Zhao <bingz@nvidia.com>
Reviewed-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
2 years agonet/i40e: fix unintentional integer overflow
Steve Yang [Fri, 25 Feb 2022 02:39:47 +0000 (02:39 +0000)]
net/i40e: fix unintentional integer overflow

Cast 1 to type uint64_t to avoid overflow.

CID 375812 (#1 of 1):
Unintentional integer overflow (OVERFLOW_BEFORE_WIDEN)
overflow_before_widen: Potentially overflowing expression 1 << 2 * i + 1
with type int (32 bits, signed) is evaluated using 32-bit arithmetic, and
then used in a context that expects an expression of type uint64_t
(64 bits, unsigned).

Coverity issue: 375812
Fixes: 5fec01c35c49 ("net/i40e: support Linux VF to configure IRQ link list")
Cc: stable@dpdk.org
Signed-off-by: Steve Yang <stevex.yang@intel.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2 years agonet/ice/base: support E824S and E825 devices
Robin Zhang [Fri, 25 Feb 2022 02:00:14 +0000 (02:00 +0000)]
net/ice/base: support E824S and E825 devices

Add support for E824S and E825 family devices.

This will be documented later in release notes since devices are not
mature yet to announce to users.

Signed-off-by: Robin Zhang <robinx.zhang@intel.com>
Acked-by: Ferruh Yigit <ferruh.yigit@intel.com>
2 years agocommon/cnxk: support CNF95xx B0 variant
Tomasz Duszynski [Thu, 24 Feb 2022 10:42:36 +0000 (11:42 +0100)]
common/cnxk: support CNF95xx B0 variant

Add CNF95xx B0 variant to the list of supported models.

Signed-off-by: Tomasz Duszynski <tduszynski@marvell.com>
Reviewed-by: Jerin Jacob <jerinj@marvell.com>
2 years agonet/cnxk: make inline inbound device usage as default
Vamsi Attunuru [Fri, 25 Feb 2022 06:54:45 +0000 (12:24 +0530)]
net/cnxk: make inline inbound device usage as default

Currently inline inbound device usage is not default for eventdev,
patch renames force_inl_dev dev arg to no_inl_dev and enables inline
inbound device by default.

Signed-off-by: Vamsi Attunuru <vattunuru@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
2 years agocommon/cnxk: check SQ node before setting BP config
Satha Rao [Fri, 25 Feb 2022 04:59:26 +0000 (23:59 -0500)]
common/cnxk: check SQ node before setting BP config

Validate sq_node and parent before accessing their fields.
SQ was created without any associated TM node, this is valid negative
case, so return success while stopping TM without SQ node.

Signed-off-by: Satha Rao <skoteshwar@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
2 years agonet/cnxk: enable packet marking callbacks
Satha Rao [Fri, 25 Feb 2022 04:59:25 +0000 (23:59 -0500)]
net/cnxk: enable packet marking callbacks

cnxk platform supports red/yellow packet marking based on TM
configuration. This patch set hooks to enable/disable packet
marking for VLAN DEI, IP DSCP and IP ECN. Marking enabled only
in scalar mode.

Signed-off-by: Satha Rao <skoteshwar@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
2 years agocommon/cnxk: enable packet marking
Satha Rao [Fri, 25 Feb 2022 04:59:24 +0000 (23:59 -0500)]
common/cnxk: enable packet marking

cnxk platforms supports packet marking when TM enabled with
valid shaper rates. VLAN DEI, IP ECN, or IP DSCP inside
packet will be updated based on mark flags selected.

Signed-off-by: Satha Rao <skoteshwar@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
2 years agonet/cnxk: support IP reassembly
Vidya Sagar Velumuri [Thu, 24 Feb 2022 18:29:01 +0000 (23:59 +0530)]
net/cnxk: support IP reassembly

Added capability and support for inline inbound IP reassembly
in cnxk driver. The IP reassembly offload is supported only
when the inline IPSec security offload is enabled.

In case of IP reassembly incomplete, the mbufs are attached
in the mbuf dynamic field and a dynamic flag is set accordingly.

Signed-off-by: Vidya Sagar Velumuri <vvelumuri@marvell.com>
Signed-off-by: Akhil Goyal <gakhil@marvell.com>
Signed-off-by: Nithin Dabilpuram <ndabilpuram@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
2 years agocommon/cnxk: configure reassembly parameters
Vidya Sagar Velumuri [Thu, 24 Feb 2022 18:29:00 +0000 (23:59 +0530)]
common/cnxk: configure reassembly parameters

When reassembly is enabled by application, set corresponding
flags in SA during creation.

Provide ROC API to configure reassembly unit with active and
zombie limits and step size.

Signed-off-by: Vidya Sagar Velumuri <vvelumuri@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
2 years agonet/cnxk: align prefetches to CN10K cache model
Pavan Nikhilesh [Thu, 24 Feb 2022 16:10:12 +0000 (21:40 +0530)]
net/cnxk: align prefetches to CN10K cache model

Align prefetches for CN10K cache model for vWQE in Rx and Tx.
Move mbuf->next NULL assignment to Tx path and enabled it only
when multi segments offload is enabled to reduce L1 pressure.
Add macros to detect corrupted mbuf->next values when
MEMPOOL_DEBUG is set.

Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
2 years agonet/cnxk: optimize Rx packet size extraction
Pavan Nikhilesh [Thu, 24 Feb 2022 16:10:11 +0000 (21:40 +0530)]
net/cnxk: optimize Rx packet size extraction

In vWQE mode, the mbuf address is calculated without using the
IOVA list.

Packet length can also be calculated by using NIX_PARSE_S by
which we can completely eliminate reading 2nd cache line
depending on the offloads enabled.

Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
2 years agonet/cnxk: support outbound soft expiry notification
Vamsi Attunuru [Thu, 24 Feb 2022 09:49:31 +0000 (15:19 +0530)]
net/cnxk: support outbound soft expiry notification

Add support for soft expiry notification mechanism in outbound
path by creating required number of ring buffers and a common poll
thread which polls for soft expiry events enqueued by microcode.

Signed-off-by: Vamsi Attunuru <vattunuru@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
2 years agocommon/cnxk: extend log on model mismatch
Tomasz Duszynski [Thu, 24 Feb 2022 10:34:22 +0000 (11:34 +0100)]
common/cnxk: extend log on model mismatch

Model is uniquely identified by 4 numbers. Print them all in case
model being populated is not on a list of known models. This makes
debugging a bit easier.

Signed-off-by: Tomasz Duszynski <tduszynski@marvell.com>
Reviewed-by: Jakub Palider <jpalider@marvell.com>
Reviewed-by: Jerin Jacob <jerinj@marvell.com>
2 years agonet/cnxk: remove unused files after template rework
Nithin Dabilpuram [Thu, 24 Feb 2022 10:13:45 +0000 (15:43 +0530)]
net/cnxk: remove unused files after template rework

Remove unused files that were left over after Rx and Tx template
function rework.

Fixes: 5169508a68fa ("net/cnxk: add cn9k template Rx functions to build")
Fixes: dd8c20eee472 ("net/cnxk: add cn9k template Tx functions to build")
Fixes: be294749a12a ("net/cnxk: add cn10k template Rx functions to build")
Cc: stable@dpdk.org
Signed-off-by: Nithin Dabilpuram <ndabilpuram@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
2 years agonet/cnxk: fix RSS RETA table update
Rakesh Kudurumalla [Thu, 24 Feb 2022 08:35:28 +0000 (14:05 +0530)]
net/cnxk: fix RSS RETA table update

RSS reta table is corrupted during rte_eth_dev_rss_reta_update().
Fix it by restoring previous table entries before updating.

Fixes: 00242a687de6 ("net/cnxk: support RETA and RSS hash")
Cc: stable@dpdk.org
Signed-off-by: Rakesh Kudurumalla <rkudurumalla@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
2 years agonet/mlx5: add header reformat HW steering action
Suanming Mou [Thu, 24 Feb 2022 13:40:51 +0000 (15:40 +0200)]
net/mlx5: add header reformat HW steering action

HW steering header reformat action can work under bulk mode. In
this case, when create the table, bulk size of header reformat
actions will be allocated in low level. Afterwards, when create
flow, just simply specify the action index in the bulk and the
encapsulation data to the action will be enough.

Signed-off-by: Suanming Mou <suanmingm@nvidia.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
2 years agonet/mlx5: add indirect HW steering action
Suanming Mou [Thu, 24 Feb 2022 13:40:50 +0000 (15:40 +0200)]
net/mlx5: add indirect HW steering action

HW steering can support indirect action as well. With indirect action,
the flow can be created with more flexible shared RSS action selection.
This will can save the action template with different RSS actions.

This commit adds the flow queue operation callback for:
rte_flow_async_action_handle_create();
rte_flow_async_action_handle_destroy();
rte_flow_async_action_handle_update();

Signed-off-by: Suanming Mou <suanmingm@nvidia.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
2 years agonet/mlx5: add HW mark action
Suanming Mou [Thu, 24 Feb 2022 13:40:49 +0000 (15:40 +0200)]
net/mlx5: add HW mark action

The mark action is covered by tag action internally. While it is added
the HW will add a tag to the packet. The mark value can be set as fixed
or dynamic as the action mask indicates.

Signed-off-by: Suanming Mou <suanmingm@nvidia.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
2 years agonet/mlx5: add queue and RSS HW steering action
Suanming Mou [Thu, 24 Feb 2022 13:40:48 +0000 (15:40 +0200)]
net/mlx5: add queue and RSS HW steering action

This commit adds the queue and RSS action. Similar to the jump action,
dynamic ones will be added to the action construct list.

Due to the queue and RSS action in template should not be destroyed
during port restart, the actions are created with standalone indirect
table as indirect action does. When port stops, detaches the indirect
table from action, when port starts, attaches the indirect table back
to the action.

One more change is made to accelerate the action creation. Currently
the mlx5_hrxq_get() function returns the object index instead of object
pointer. This introduced an extra converting the index to the object by
calling mlx5_ipool_get() in most of the case. And that extra converting
hurts multi-thread performance since mlx5_ipool_get() uses the global
lock inside. As the hash Rx queue object itself also contains the index,
returns the object directly will achieve better performance without the
global lock.

Signed-off-by: Suanming Mou <suanmingm@nvidia.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
2 years agonet/mlx5: add flow jump action
Suanming Mou [Thu, 24 Feb 2022 13:40:47 +0000 (15:40 +0200)]
net/mlx5: add flow jump action

Jump action connects different level of flow tables and allows packet
handling in the chain of flows.

A new action construct data struct is also added in this commit to help
to handle not only the dynamic jump action but also for the other
generic dynamic actions. The actions with empty mask configuration means
dynamic action, and the dedicated action will be created with the flow
action configuration during flow creation. In that dynamic action case,
the action will be appended to the table template's action list during
table creation.
When creating the flows, traverse the action list and pick the dynamic
action configuration details from flow actions as the action construct
data struct describes, then create the dedicated dynamic actions.

This commit adds the jump action and the generic dynamic action
construct mechanism.

Signed-off-by: Suanming Mou <suanmingm@nvidia.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
2 years agonet/mlx5: add flow flush
Suanming Mou [Thu, 24 Feb 2022 13:40:46 +0000 (15:40 +0200)]
net/mlx5: add flow flush

In case port is being stopped, all created flows should be flushed.
This commit adds the flow flush helper function.

Signed-off-by: Suanming Mou <suanmingm@nvidia.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
2 years agonet/mlx5: add basic flow queue operation
Suanming Mou [Thu, 24 Feb 2022 13:40:45 +0000 (15:40 +0200)]
net/mlx5: add basic flow queue operation

The HW steering uses async queue-based flow rules management
mechanism. The matcher and part of the actions have been
prepared during flow table creation. Some remaining actions
will be constructed during flow creation if needed.

A flow postpone attribute bit describes if flow management
should be applied to the HW directly. An extra push function
is provided to force push all the cached flows to the HW.

Once the flow has been applied to the HW, the pull function
will be called to get the queued creation/destruction flows.

The DR rule flow memory is represented in PMD layer instead
of allocating from HW steering layer. While destroying the
flow, the flow rule memory can only be freed after the CQE
received.

The HW queue job descriptor is currently introduced to convey
the flow information and operation type between the flow
insertion/destruction in the pull function.

This commit adds the basic flow queue operation for:
rte_flow_async_create();
rte_flow_async_destroy();
rte_flow_push();
rte_flow_pull();

Signed-off-by: Suanming Mou <suanmingm@nvidia.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
2 years agonet/mlx5: add table management
Suanming Mou [Thu, 24 Feb 2022 13:40:44 +0000 (15:40 +0200)]
net/mlx5: add table management

Flow table is a group of flows with the same matching criteria
and the same actions defined for them. The table defines rules
that have the same matching fields but with different matching
values. For example, matching on 5 tuple, the table will be
(IPv4 source + IPv4 dest + s_port + d_port + next_proto)
while the values for each rule will be different.

The templates' relevant matching criteria and action instances
will be created in the table creation and saved in the table.
As table attributes indicate the supported flow number, the flow
memory will also be allocated at the same time.

This commit adds the table management functions.

Signed-off-by: Suanming Mou <suanmingm@nvidia.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>