nb_rxd and nb_txd are used in polling mode and event mode of
operation. nb_rxd and nb_txd are already global in polling mode
but are not visible to event mode code. Make them visible to all
parts of the application.
Signed-off-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com> Reviewed-by: Kathleen Capella <kathleen.capella@arm.com> Reviewed-by: Ruifeng Wang <ruifeng.wang@arm.com> Acked-by: Bruce Richardson <bruce.richardson@intel.com> Tested-by: Yingya Han < yingyax.han@intel.com>
Sean Morrissey [Tue, 1 Mar 2022 14:49:08 +0000 (14:49 +0000)]
examples/l3fwd: support config file for EM
Add support to define ipv4 and ipv6 forwarding tables
from reading from a config file for EM with a format
similar to l3fwd-acl one.
Users can now use the default hardcoded route tables
or optionally config files for 'l3fwd_em'. Default
config files have been provided for use with EM.
Related l3fwd docs have been updated to reflect these
changes.
Signed-off-by: Sean Morrissey <sean.morrissey@intel.com> Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
Sean Morrissey [Tue, 1 Mar 2022 14:49:07 +0000 (14:49 +0000)]
examples/l3fwd: support config file for LPM/FIB
Add support to define ipv4 and ipv6 forwarding tables
from reading from a config file for LPM and FIB,
with format similar to l3fwd-acl one.
Users can now use the default hardcoded route tables
or optionally config files. Default config files have
been provided for use with LPM and FIB.
Signed-off-by: Sean Morrissey <sean.morrissey@intel.com> Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com> Tested-by: Yingya Han <yingyax.han@intel.com>
Ben Magistro [Tue, 25 Jan 2022 03:25:45 +0000 (03:25 +0000)]
app/dumpcap: allow help/version without primary process
Currently dumpcap tries to initialize dpdk before parsing command line
arguments, this makes it impossible to check version or help without
having the primary process running already.
If conversion of cBPF to eBPF fails (in rte_bpf_convert)
then the test should not try and print the result.
Coverity issue: 373661 Fixes: 2eccf6afbea9 ("bpf: add function to convert classic BPF to DPDK BPF") Cc: stable@dpdk.org Signed-off-by: Stephen Hemminger <stephen@networkplumber.org> Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
Reshma Pattan [Mon, 28 Feb 2022 09:58:56 +0000 (09:58 +0000)]
app/pdump: abort on multi-core capture limit
Check lcore id value is not the maximum core supported.
Using lcore id without this check might cause
out of bound access inside the rte_eal_wait_lcore.
Coverity issue: 375841 Fixes: b2854d5317e8 ("app/pdump: support multi-core capture") Cc: stable@dpdk.org Signed-off-by: Reshma Pattan <reshma.pattan@intel.com> Acked-by: Stephen Hemminger <stephen@networkplumber.org>
Wei Huang [Tue, 1 Mar 2022 08:47:03 +0000 (03:47 -0500)]
raw/ifpga: fix monitor thread
Monitor thread handles graceful shutdown according to the value of
specific sensors in device, two issues are found below.
1. Thread is not created when card is probed.
2. Thread is canceled without checking presence of other cards.
To fix them, thread is created in pci device probe function, a reference
count is checked before canceling the thread.
Haiyue Wang [Mon, 7 Mar 2022 10:25:56 +0000 (18:25 +0800)]
graph: remove useless duplicate name check
The node clone API parameter 'name' is the new node's postfix name, not
the final node name, so it makes no sense to check it. And the new name
will be checked duplicate when calling API '__rte_node_register'.
And update the test case to call clone API twice to check the real name
duplicate.
Signed-off-by: Haiyue Wang <haiyue.wang@intel.com> Acked-by: Jerin Jacob <jerinj@marvell.com>
Weiguo Li [Tue, 1 Mar 2022 20:32:57 +0000 (04:32 +0800)]
sched: remove useless malloc in PIE data init
'rte_pie_rt_data_init(NULL)' is not expected, and it's ought to
fail when this happen. The malloc inside the function didn't work.
So remove the malloc otherwise will lead to a memory leak.
Fixes: 44c730b0e37971 ("sched: add PIE based congestion management") Cc: stable@dpdk.org Signed-off-by: Weiguo Li <liwg06@foxmail.com> Acked-by: Stephen Hemminger <stephen@networkplumber.org> Acked-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
Wenxuan Wu [Fri, 11 Feb 2022 08:41:31 +0000 (08:41 +0000)]
eal/linux: fix device monitor stop return
The ret value in rte_dev_event_monitor_stop stands for whether the
monitor has been successfully closed, and should not bind with
rte_intr_callback_unregister, so once it goes to the right exit point of
rte_dev_event_monitor, the ret value should be set to 0.
Also, the refmonitor count has been carefully evaluated, the value
change from 1 to 0, so there is no potential memory leak failure.
David Marchand [Tue, 1 Mar 2022 10:53:54 +0000 (11:53 +0100)]
bus/pci: enhance driver pointer documentation
Setting driver pointer before mapping required for write combining
support since commit 4a928ef9f611 ("bus/pci: enable write combining
during mapping").
Move comments that got separated after different changes.
Also change the condition relying on dev->driver itself.
Signed-off-by: David Marchand <david.marchand@redhat.com>
Wenwu Ma [Fri, 4 Mar 2022 16:24:24 +0000 (16:24 +0000)]
examples/vhost: fix launch with physical port
dpdk-vhost will fail to launch with a 40G i40e port because
there are not enough mbufs. This patch adds a new option
--total-num-mbufs, through which the user can set larger
mbuf pool to avoid this problem.
Peng Yu [Tue, 15 Feb 2022 05:55:52 +0000 (05:55 +0000)]
vhost: fix linker script syntax
The punctuation after the `global` keyword should be colon, not
semicolon. The default gcc linker accepts both colon and semicolon, but
the gold linker will report syntax error if we use semicolon after the
`global` keyword.
Fixes: 94c16e89d779 ("vhost: mark vDPA driver API as internal") Cc: stable@dpdk.org Signed-off-by: Peng Yu <penyu@amazon.com> Reviewed-by: Chenbo Xia <chenbo.xia@intel.com>
Vamsi Attunuru [Wed, 2 Mar 2022 13:46:54 +0000 (19:16 +0530)]
common/cnxk: fix build with custom maximum port config
Build fails with custom max eth ports configuration, like
-Dmax_ethports=1024.
Build error is:
../drivers/common/cnxk/roc_nix_inl_dev.c:794:2:
note: in expansion of macro ‘PLT_STATIC_ASSERT’
| PLT_STATIC_ASSERT(sizeof(struct nix_inl_dev) <= ROC_NIX_INL_MEM_SZ);
| ^~~~~~~~~~~~~~~~~
Earlier soft expiry ring struct member was an array of pointers and it's
size is linked to number of RTE_MAX_ETHPORTS, and the whole struct size
is confined and protected by size assertion.
It resulted in build failure with -Dmax_ethports=1024 option and
assertion caught that failure.
Use dynamically allocated memory for storing soft expiry ring base
addresses which fixes the struct size against custom RTE_MAX_ETHPORTS
values and solves the static assertion failure.
Kevin Liu [Wed, 29 Dec 2021 09:37:01 +0000 (09:37 +0000)]
net/ice: fix Tx offload path choice
Testpmd forwards packets in checksum mode that it needs to calculate
the checksum of each layer's protocol.
When setting the hardware calculates the outer UDP checksum and the
software calculates the outer IP checksum, the dev->tx_pkt_burst in
ice_set_tx_function is set to ice_xmit_pkts_vec_avx2.
The inner and outer UDP checksum of the tunnel packet after forwarding
is wrong.The dev->tx_pkt_burst should be set to ice_xmit_pkts.
The patch adds RTE_ETH_TX_OFFLOAD_OUTER_UDP_CKSUM to
ICE_TX_NO_VECTOR_FLAGS, set dev->tx_pkt_burst to ice_xmit_pkts. After
the tunnel packet is forwarded, the inner and outer UDP checksum is
correct.
At the same time, the patch of "net/ice: fix Tx Checksum offload" will
cause interrupt errors in a special case that only inner IP and inner
UDP checksum are set for hardware calculation. The patch is updating
ICE_TX_NO_VECTOR_FLAGS, the problem can be solved, so I will restore the
code modification of that patch.
Harman Kalra [Thu, 3 Mar 2022 07:00:42 +0000 (12:30 +0530)]
common/cnxk: fix mbuf data offset for VF
If PF has PTP enabled the data offset should be adjusted for VF to
skip extra 8 bytes of timestamp as the MAC inserts 8 bytes before
the ethernet header.
Fixes: c443e0d326e1 ("common/cnxk: support NIX PTP") Cc: stable@dpdk.org Signed-off-by: Harman Kalra <hkalra@marvell.com> Acked-by: Jerin Jacob <jerinj@marvell.com>
Revert change [1] to return error on case where no slab of free
resources is found. That error check break's a case where
there is a spare schedule queue to be reused that was just
allocated for sake of contiguous static TM nodes.
[1] Fixes: 14f7e5d4bf2d ("common/cnxk: add missing checks of return values") Cc: stable@dpdk.org Signed-off-by: Nithin Dabilpuram <ndabilpuram@marvell.com> Acked-by: Jerin Jacob <jerinj@marvell.com>
Gregory Etelson [Tue, 1 Mar 2022 12:28:24 +0000 (14:28 +0200)]
net/mlx5: fix flex item header length translation
Flex item API provides support for network header with a fixed and
variable lengths.
When PMD compiles a new flex item object configuration it converts
RTE parameters into matching PMD PARSE_GRAPH parameters and checks
the parameter values against port capabilities.
Current implementation mismatched PARSE_GRAPH configuration fields
for the fixed size header.
Michael Baum [Tue, 1 Mar 2022 11:09:35 +0000 (13:09 +0200)]
common/mlx5: fix default devargs initialization
Device arguments list is provided along with its identifier as part of
EAL arguments.
The arguments specified in the list are taken from it, and the rest is
initialized to the default values.
When no list is provided at all, all arguments should have been
initialized to their default values. However, they are mistakenly
initialized to zero which may be a valid value for some.
This patch initializes the default values before checking whether
arguments have been specified.
Bing Zhao [Mon, 28 Feb 2022 11:41:49 +0000 (13:41 +0200)]
net/mlx5: fix matcher priority with ICMP or ICMPv6
On TCP/IP-based layered network, ICMP is considered and implemented
as part of layer 3 IP protocol. Actually, it is a user of the IP
protocol and must be encapsulated within IP packets. There is no
layer 4 protocol over ICMP.
The rule with layer 4 should be matched prior to the rule only with
layer 3 pattern when:
1. Both rules are created in the same table
2. Both rules could be hit
3. The rules has the same priority
The steering result of the packet is indeterministic if there are
rules with patterns IP and IP+ICMP in the same table with the same
priority. Like TCP / UDP, a packet should hit the rule with a longer
matching criterion.
By treating the priority of ICMP/ICMPv6 as a layer 4 priority in the
PMD internally, the IP+ICMP will be hit in prior to IP only.
Fixes: d53aa89aea91 ("net/mlx5: support matching on ICMP/ICMP6") Cc: stable@dpdk.org Signed-off-by: Bing Zhao <bingz@nvidia.com> Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
Gregory Etelson [Mon, 28 Feb 2022 09:53:01 +0000 (11:53 +0200)]
net/mlx5: fix GRE item translation in Verbs
GRE item translation must set inner protocol value.
For that reason the item is not translated inplace when PMD
translation iterates over flow items, but moved after the loop, when
all inner types are discovered.
If PMD does not translate GRE flow item inside the translation loop
it must save the GRE item for access outside the loop.
Fixes: 985b479267aa ("net/mlx5: fix GRE protocol type translation for Verbs") Cc: stable@dpdk.org Signed-off-by: Gregory Etelson <getelson@nvidia.com> Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
A pattern template creation shares the parsing mechanism with
a simple flow creation. The pattern template creation only consists
of pattern items while the flow creation continues with actions.
The parsing mechanism now accommodates both cases and allows to stop
at the item end token, which should not happen for the flow creation.
Fix parsing mechanism to differentiate between these two cases.
Bugzilla ID: 941 Fixes: 04cc665fab38 ("app/testpmd: add flow template management") Signed-off-by: Alexander Kozyrev <akozyrev@nvidia.com> Acked-by: Ori Kam <orika@nvidia.com> Tested-by: Zhimin Huang <zhiminx.huang@intel.com>
John Miller [Wed, 2 Mar 2022 19:26:47 +0000 (13:26 -0600)]
net/ark: support multi-port packet generation
Added support for packet generation in
multi-port Arkville implementations. The packet
generator is a singleton within the device but is
capable of generating packets for any port within
one device.
Signed-off-by: John Miller <john.miller@atomicrules.com>
Harold Huang [Thu, 3 Mar 2022 02:18:03 +0000 (10:18 +0800)]
net/kni: fix config initialization
When kni driver calls eth_kni_start to start device, some fields such as
min_mtu and max_mtu of rte_kni_conf are not initialized. It will cause
kni_ioctl_create create a kni netdevice with a random min_mtu and
max_mtu value. This is unexpected and sometimes we could not change the
kni device mtu with ip link command.
Fixes: ff1e35fb5f83 ("kni: calculate MTU from mbuf size") Cc: stable@dpdk.org Signed-off-by: Harold Huang <baymaxhuang@gmail.com> Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
Michael Baum [Mon, 28 Feb 2022 07:09:54 +0000 (09:09 +0200)]
net/mlx5: fix check in count action validation
The AGE action can be implemented by either counters or ASO mechanism.
ASO is more efficient than generating counters just for the purpose of
aging, so when ASO is supported its use is preferable. On the other
hand, when there is count in the list of actions, the counter is already
generated, and it is best to use it for aging even if ASO is supported.
On the other hand, when the count action is "indirect", it cannot be
used for aging since it may be updated from other flow rules in which it
participates.
Checking whether ASO is supported depends on both the capability of the
device and the flow rule group number, ASO is not supported for group 0.
However, the flow_dv_validate() function only checks the capability and
ignores the group, allowing inadmissible flow rules.
For example, when the device supports ASO and a flow rule is set that
combines an indirect counter with aging for group 0, the rule should be
rejected, but it is created and does not function properly.
This patch updates the counter validation which will also consider the
group number when deciding if there is ASO support.
Fixes: daed4b6e3db2 ("net/mlx5: use aging by counter when counter exists") Cc: stable@dpdk.org Signed-off-by: Michael Baum <michaelba@nvidia.com> Acked-by: Matan Azrad <matan@nvidia.com>
Michael Baum [Mon, 28 Feb 2022 07:09:53 +0000 (09:09 +0200)]
net/mlx5: fix shared counter flag in flow validation
The AGE action can be implemented by either counters or ASO mechanism.
When user ask count action in the flow rule, AGE action is implemented
by the same counter. However, if user ask indirect count action, it
cannot be used for AGE.
The flow_dv_validate() function has a flag named "shared_count" which
indicates whether AGE action validate depends on ASO support or not.
This flag is initialized to false and is updated if there is indirect
count action in the action list.
This flag is mistakenly set within the loop that reads the action list
and in each iteration it is reinitialized to false, regardless of the
existence of an indirect count action in the list.
This patch moves the flag initialization out of the loop.
Fixes: f3191849f2c2 ("net/mlx5: support flow count action handle") Cc: stable@dpdk.org Signed-off-by: Michael Baum <michaelba@nvidia.com> Acked-by: Matan Azrad <matan@nvidia.com>
Adham Masarwah [Wed, 23 Feb 2022 09:32:05 +0000 (11:32 +0200)]
net/mlx5: fix destroying empty matchers list
The table remove callback function is trying to destroy the
matchers list associated with table entries without checking
if the list is valid, which causes null pointer dereference.
Fixed by validating the matchers list before destroying it.
Issue can be reproduced with testpmd on Windows, when you run:
port close all
Fixes: 1872635570be ("net/mlx5: make matcher list thread safe") Cc: stable@dpdk.org Signed-off-by: Adham Masarwah <adham@nvidia.com> Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com> Acked-by: Tal Shnaiderman <talshn@nvidia.com> Tested-by: Idan Hackmon <idanhac@nvidia.com>
Suanming Mou [Wed, 23 Feb 2022 06:26:11 +0000 (08:26 +0200)]
net/mlx5: fix indexed pool fetch overlap
For indexed pool with local cache, when a new trunk is allocated,
half of the trunk's index was fetched to the local cache. In case
of local cache size was less then half of the trunk size, memory
overlap happened.
This commit adds the check of the fetch size, if local cache size
is less than fetch size, adjust the fetch size to be local cache
size.
Fixes: d15c0946beea ("net/mlx5: add indexed pool local cache") Cc: stable@dpdk.org Signed-off-by: Suanming Mou <suanmingm@nvidia.com> Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
Dmitry Kozlyuk [Tue, 1 Mar 2022 12:15:14 +0000 (14:15 +0200)]
net/mlx5: fix initial link status detection
Link status change takes time that depends on the HW and the kernel.
It was checked immediately after the change was issued at probing.
If the port had been down before probing, a "down" state may be read,
while the port would be "up" imminently.
After that, DPDK reported the port as "down" mistakenly
and "ifconfig $DEV up" did not trigger an LSC event,
because from the system's perspective the port was "up" already.
Install Netlink event handler at port probe before requesting the port
to come up in order to receive LSC event even if it comes up
between probe and start.
Fixes: a85a606ca501 ("net/mlx5: fix link status initialization") Cc: stable@dpdk.org Signed-off-by: Dmitry Kozlyuk <dkozlyuk@nvidia.com> Reviewed-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
Dmitry Kozlyuk [Tue, 1 Mar 2022 12:15:13 +0000 (14:15 +0200)]
net/mlx5: fix link status change detection
Sometimes net/mlx5 devices did not detect link status change to "up".
Each shared device was monitoring IBV_EVENT_PORT_{ACTIVE,ERR}
and queried the link status upon receiving the event.
IBV_EVENT_PORT_ACTIVE is delivered when the logical link status
(UP flag) is set, but the physical link status (RUNNING flag)
may be down at that time, in which case the new link status
would be erroneously considered down.
IBV interface is insufficient for the task.
Monitor interface events using Netlink.
Fixes: 198a3c339a8f ("mlx5: handle link status interrupts") Cc: stable@dpdk.org Signed-off-by: Dmitry Kozlyuk <dkozlyuk@nvidia.com> Reviewed-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
Dmitry Kozlyuk [Tue, 1 Mar 2022 12:15:12 +0000 (14:15 +0200)]
common/mlx5: add Netlink event helpers
Introduce mlx5_nl_read_events() to read Netlink events
(technically, messages) from a socket that was configured
to listen for them via a new mlx5_nl_init() parameter.
Add mlx5_nl_parse_link_status_update() helper
to extract information from link-related events.
This patch is a shared base for later fixes.
Kathleen Capella [Tue, 22 Feb 2022 22:48:18 +0000 (22:48 +0000)]
net/iavf: remove extra check in vector Tx
In the vector Tx path, the function iavf_xmit_pkts_vec_xxx compares
nb_pkts and the txq->rs_thresh and passes the minimum of these as an
argument to iavf_xmit_fixed_burst_vec_xxx.
Inside iavf_xmit_fixed_burst_vec_xxx, the same check is performed again.
This patch removes the redundant check from the
iavf_xmit_fixed_burst_vec_xxx function.
Steve Yang [Mon, 28 Feb 2022 09:48:59 +0000 (09:48 +0000)]
net/iavf: fix function pointer in multi-process
This patch uses the index value to call the function, instead of the
function pointer assignment to save the selection of Receive Flex
Descriptor profile ID.
Otherwise the secondary process will run with wrong function address
from primary process.
Fixes: 12b435bf8f2f ("net/iavf: support flex desc metadata extraction") Cc: stable@dpdk.org Signed-off-by: Steve Yang <stevex.yang@intel.com> Acked-by: Qi Zhang <qi.z.zhang@intel.com>
Radu Nicolau [Mon, 28 Feb 2022 15:00:22 +0000 (15:00 +0000)]
net/iavf: support NAT-T / UDP encapsulation
Add support for NAT-T / UDP encapsulated ESP.
This fixes the inline crypto feature for iAVF which will not
function properly without setting the UDP encapsulation options.
Fixes: 6bc987ecb860 ("net/iavf: support IPsec inline crypto") Cc: stable@dpdk.org Signed-off-by: Radu Nicolau <radu.nicolau@intel.com> Reviewed-by: Qi Zhang <qi.z.zhang@intel.com>
Stephen Douthit [Mon, 28 Feb 2022 15:29:35 +0000 (10:29 -0500)]
net/ixgbe: fix FSP check for X550EM devices
Currently all X500EM* MAC types fall through to the default case and get
reported as non-SFP regardless of media type, which isn't correct.
Fixes: 0790adeb5675 ("ixgbe/base: support X550em_a device") Cc: stable@dpdk.org Signed-off-by: Stephen Douthit <stephend@silicom-usa.com> Signed-off-by: Jeff Daly <jeffd@silicom-usa.com> Acked-by: Haiyue Wang <haiyue.wang@intel.com>
Huisong Li [Wed, 2 Mar 2022 00:35:01 +0000 (08:35 +0800)]
net/hns3: increase time waiting for PF reset completion
On the case that PF and VF need to be reset, after the hardware reset is
complete, VF needs wait for 1 second to restore the configuration so
that VF does not fail to recover because PF reset isn't complete. But
the estimated time is not sufficient. This patch fixes it to 5 seconds.
Fixes: 2790c6464725 ("net/hns3: support device reset") Cc: stable@dpdk.org Signed-off-by: Huisong Li <lihuisong@huawei.com> Acked-by: Min Hu (Connor) <humin29@huawei.com>
Huisong Li [Mon, 28 Feb 2022 03:21:46 +0000 (11:21 +0800)]
net/hns3: fix VF RSS TC mode entry
For packets with VLAN priorities destined for the VF, hardware still
assign Rx queue based on the Up-to-TC mapping PF configured. But VF has
only one TC. If other TC don't enable, it causes that the priority
packets that aren't destined for TC0 aren't received by RSS hash but is
destined for queue 0. So driver has to enable the unused TC by using TC0
queue mapping configuration.
Fixes: c37ca66f2b27 ("net/hns3: support RSS") Cc: stable@dpdk.org Signed-off-by: Huisong Li <lihuisong@huawei.com> Acked-by: Min Hu (Connor) <humin29@huawei.com>
Huisong Li [Mon, 28 Feb 2022 03:21:45 +0000 (11:21 +0800)]
net/hns3: fix RSS TC mode entry
The driver allocates queues only to valid TCs. But the driver also
configure queues for invalid TCs, which is unreasonable.
Fixes: c37ca66f2b27 ("net/hns3: support RSS") Cc: stable@dpdk.org Signed-off-by: Huisong Li <lihuisong@huawei.com> Acked-by: Min Hu (Connor) <humin29@huawei.com>
Jie Hai [Mon, 28 Feb 2022 03:21:41 +0000 (11:21 +0800)]
net/hns3: remove duplicate macro definition
This patch fixes duplicate macro definition of HNS3_RSS_CFG_TBL_SIZE.
Fixes: 737f30e1c3ab ("net/hns3: support command interface with firmware") Cc: stable@dpdk.org Signed-off-by: Jie Hai <haijie1@huawei.com> Acked-by: Min Hu (Connor) <humin29@huawei.com>
Anoob Joseph [Fri, 4 Mar 2022 10:40:38 +0000 (16:10 +0530)]
app/crypto-perf: add IPsec operations population routine
Ops population functions are called in datapath. Keeping it common for
PDCP & DOCSIS would mean ops population would have additional
conditional checks causing the throughput reported to be lower than what
the PMD is capable of.
Separate out routine for IPsec cases and split vector population and op
preparation into two loops to allow 2 rte_rdtsc_precise() calls to
capture cycles consumed for memcpying the vector. Checking the cycle
count from the loop would mean more calls to the same API.
Signed-off-by: Anoob Joseph <anoobj@marvell.com> Acked-by: Akhil Goyal <gakhil@marvell.com>
Kai Ji [Tue, 1 Mar 2022 15:02:54 +0000 (23:02 +0800)]
crypto/qat: fix process type handling
This patch fix the memory corruptions issue reported by
coverity. The process type handling in QAT PMDs where only
primary and secondary process are supported in qat build
request.
Coverity issue: 376551, 376570, 376534 Fixes: fb3b9f492205 ("crypto/qat: rework burst data path") Signed-off-by: Kai Ji <kai.ji@intel.com>
Raja Zidane [Tue, 1 Mar 2022 14:15:02 +0000 (16:15 +0200)]
compressdev: fix socket ID type
Socket ID is used and interpreted as integer, one of the possible
values for socket id is -1 (SOCKET_ID_ANY).
here socket_id is defined as unsigned 8 bit integer, so when putting
-1, it is interpreted as 255, which causes allocation errors when
trying to allocate from socket_id (255).
change socket_id from unsigned 8 bit integer to integer.
Raja Zidane [Wed, 2 Mar 2022 08:41:31 +0000 (10:41 +0200)]
app/compress-perf: fix number of queue pairs to setup
The number of QPs is limited by the number of cores, such that in
case the user requests more QPs than possible, the number of QPs
actually configured on the device is equal to the number of cores,
but the app tries to setup the original number of QPs.
Align the number of QPs setup'ed to the limited number.
Fixes: 424dd6c8c1a8 ("app/compress-perf: add weak functions for multicore test") Cc: stable@dpdk.org Signed-off-by: Raja Zidane <rzidane@nvidia.com> Acked-by: Matan Azrad <matan@nvidia.com>
Raja Zidane [Sun, 27 Feb 2022 14:00:52 +0000 (16:00 +0200)]
compress/mlx5: support out-of-space status
When trying to dequeue, an OP may fail due to insufficient
space for the OP output, the compressdev API defines out-of-space
for OP status. The driver can detect out-of-space errors and
report them to the user. Check if hw_error_syndrome specifies
out-of-space and set the OP status accordingly.
Also added an error message for a case of missing B-final flag.
Raja Zidane [Wed, 23 Feb 2022 13:33:07 +0000 (15:33 +0200)]
app/compress-perf: optimize operations pool allocation
An array of the size of total operations needed for the de/compression is
reserved for ops while enqueueing, although only first burst_size entries
of the array are used.
Reduce the size of the array allocated.
Fixes: b68a82425da4 ("app/compress-perf: add performance measurement") Cc: stable@dpdk.org Signed-off-by: Raja Zidane <rzidane@nvidia.com> Acked-by: Matan Azrad <matan@nvidia.com> Acked-by: Fan Zhang <roy.fan.zhang@intel.com>
In cyclecount main_loop function, each iteration it tries to
enqueue X ops, in case Y<X ops were enqueued, the rest of the
X-Y ops are moved to the beginning of the ops array, to preserve
ops order, and next Y ops are allocated for the next enqueue
action, the allocation of the ops occurs on the first Y entries
in the array, when it should have skipped the first X-Y
array entries and allocate the following Y entries.
Fix the allocation by adding the correct offset.
Fixes: 2695db95a147 ("test/compress: add cycle-count mode to perf tool") Cc: stable@dpdk.org Signed-off-by: Raja Zidane <rzidane@nvidia.com> Acked-by: Matan Azrad <matan@nvidia.com>
Thomas Monjalon [Sat, 26 Feb 2022 18:36:51 +0000 (19:36 +0100)]
ci: remove redundant drivers enabling
No need to explicitly enable drivers bus/vdev and mempool/ring.
bus/vdev is always enabled since
commit 2e33309ebe03 ("config: enable/disable drivers in Arm builds")
mempool/ring is always enabled since
commit 81c2337e044d ("build: make ring mempool driver mandatory")
The driver net/null is kept to allow running test-null.sh.
Signed-off-by: Thomas Monjalon <thomas@monjalon.net> Acked-by: Bruce Richardson <bruce.richardson@intel.com> Acked-by: David Marchand <david.marchand@redhat.com>
Thomas Monjalon [Tue, 8 Feb 2022 13:47:15 +0000 (14:47 +0100)]
ci: remove outdated default versions for ABI check
The variables REF_GIT_TAG and LIBABIGAIL_VERSION are set
in the CI configuration like .travis.yml or .github/workflows/build.yml.
The default values are outdated and probably unused.
The default values are removed completely
to avoid forgetting an update in future.
The use of the variables is quoted to make sure
a missing value will trigger an appropriate failure.
Signed-off-by: Thomas Monjalon <thomas@monjalon.net> Acked-by: Aaron Conole <aconole@redhat.com> Acked-by: David Marchand <david.marchand@redhat.com>
Huisong Li [Wed, 9 Feb 2022 07:35:25 +0000 (15:35 +0800)]
kni: fix freeing order in device release
The "kni_dev" is the private data of the "net_device" in kni, and allocated
with the "net_device" by calling "alloc_netdev()". The "net_device" is
freed by calling "free_netdev()" when kni release. The freed memory
includes the "kni_dev". So after "kni_dev" should not be accessed after
"net_device" is released.
Fixes: e77fec694936 ("kni: fix possible mbuf leaks and speed up port release") Cc: stable@dpdk.org
KASAN trace:
Michal Krawczyk [Wed, 19 Jan 2022 14:50:37 +0000 (15:50 +0100)]
bus/pci: assign driver pointer before mapping
Patch changing the way of accessing interrupt handle also changed order
of the rte_pci_map_device() call and rte_pci_device:driver assignment.
It was causing issues with Write Combine mapping on the Linux platform
if it was used with the igb_uio module.
Linux implementation of pci_uio_map_resource_by_index(), which is called
by rte_pci_map_device(), needs access to the device's driver. Otherwise
it won't be able to check the driver's flags and won't respect them.
Fixes: d61138d4f0e2 ("drivers: remove direct access to interrupt handle") Cc: stable@dpdk.org Signed-off-by: Michal Krawczyk <mk@semihalf.com>
Steve Yang [Wed, 23 Feb 2022 08:49:50 +0000 (08:49 +0000)]
eal/linux: fix illegal memory access in uevent handler
'recv()' fills the 'buf', later 'strlcpy()' used to copy from this buffer.
But as coverity warns 'recv()' doesn't guarantee that 'buf' is
null-terminated, but 'strlcpy()' requires it.
Enlarge 'buf' size to 'EAL_UEV_MSG_LEN + 1' and ensure the last one can
be set to 0 when received buffer size is EAL_UEV_MSG_LEN.
CID 375864: Memory - illegal accesses (STRING_NULL)
Passing unterminated string "buf" to "dev_uev_parse", which expects
a null-terminated string.
Coverity issue: 375864 Fixes: 0d0f478d0483 ("eal/linux: add uevent parse and process") Cc: stable@dpdk.org Signed-off-by: Steve Yang <stevex.yang@intel.com> Acked-by: Ferruh Yigit <ferruh.yigit@intel.com>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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.
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>
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>
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>
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>
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>
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.
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>