dpdk.git
2 years agomaintainers: update for KNI, UIO and pcap
Ferruh Yigit [Wed, 9 Mar 2022 11:25:29 +0000 (11:25 +0000)]
maintainers: update for KNI, UIO and pcap

Won't able to allocate time on these components, resigning from
maintaining them.

Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
2 years agoexamples/l3fwd: fix buffer overflow in Tx
Rahul Bhansali [Tue, 11 Jan 2022 12:50:05 +0000 (18:20 +0530)]
examples/l3fwd: fix buffer overflow in Tx

This patch fixes the stack buffer overflow error reported
from AddressSanitizer.
Function send_packetsx4() tries to access out of bound data
from rte_mbuf and fill it into TX buffer even in the case
where no pending packets (len = 0).
Performance impact:- No

ASAN error report:-
==819==ERROR: AddressSanitizer: stack-buffer-overflow on address
0xffffe2c0dcf0 at pc 0x0000005e791c bp 0xffffe2c0d7e0 sp 0xffffe2c0d800
READ of size 8 at 0xffffe2c0dcf0 thread T0
 #0 0x5e7918 in send_packetsx4 ../examples/l3fwd/l3fwd_common.h:251
 #1 0x5e7918 in send_packets_multi ../examples/l3fwd/l3fwd_neon.h:226

Fixes: 96ff445371e0 ("examples/l3fwd: reorganise and optimize LPM code path")
Cc: stable@dpdk.org
Signed-off-by: Rahul Bhansali <rbhansali@marvell.com>
Reviewed-by: Conor Walsh <conor.walsh@intel.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
2 years agoapp/testpmd: fix flow rule with flex input link
Gregory Etelson [Thu, 10 Mar 2022 05:59:53 +0000 (07:59 +0200)]
app/testpmd: fix flow rule with flex input link

Testpmd reads flex item configuration from a JSON file.
Flex item input link description is stored in testpmd
flow item format. For example, `eth type is 0x0800`.
The item description is placed into a general testpmd CLI
flow rule command template and parsed to convert string into
flow item object.

The patch adds the `actions` section to the flow rule template.

Fixes: 59f3a8acbcdb ("app/testpmd: add flex item commands")
Cc: stable@dpdk.org
Signed-off-by: Gregory Etelson <getelson@nvidia.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
2 years agoapp/testpmd: fix GTP header parsing in checksum engine
Gregory Etelson [Sun, 13 Mar 2022 09:01:23 +0000 (11:01 +0200)]
app/testpmd: fix GTP header parsing in checksum engine

GTP header can be followed by an optional 32 bits extension.
GTP notifies about the extension presence through the E, S or PN
header bits.

Csum GTP header parser did not check the extension bits value.

The patch updates GTP header length if at-least one of the
extension bits is set.

Fixes: d8e5e69f3a9b ("app/testpmd: add GTP parsing and Tx checksum offload")
Cc: stable@dpdk.org
Signed-off-by: Gregory Etelson <getelson@nvidia.com>
Acked-by: Aman Singh <aman.deep.singh@intel.com>
2 years agoapp/testpmd: fix show RSS RETA on Windows
Adham Masarwah [Sun, 13 Mar 2022 12:57:02 +0000 (14:57 +0200)]
app/testpmd: fix show RSS RETA on Windows

Replaced using strtoul with strtoull when converting to
64-bit mask field.
In Windows strtoul returns 32-bit values which cause an
issue with show RSS RETA.

Fixes: 66c594904ac ("ethdev: support multiple sizes of redirection table")
Cc: stable@dpdk.org
Signed-off-by: Adham Masarwah <adham@nvidia.com>
Acked-by: Aman Singh <aman.deep.singh@intel.com>
2 years agoapp/testpmd: fix L4 checksum in multi-segments
Kevin Liu [Wed, 29 Dec 2021 09:37:02 +0000 (09:37 +0000)]
app/testpmd: fix L4 checksum in multi-segments

Testpmd forwards packets in checksum mode that it needs to calculate
the checksum of each layer's protocol.

In process_inner_cksums, when parsing tunnel packets, inner L4 offset
should be outer_l2_len + outer_l3_len + l2_len + l3_len.

In process_outer_cksums, when parsing tunnel packets, outer L4 offset
should be outer_l2_len + outer_l3_len.

Fixes: e6b9d6411e91 ("app/testpmd: add SW L4 checksum in multi-segments")
Cc: stable@dpdk.org
Signed-off-by: Kevin Liu <kevinx.liu@intel.com>
Acked-by: Yuying Zhang <yuying.zhang@intel.com>
Acked-by: Aman Singh <aman.deep.singh@intel.com>
2 years agoapp/regex: fix number of matches
Gerry Gribbon [Wed, 9 Mar 2022 23:41:52 +0000 (23:41 +0000)]
app/regex: fix number of matches

Depending on number of jobs specified on command line, part of the
data buffer may not get searched, resulting in incorrect number of
matches being reported.

Additional change to ensure the "All Matches" summary outputs the
correct match start locations in the supplied data buffer.

Fixes: de06137cb295 ("app/regex: add RegEx test application")
Cc: stable@dpdk.org
Signed-off-by: Gerry Gribbon <ggribbon@nvidia.com>
Acked-by: Ori Kam <orika@nvidia.com>
2 years agobpf: fix build with some libpcap version on FreeBSD
David Marchand [Thu, 10 Mar 2022 18:30:40 +0000 (19:30 +0100)]
bpf: fix build with some libpcap version on FreeBSD

This is something caught in UNH FreeBSD env.

For some reason [1], the pcap/bpf.h header started to define _BPF_H_.

It happens that the bpf_impl.h internal DPDK header uses this define as
an internal guard.
This triggers a build failure in bpf_convert.c which can't find
RTE_BPF_LOG macro.

Fix the include guard to use the filename and remove _.

1: https://github.com/the-tcpdump-group/libpcap/pull/1074

Fixes: 94972f35a02e ("bpf: add BPF loading and execution framework")
Cc: stable@dpdk.org
Signed-off-by: David Marchand <david.marchand@redhat.com>
Acked-by: Stephen Hemminger <stephen@networkplumber.org>
2 years agocrypto/ipsec_mb: fix GCM requested digest length
Piotr Bronowski [Wed, 9 Mar 2022 18:02:00 +0000 (18:02 +0000)]
crypto/ipsec_mb: fix GCM requested digest length

This patch removes coverity defect CID 375828:
Untrusted value as argument (TAINTED_SCALAR)

Coverity issue: 375828
Fixes: ceb863938708 ("crypto/aesni_gcm: support all truncated digest sizes")
Cc: stable@dpdk.org
Signed-off-by: Piotr Bronowski <piotrx.bronowski@intel.com>
Acked-by: Ciara Power <ciara.power@intel.com>
2 years agocrypto/ipsec_mb: fix GMAC parameters setting
Pablo de Lara [Wed, 9 Mar 2022 10:45:14 +0000 (10:45 +0000)]
crypto/ipsec_mb: fix GMAC parameters setting

AES-GMAC requires plaintext length to be 0 when using AES-GCM,
so only AAD data is used.

Fixes: a501609ea646 ("crypto/ipsec_mb: fix length and offset settings")
Cc: stable@dpdk.org
Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Acked-by: Fan Zhang <roy.fan.zhang@intel.com>
Acked-by: Radu Nicolau <radu.nicolau@intel.com>
Tested-by: Radu Nicolau <radu.nicolau@intel.com>
2 years agonet/af_xdp: fix shared UMEM fill queue reserve
Ciara Loftus [Fri, 11 Mar 2022 13:45:13 +0000 (13:45 +0000)]
net/af_xdp: fix shared UMEM fill queue reserve

Commit 81fe6720f84f ("net/af_xdp: reserve fill queue before socket create")
moves the fill queue reserve logic to before the creation of the socket in
order to suppress kernel logs like:

XSK buffer pool does not provide enough addresses to fill 2047 buffers on
Rx ring 0

However, for queues that share umem, the fill queue reserve must occur
after the socket creation, because the fill queue is not valid until
that point.

This commit uses the umem refcnt value to determine whether the queue is
sharing a umem, and performs the fill queue reservation either before or
after the socket creation, depending on the refcnt value.

The kernel logs will still be seen for the shared umem queues.

Fixes: 81fe6720f84f ("net/af_xdp: reserve fill queue before socket create")

Signed-off-by: Ciara Loftus <ciara.loftus@intel.com>
2 years agonet/af_xdp: fix custom program loading with multiple queues
Junxiao Shi [Wed, 9 Mar 2022 21:18:43 +0000 (21:18 +0000)]
net/af_xdp: fix custom program loading with multiple queues

When the PMD is configured to load a custom XDP program, it sets
XSK_LIBBPF_FLAGS__INHIBIT_PROG_LOAD flag to prevent libbpf from
loading its default XDP program. However, when queue_count is set to
greater than 1, this flag is only set for the first XSK socket but not
for subsequent XSK sockets. This causes XSK socket creation failure.

This commit ensures that XSK_LIBBPF_FLAGS__INHIBIT_PROG_LOAD flag is
set for all XSK socket creations when custom XDP program is being used.

Fixes: 01fa83c94d7e ("net/af_xdp: workaround custom program loading")
Cc: stable@dpdk.org
Signed-off-by: Junxiao Shi <git@mail1.yoursunny.com>
2 years agonet/qede: fix maximum Rx packet length
Devendra Singh Rawat [Fri, 4 Mar 2022 12:08:33 +0000 (17:38 +0530)]
net/qede: fix maximum Rx packet length

Size of CRC is not added to max_rx_pktlen, due to this bigger sized
packets(size 1480, 1490 1500) are being dropped.
This fix adds RTE_ETHER_CRC_LEN to max_rx_pktlen.

Fixes: 1bb4a528c41f ("ethdev: fix max Rx packet length")
Cc: stable@dpdk.org
Signed-off-by: Devendra Singh Rawat <dsinghrawat@marvell.com>
Signed-off-by: Rasesh Mody <rmody@marvell.com>
2 years agonet/qede: fix Rx bulk
Devendra Singh Rawat [Fri, 4 Mar 2022 12:08:32 +0000 (17:38 +0530)]
net/qede: fix Rx bulk

qede_alloc_rx_bulk_mbufs() was trimming the number of requested
mbufs count to QEDE_MAX_BULK_ALLOC_COUNT.
The Rx callback was ignorant of this trimming and it was always
resetting the number of empty RX BD ring slots to 0.
This resulted in Rx BD ring getting into an inconsistent
state and ultimately the application fails to receive any traffic.

The fix trims the number of requested mbufs count before
making call to qede_alloc_rx_bulk_mbufs().
After qede_alloc_rx_bulk_mbufs() returns successfully, the
number of empty Rx BD ring slots are decremented by the
correct count.

Fixes: 8f2312474529 ("net/qede: fix performance bottleneck in Rx path")
Cc: stable@dpdk.org
Signed-off-by: Devendra Singh Rawat <dsinghrawat@marvell.com>
Signed-off-by: Rasesh Mody <rmody@marvell.com>
2 years agonet/qede: fix Tx completion
Devendra Singh Rawat [Fri, 4 Mar 2022 12:08:31 +0000 (17:38 +0530)]
net/qede: fix Tx completion

Tx completion routine was first incrementing the number of free
slots in Tx ring and then freeing corresponding mbufs in bulk.
In some situations, the number of mbufs freed were less than
number of Tx ring slots freed. This caused Tx ring to get into an
inconsistent state and ultimately application fails to transmit
further traffic.

The fix first updates the Tx ring SW consumer index, then
increments Tx ring free slot number and finally frees the mbuf,
this is done in a single iteration of loop.

Fixes: 2c41740bf19e ("net/qede: get consumer index once")
Fixes: 4996b959cde6 ("net/qede: free packets in bulk")
Cc: stable@dpdk.org
Signed-off-by: Devendra Singh Rawat <dsinghrawat@marvell.com>
Signed-off-by: Rasesh Mody <rmody@marvell.com>
2 years agodoc: mention mlx5 MPRQ incompatibility with external buffers
Alexander Kozyrev [Thu, 10 Mar 2022 05:06:36 +0000 (07:06 +0200)]
doc: mention mlx5 MPRQ incompatibility with external buffers

Multi-Packet Rx queue uses PMD-managed buffers to store packets.
These buffers are externally attached to user mbufs.
This conflicts with the feature that allows using user-managed
externally attached buffers in an application.
Add the corresponding limitation to MLX5 documentation that MPRQ
and external data buffers cannot be used together.

Signed-off-by: Alexander Kozyrev <akozyrev@nvidia.com>
2 years agodoc: fix modify field action description for mlx5
Viacheslav Ovsiienko [Thu, 24 Feb 2022 16:01:36 +0000 (18:01 +0200)]
doc: fix modify field action description for mlx5

This patch adds mlx5 specifics description about
handling the Ethernet type by modify field action
for VLAN-ed traffic.

Fixes: 641dbe4fb053 ("net/mlx5: support modify field flow action")
Cc: stable@dpdk.org
Signed-off-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
2 years agonet/mlx5: fix implicit tag insertion with sample action
Jiawei Wang [Thu, 10 Mar 2022 04:00:10 +0000 (06:00 +0200)]
net/mlx5: fix implicit tag insertion with sample action

A flow rule with sample action was split into two sub-flows,
and the implicit tag action with unique id was added in the prefix
sub-flow, the suffix sub-flow used the tag item to match with that
unique id, and the implicit set tag action was inserted next to
the sample action.

While there's either PUSH VLAN action or ENCAP action preceding the
sample action, implicit set tag action was added after PUSH VLAN or
ENCAP actions, causing flow creation failure due to rdma-core
does not support this action order.

This patch ensures the implicit set tag action is inserted before
either PUSH VLAN or encap action (if any) in the prefix sub-flow.

Fixes: 6a951567c159 ("net/mlx5: support E-Switch mirroring and jump in one flow")
Cc: stable@dpdk.org
Signed-off-by: Jiawei Wang <jiaweiw@nvidia.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
2 years agonet/mlx5: forbid multiple ASO actions in a single rule
Rongwei Liu [Wed, 9 Mar 2022 12:08:29 +0000 (14:08 +0200)]
net/mlx5: forbid multiple ASO actions in a single rule

For now, only one ASO action is supported in a single flow rule.
Flow rule with more than one ASO action should be rejected in the
validation stage.

Flow rule with action non-shared AGE and COUNT together should be
treated as non-ASO because AGE will fall back to use HW counter,
not ASO hit object.

Group 0 will use HW counter for AGE action even if no COUNT action.

This commit will reject patterns (no matter which group if transfer)
like:
1. group 1 pattern... / end actions age / meter / end
2. group 1 pattern... / end actions conntrack / meter / end
3. group 1 pattern... / end actions age / conntrack... / end

If AGE comes together with COUNT in the above patterns, it's allowed.

Fixes: daed4b6e ("net/mlx5: use aging by counter when counter exists")
Cc: stable@dpdk.org
Signed-off-by: Rongwei Liu <rongweil@nvidia.com>
Acked-by: Xiaoyu Min <jackmin@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
2 years agonet/mlx5: fix sample flow action on trusted device
Jiawei Wang [Wed, 9 Mar 2022 10:19:46 +0000 (12:19 +0200)]
net/mlx5: fix sample flow action on trusted device

A flow rule with sample action will be split into two sub flows,
and a tag action was added implicitly in the sample prefix sub flow,
the reserved metadata regC index was used for this tag action.

The reserved metadata regC was shared with metering action,
for ConnectX-5 trusted device (VF/SF), the reserved metadata regC was
invalid since PF only supported the legacy metering.

This patch adds the checking for the tag index and back to use the
application tag if a failure happened.

Fixes: a9b6ea45bed6 ("net/mlx5: fix tag ID conflict with sample action")
Cc: stable@dpdk.org
Signed-off-by: Jiawei Wang <jiaweiw@nvidia.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
2 years agonet/mlx5: fix VLAN push action validation
Dariusz Sosnowski [Wed, 9 Mar 2022 09:39:20 +0000 (09:39 +0000)]
net/mlx5: fix VLAN push action validation

Flow domain and direction was validated when OF_PUSH_VLAN action
appears in flow actions. Flow was rejected whenever this action:

- was used in NIC domain, in ingress direction;
- was used in FDB domain, in ingress direction, on ConnectX-5.

This validation logic rejected a valid case when the OF_PUSH_VLAN
action was used when directing traffic to the hairpin queue,
configured in TX implicit mode.

This patch moves code responsible for OF_PUSH_VLAN validation of
domain and direction from flow_dv_validate_push_vlan() to
flow_dv_validate(). Domain and direction are now validated when either
non-hairpin queue is used or hairpin queue is configured in Tx explicit
mode.

Fixes: 96f85ec489db ("net/mlx5: check VLAN push/pop support")
Cc: stable@dpdk.org
Signed-off-by: Dariusz Sosnowski <dsosnowski@nvidia.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
2 years agonet/i40e: fix build with 16B descriptor on Arm
Joyce Kong [Fri, 4 Mar 2022 07:35:17 +0000 (07:35 +0000)]
net/i40e: fix build with 16B descriptor on Arm

For NEON vector path, there is an issue when building
with 16B descriptor:
incompatible types when assigning to type ‘uint64x2_t’
from type ‘uint32x4_t’
180 |  descs[3] = vbslq_u32(v_desc3_mask, v_zeros,
vreinterpretq_u32_u64(descs[3]));
    |             ^~~~~~~~~

The fix is to add interpretation between type 'uint64x2_t'
and type 'uint32x4_t'.

Fixes: dba9e3bcd9bb ("net/i40e: add flow mark capability to NEON Rx")

Signed-off-by: Joyce Kong <joyce.kong@arm.com>
Reviewed-by: Ruifeng Wang <ruifeng.wang@arm.com>
Reviewed-by: Qi Zhang <qi.z.zhang@intel.com>
2 years agogpu/cuda: mark unused GDRCopy functions parameters
Elena Agostini [Thu, 10 Mar 2022 00:06:50 +0000 (00:06 +0000)]
gpu/cuda: mark unused GDRCopy functions parameters

Without enabling gdrcopy, DPDK build has warnings about
unused gdrcopy functions input parameters.

This patch set them to __rte_unused .

Fixes: 24c7759 ("gpu/cuda: map GPU memory with GDRCopy")

Signed-off-by: Elena Agostini <eagostini@nvidia.com>
2 years agovhost: fix FD leak with inflight messages
David Marchand [Tue, 18 Jan 2022 14:53:30 +0000 (15:53 +0100)]
vhost: fix FD leak with inflight messages

Even if unlikely, a buggy vhost-user master might attach fds to inflight
messages. Add checks like for other types of vhost-user messages.

Fixes: d87f1a1cb7b6 ("vhost: support inflight info sharing")
Cc: stable@dpdk.org
Signed-off-by: David Marchand <david.marchand@redhat.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
2 years agovhost: fix queue number check when setting inflight FD
Chenbo Xia [Mon, 14 Feb 2022 08:32:37 +0000 (16:32 +0800)]
vhost: fix queue number check when setting inflight FD

In function vhost_user_set_inflight_fd, queue number in inflight
message is used to access virtqueue. However, queue number could
be larger than VHOST_MAX_VRING and cause write OOB as this number
will be used to write inflight info in virtqueue structure. This
patch checks the queue number to avoid the issue and also make
sure virtqueues are allocated before setting inflight information.

Fixes: ad0a4ae491fe ("vhost: checkout resubmit inflight information")
Cc: stable@dpdk.org
Reported-by: Wenxiang Qian <leonwxqian@gmail.com>
Signed-off-by: Chenbo Xia <chenbo.xia@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
2 years agoversion: 22.03-rc3
Thomas Monjalon [Tue, 8 Mar 2022 23:34:09 +0000 (00:34 +0100)]
version: 22.03-rc3

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
2 years agomaintainers: update for timer library
Robert Sanford [Tue, 21 Dec 2021 19:57:28 +0000 (14:57 -0500)]
maintainers: update for timer library

Remove self from Timers maintainers.

Signed-off-by: Robert Sanford <rsanford@akamai.com>
2 years agomaintainers: update for FIPS validation
Brian Dooley [Mon, 7 Mar 2022 15:13:47 +0000 (15:13 +0000)]
maintainers: update for FIPS validation

Replace Marko Kovacevic with Brian Dooley and Fan Zhang.

Signed-off-by: Brian Dooley <brian.dooley@intel.com>
Acked-by: Fan Zhang <roy.fan.zhang@intel.com>
2 years agomaintainers: update for testpmd BPF files
Yuying Zhang [Thu, 10 Feb 2022 15:03:38 +0000 (15:03 +0000)]
maintainers: update for testpmd BPF files

Move 'test-pmd/bpf_cmd.*' files under BPF component.

Signed-off-by: Yuying Zhang <yuying.zhang@intel.com>
Acked-by: Ferruh Yigit <ferruh.yigit@intel.com>
2 years agomaintainers: update for testpmd TM and MTR
Yuying Zhang [Thu, 10 Feb 2022 14:51:29 +0000 (14:51 +0000)]
maintainers: update for testpmd TM and MTR

Move 'test-pmd/cmdline_tm.*' files under
"Traffic Management API" component.
Move 'test-pmd/cmdline_mtr.*' files under
"Traffic Metering and Policing API" component.

Signed-off-by: Yuying Zhang <yuying.zhang@intel.com>
Acked-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
2 years agogpudev: fix page alignment in communication list
Elena Agostini [Tue, 8 Mar 2022 23:59:47 +0000 (23:59 +0000)]
gpudev: fix page alignment in communication list

Memory allocated for CPU mapping the status flag
in the communication list should be aligned to the
GPU page size, which can be different of CPU page alignment.

The GPU page size is added to the GPU info,
and is used when creating a communication list.

Fixes: 9b8cae4d991e ("gpudev: use CPU mapping in communication list")

Signed-off-by: Elena Agostini <eagostini@nvidia.com>
2 years agonet/iavf: fix potential out-of-bounds access
Leyi Rong [Tue, 8 Mar 2022 05:56:17 +0000 (13:56 +0800)]
net/iavf: fix potential out-of-bounds access

Fix potential out-of-bounds access as overrunning callee's array of
size 26 by passing argument rxq->rxdid(which evaluates to 63) in call
to iavf_rx_scan_hw_ring_flex_rxd.

Coverity issue: 376616
Fixes: 0ed16e01313e ("net/iavf: fix function pointer in multi-process")
Cc: stable@dpdk.org
Signed-off-by: Leyi Rong <leyi.rong@intel.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2 years agonet/sfc: reduce log level of tunnel restore info error
Ivan Malov [Sun, 6 Mar 2022 16:12:06 +0000 (19:12 +0300)]
net/sfc: reduce log level of tunnel restore info error

OvS might invoke this API on its data path, out of sync
with its control plane. If the control path has already
deactivated the tunnel context entry, these invocations
will produce quite a few error printouts. Suppress that.

Fixes: 7e5b479803c3 ("net/sfc: implement control path operations in tunnel offload")
Cc: stable@dpdk.org
Signed-off-by: Ivan Malov <ivan.malov@oktetlabs.ru>
Reviewed-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
2 years agonet/mlx5: fix meter creation default state
Rongwei Liu [Mon, 7 Mar 2022 08:00:35 +0000 (10:00 +0200)]
net/mlx5: fix meter creation default state

Disable means there is no packet drop in the meter. Meter is
active always but programmed with another CIR/CBS value.

If the user wants to disable the meter in creation, PMD calls
the disable() API manually after meter initialized.

Fixes: 444320186393 ("net/mlx5: support meter creation with policy")
Cc: stable@dpdk.org
Signed-off-by: Rongwei Liu <rongweil@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
2 years agonet/mlx5: fix configuration without Rx queue
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>
2 years agonet/mlx5: fix E-Switch DV flow disabling
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.

Fixes: a13ec19c1993 ("net/mlx5: add shared device context config structure")

Signed-off-by: Michael Baum <michaelba@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
2 years agonet/mlx5: fix MPLS/GRE Verbs spec ordering
Dariusz Sosnowski [Wed, 2 Mar 2022 17:06:59 +0000 (17:06 +0000)]
net/mlx5: fix MPLS/GRE Verbs spec ordering

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>
2 years agodoc: add steps to configure mlx5 VF as trusted
Asaf Penso [Mon, 28 Feb 2022 08:11:17 +0000 (10:11 +0200)]
doc: add steps to configure mlx5 VF as trusted

Trusted VF is needed to offload rules with rte_flow to a group
that is bigger than 0.
The configuration is done in two parts: driver and FW.

This patch adds the needed steps to configure a VF to be trusted.

Signed-off-by: Asaf Penso <asafp@nvidia.com>
Reviewed-by: Raslan Darawsheh <rasland@nvidia.com>
2 years agonet/mlx5: fix flex item availability
Gregory Etelson [Wed, 2 Mar 2022 11:06:42 +0000 (13:06 +0200)]
net/mlx5: fix flex item availability

Flex item availability is restricted to BlueField-2 and BlueField-3
PF ports.

The patch validates port type compliance before proceeding to
flex item creation.

Fixes: db25cadc0887 ("net/mlx5: add flex item operations")
Cc: stable@dpdk.org
Signed-off-by: Gregory Etelson <getelson@nvidia.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
2 years agonet/mlx5: fix meter policy creation assert
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>
2 years agonet/mlx5: remove unused reference counter
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.

Fixes: afd7a62514ad ("net/mlx5: make flow table cache thread safe")
Cc: stable@dpdk.org
Signed-off-by: Bing Zhao <bingz@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
2 years agonet/mlx5: fix modify port action validation
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.

Fixes: 72a944dba163 ("net/mlx5: fix header modify action validation")
Cc: stable@dpdk.org
Signed-off-by: Dmitry Kozlyuk <dkozlyuk@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
2 years agonet/mlx5: fix external Rx queue referencing
Michael Baum [Wed, 2 Mar 2022 07:58:23 +0000 (09:58 +0200)]
net/mlx5: fix external Rx queue referencing

When an indirection table object is modified, it updates the reference
counter for each RX queue related to it.

The reference counter for regular queues are indeed updated. However,
the reference counter for external RxQs are not.

This patch adds updating for external RxQs too.

Fixes: 311b17e669ab ("net/mlx5: support queue/RSS actions for external Rx queue")

Signed-off-by: Michael Baum <michaelba@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
2 years agonet/mlx5: fix external Rx queue dereferencing
Michael Baum [Wed, 2 Mar 2022 07:58:22 +0000 (09:58 +0200)]
net/mlx5: fix external Rx queue dereferencing

When an indirection table is destroyed, each Rx queue related to it,
should be dereferenced.

The regular queues are indeed dereferenced.
However, the external RxQs are not.

This patch adds dereferencing for external RxQs too.

Fixes: 311b17e669ab ("net/mlx5: support queue/RSS actions for external Rx queue")

Signed-off-by: Michael Baum <michaelba@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
2 years agonet/mlx5: fix NIC egress flow mismatch in switchdev mode
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>
2 years agonet/mlx5: fix shared RSS destroy
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>
2 years agonet/mlx5: fix next protocol RSS expansion
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>
2 years agonet/mlx5: fix inet IPIP protocol type
Gregory Etelson [Tue, 1 Mar 2022 15:18:56 +0000 (17:18 +0200)]
net/mlx5: fix inet IPIP protocol type

Fix typo in INET IPIP protocol macro.

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>
2 years agonet/bnxt: fix null dereference in session cleanup
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>
2 years agodevtools: fix symbols check
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>
2 years agoethdev: fix doxygen comments for device info struct
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>
2 years agobuild: fix build on FreeBSD with Meson 0.61.1
Karl Bonde Torp [Mon, 14 Feb 2022 11:43:13 +0000 (12:43 +0100)]
build: fix build on FreeBSD with Meson 0.61.1

When building with Meson 0.61.1 on FreeBSD some archives become
corrupted. This can be avoided by using 'llvm-ar' instead of 'ar'.

Cc: stable@dpdk.org
Signed-off-by: Karl Bonde Torp <k.torp@samsung.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
2 years agovhost: fix external message handlers
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>
2 years agobuild: hide local symbols in shared libraries
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>
2 years agoregexdev: fix section attribute of symbols
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>
2 years agodevtools: use libabigail rule for mlx glue drivers
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>
2 years agodevtools: remove event/dlb exception in ABI check
David Marchand [Tue, 1 Mar 2022 16:54:03 +0000 (17:54 +0100)]
devtools: remove event/dlb exception in ABI check

The event/dlb driver exception can be removed, as this rule made sense
for changes in DPDK_21 ABI and is obsolete for DPDK_22.

Fixes: fdab8f2e1749 ("version: 21.11-rc0")
Cc: stable@dpdk.org
Signed-off-by: David Marchand <david.marchand@redhat.com>
Acked-by: Ray Kinsella <mdr@ashroe.eu>
2 years agodevtools/cocci: update script for ethdev namespace
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>
2 years agoexamples/kni: add missing trailing newline in log
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>
2 years agoexamples/multi_process: make RSS and checksum optional
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>
2 years agoexamples/flow_classify: fix failure message
Chuanshe Zhang [Tue, 18 Jan 2022 02:49:34 +0000 (10:49 +0800)]
examples/flow_classify: fix failure message

Fixes: bab16ddaf2c1 ("examples/flow_classify: add sample application")
Cc: stable@dpdk.org
Signed-off-by: Chuanshe Zhang <zhangchuanshe@icloudshield.com>
Acked-by: Bernard Iremonger <bernard.iremonger@intel.com>
2 years agoexamples/distributor: reduce Tx queue number to 1
Honnappa Nagarahalli [Mon, 7 Mar 2022 22:39:46 +0000 (22:39 +0000)]
examples/distributor: reduce Tx queue number to 1

Distributor application creates one Tx queue per core. However
the transmit is done only from a single core. Hence creating
one Tx queue is enough.

Fixes: 07db4a975094 ("examples/distributor: new sample app")
Cc: stable@dpdk.org
Signed-off-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
Reviewed-by: Ruifeng Wang <ruifeng.wang@arm.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
2 years agoexamples/l3fwd: make Rx and Tx queue size configurable
Honnappa Nagarahalli [Wed, 23 Feb 2022 06:09:31 +0000 (00:09 -0600)]
examples/l3fwd: make Rx and Tx queue size configurable

Make Rx and Tx queue sizes configurable from the command line.
This helps DTS write better test cases.

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>
2 years agoexamples/l3fwd: share queue size variables
Honnappa Nagarahalli [Wed, 23 Feb 2022 06:09:30 +0000 (00:09 -0600)]
examples/l3fwd: share queue size variables

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>
2 years agoexamples/l3fwd: support config file for EM
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>
2 years agoexamples/l3fwd: support config file for LPM/FIB
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>
2 years agoapp/dumpcap: allow help/version without primary process
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.

Signed-off-by: Ben Magistro <koncept1@gmail.com>
2 years agoapp/dumpcap: check for failure to set promiscuous
Stephen Hemminger [Thu, 10 Feb 2022 23:09:06 +0000 (15:09 -0800)]
app/dumpcap: check for failure to set promiscuous

If the rte_eth_promiscuous_enable() fails, then log the error
and continue.

Coverity issue: 373662
Fixes: cbb44143be74 ("app/dumpcap: add new packet capture application")
Cc: stable@dpdk.org
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
2 years agotest/bpf: skip dump if conversion fails
Stephen Hemminger [Thu, 10 Feb 2022 23:09:05 +0000 (15:09 -0800)]
test/bpf: skip dump if conversion fails

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>
2 years agopcapng: handle failure of link status query
Stephen Hemminger [Thu, 10 Feb 2022 23:09:04 +0000 (15:09 -0800)]
pcapng: handle failure of link status query

If rte_ethlink_get fails, the code can just not add speed
to the pcap file.

Coverity issue: 373664
Fixes: 8d23ce8f5ee9 ("pcapng: add new library for writing pcapng files")
Cc: stable@dpdk.org
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
2 years agoapp/pdump: free mempool at resources cleanup
Tianli Lai [Fri, 25 Feb 2022 01:00:37 +0000 (09:00 +0800)]
app/pdump: free mempool at resources cleanup

The mempool should be free when cleanup resources.

Signed-off-by: Tianli Lai <laitianli@tom.com>
Acked-by: Stephen Hemminger <stephen@networkplumber.org>
2 years agoapp/pdump: abort on multi-core capture limit
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>
2 years agoraw/ifpga: fix monitor thread
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.

Fixes: 9c006c45 ("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 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>