Commit Graph

31974 Commits

Author SHA1 Message Date
Karl Bonde Torp
4bab7ea60c 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>
2022-03-08 16:37:22 +01:00
David Marchand
762cdb7b68 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: 5e0099dc70 ("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>
2022-03-08 15:48:30 +01:00
Thomas Monjalon
b403498e14 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: 1afce3086c ("bus/auxiliary: introduce auxiliary bus")
Fixes: 8b8036a66e ("gpudev: introduce GPU device class library")
Cc: stable@dpdk.org

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
2022-03-08 15:22:33 +01:00
Thomas Monjalon
89e290eb8c 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: bab9497ef7 ("regexdev: introduce API")
Cc: stable@dpdk.org

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Acked-by: Ori Kam <orika@nvidia.com>
2022-03-08 15:22:28 +01:00
David Marchand
8fdcd5133c 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>
2022-03-08 15:02:59 +01:00
David Marchand
d58e0d5d65 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: fdab8f2e17 ("version: 21.11-rc0")
Cc: stable@dpdk.org

Signed-off-by: David Marchand <david.marchand@redhat.com>
Acked-by: Ray Kinsella <mdr@ashroe.eu>
2022-03-08 14:59:10 +01:00
Aman Singh
276f964314 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>
2022-03-08 14:57:06 +01:00
Tianli Lai
2e7997ce58 examples/kni: add missing trailing newline in log
Add CR character at print link state information.

Fixes: db4e81351f ("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>
2022-03-08 14:27:11 +01:00
Wenwu Ma
1c839246f9 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>
2022-03-08 14:20:11 +01:00
Chuanshe Zhang
750c177980 examples/flow_classify: fix failure message
Fixes: bab16ddaf2 ("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>
2022-03-08 14:17:27 +01:00
Honnappa Nagarahalli
e7f6d1289b 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: 07db4a9750 ("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>
2022-03-08 12:38:39 +01:00
Honnappa Nagarahalli
8efffaec56 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>
2022-03-08 10:22:12 +01:00
Honnappa Nagarahalli
e7a7add13a 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>
2022-03-08 10:21:49 +01:00
Sean Morrissey
e7e6dd6430 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>
2022-03-08 09:59:53 +01:00
Sean Morrissey
52def963fc 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>
2022-03-08 09:59:42 +01:00
Ben Magistro
a8dde09f97 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>
2022-03-08 09:32:59 +01:00
Stephen Hemminger
499b1cbcf9 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: cbb44143be ("app/dumpcap: add new packet capture application")
Cc: stable@dpdk.org

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
2022-03-08 09:19:46 +01:00
Stephen Hemminger
78e7b29ff1 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: 2eccf6afbe ("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>
2022-03-08 09:19:41 +01:00
Stephen Hemminger
442878db2e 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: 8d23ce8f5e ("pcapng: add new library for writing pcapng files")
Cc: stable@dpdk.org

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
2022-03-08 09:19:40 +01:00
Tianli Lai
a8a1c40bda 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>
2022-03-08 00:19:31 +01:00
Reshma Pattan
3ee04ebc91 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: b2854d5317 ("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>
2022-03-08 00:00:21 +01:00
Wei Huang
2479a1e9a8 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>
2022-03-07 23:34:25 +01:00
Wei Huang
20659eb380 raw/ifpga: fix interrupt handle allocation
Allocate FPGA interrupt handle instance for each card.

Fixes: e0a1aafe2a ("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>
2022-03-07 23:16:17 +01:00
Wei Huang
aae56ac43b 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: 9c006c45d0 ("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>
2022-03-07 23:07:22 +01:00
Elena Agostini
0105d49e7e gpu/cuda: fix dependency loading path
A slash was missing in libcuda.so path for dlopen.

Signed-off-by: Elena Agostini <eagostini@nvidia.com>
2022-03-07 22:42:36 +01:00
Haiyue Wang
6eccb0c9ee 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>
2022-03-07 20:31:14 +01:00
Weiguo Li
79aab97c94 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: 44c730b0e3 ("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>
2022-03-07 19:34:24 +01:00
Wenxuan Wu
4e3582ab5b 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: 1fef6ced07 ("eal/linux: allow multiple starts of event monitor")
Cc: stable@dpdk.org

Signed-off-by: Wenxuan Wu <wenxuanx.wu@intel.com>
2022-03-07 19:21:18 +01:00
David Marchand
d1ef517dc0 bus/pci: enhance driver pointer documentation
Setting driver pointer before mapping required for write combining
support since commit 4a928ef9f6 ("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>
2022-03-07 17:46:10 +01:00
Wenwu Ma
917229c24e 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: 4796ad63ba ("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>
2022-03-04 15:14:30 +01:00
Peng Yu
4f670c5af0 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: 94c16e89d7 ("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>
2022-03-04 14:50:55 +01:00
Vamsi Attunuru
694e29ea9b 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: bea5d990a9 ("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>
2022-03-03 06:59:25 +01:00
Kevin Liu
d852fec1be 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: 28f9002ab6 ("net/ice: add Tx AVX512 offload path")
Fixes: 295968d174 ("ethdev: add namespace")
Fixes: 17c7d0f9d6 ("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>
2022-03-04 12:35:51 +01:00
Harman Kalra
8f98e3ecc5 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: c443e0d326 ("common/cnxk: support NIX PTP")
Cc: stable@dpdk.org

Signed-off-by: Harman Kalra <hkalra@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
2022-03-03 18:35:40 +01:00
Nithin Dabilpuram
66d485fb50 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: 14f7e5d4bf ("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>
2022-03-03 18:28:16 +01:00
Radu Nicolau
e816a255f7 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: 6bc987ecb8 ("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>
2022-03-03 11:34:27 +01:00
Gregory Etelson
7bda5beead 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: b293e8e49d ("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>
2022-03-02 17:36:47 +01:00
Michael Baum
2c75b9bcd5 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: a729d2f093 ("common/mlx5: refactor devargs management")

Signed-off-by: Michael Baum <michaelba@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
2022-03-02 17:36:46 +01:00
Bing Zhao
dfb8c448da 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: d53aa89aea ("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>
2022-03-02 17:36:38 +01:00
Gregory Etelson
cfe337e715 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: a23e9b6e3e ("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>
2022-03-02 11:24:36 +01:00
Gregory Etelson
df4986559f 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: 985b479267 ("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>
2022-03-02 11:24:20 +01:00
Alexander Kozyrev
e2b1848455 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: 04cc665fab ("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>
2022-03-03 14:30:21 +01:00
Ali Alnubani
00373909c8 doc: fix typos and punctuation in flow API guide
This fixes typos and punctuation in the rte flow API guide.

Fixes: 2f82d143fb ("ethdev: add group jump action")
Fixes: 4d73b6fb99 ("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>
2022-03-03 14:10:46 +01:00
John Miller
c7ff3d78a0 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>
2022-03-03 12:56:42 +01:00
Harold Huang
dcd398f946 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: ff1e35fb5f ("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>
2022-03-03 12:30:51 +01:00
Weiguo Li
f69467177f 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: c1d4e9d37a ("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>
2022-03-02 18:28:49 +01:00
Michael Baum
57461cab16 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: daed4b6e3d ("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>
2022-03-01 22:24:53 +01:00
Michael Baum
8f53c7cf26 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: f3191849f2 ("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>
2022-03-01 22:24:52 +01:00
Adham Masarwah
dc065d6efd 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: 1872635570 ("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>
2022-03-01 22:24:36 +01:00
Suanming Mou
7bc528bac9 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: d15c0946be ("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>
2022-03-01 22:24:22 +01:00