dpdk.git
4 years agonet/mlx5: fix representor interrupts handler
Gregory Etelson [Tue, 17 Nov 2020 18:49:40 +0000 (20:49 +0200)]
net/mlx5: fix representor interrupts handler

Representor is a port in DPDK that is connected to a VF in such a way
that assuming there are no offload flows, each packet that is sent
from the VF will be received by the corresponding representor. While
each packet that is sent to a representor will be received by the VF.
This is very useful in case of SRIOV mode, where the first packet that
is sent by the VF will be received by the DPDK application which will
decide if this flow should be offloaded to the E-Switch.

Representor shares interrupts handler with host PF over the PCI
address. Therefore, after PF completes its interrupts handler
initialization, no additional actions required for representor.

Fixes: 26c08b979d26 ("net/mlx5: add port representor awareness")
Cc: stable@dpdk.org
Signed-off-by: Gregory Etelson <getelson@nvidia.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
4 years agoexamples/l3fwd-power: check packet types after start
Gregory Etelson [Tue, 17 Nov 2020 18:49:39 +0000 (20:49 +0200)]
examples/l3fwd-power: check packet types after start

l3fwd-power uses `--parse-ptype' parameter to query egress packets
type.  Before that feature is enabled l3fwd-power verifies PMD ability
to advertise supported packet types with
rte_eth_dev_get_supported_ptypes().

The above ethdev function API contains this note:
"
Better to invoke this API after the device is already started or rx burst
function is decided, to obtain correct supported ptypes.
"

The patch updates code for PMDs that register supported types after
dev_start.

Fixes: 82bea4661626 ("examples/l3fwd-power: add --parse-ptype option")
Cc: stable@dpdk.org
Signed-off-by: Gregory Etelson <getelson@nvidia.com>
4 years agonet/mlx5: fix shared RSS action update
Andrey Vesnovaty [Sun, 22 Nov 2020 14:49:51 +0000 (16:49 +0200)]
net/mlx5: fix shared RSS action update

The shared RSS action update was not operational due to lack
of kernel driver support of TIR object modification.
This commit introduces the workaround to support shared RSS
action modify using an indirect queue table update instead of
touching TIR object directly.
Limitations: the only supported RSS property to update is queues, the
rest of the properties ignored.

Fixes: d2046c09aa64 ("net/mlx5: support shared action for RSS")

Signed-off-by: Andrey Vesnovaty <andreyv@nvidia.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
4 years agonet/mlx5: check register available for metadata action
Tonghao Zhang [Fri, 20 Nov 2020 14:48:03 +0000 (14:48 +0000)]
net/mlx5: check register available for metadata action

If user don't set the dv_xmeta_en to 1 or 2,
in the flow_dv_convert_action_set_meta function:

- flow_dv_get_metadata_reg may return the REG_NONE,
  when MLX5_METADATA_FDB enabled for metadata set action.

- reg_to_field(REG_NONE) returns MLX5_MODI_OUT_NONE,
  that is invalid and rdma-core fails.

The rdma-core calltrace:
    dr_action_create_modify_action
    dr_actions_convert_modify_header
    dr_action_modify_sw_to_hw
    dr_action_modify_sw_to_hw_set
    dr_ste_get_modify_hdr_hw_field

Fixes: fcc8d2f716fd ("net/mlx5: extend flow metadata support")
Cc: stable@dpdk.org
Signed-off-by: Tonghao Zhang <xiangxia.m.yue@gmail.com>
Signed-off-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
4 years agonet/mlx5: fix mbuf overflow in vectorized MPRQ
Alexander Kozyrev [Sat, 21 Nov 2020 03:42:39 +0000 (03:42 +0000)]
net/mlx5: fix mbuf overflow in vectorized MPRQ

Changing the allocation scheme to improve mbufs locality caused mbufs
overrun in some cases. Revert the previous replenish logic back.
Calculate a number of unused mbufs and replenish max this number of mbufs.

Mark the last 4 mbufs as fake mbufs to prevent overflowing into consumed
mbufs in the future. Keep the consumed index and the produced index 4 mbufs
apart for this purpose.

Replenish some mbufs only in case the consumed index is within the
replenish threshold of the produced index in order to retain the cache
locality for the vectorized MPRQ routine.

Fixes: 5c68764377 ("net/mlx5: improve vectorized MPRQ descriptors locality")

Signed-off-by: Alexander Kozyrev <akozyrev@nvidia.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
4 years agonet/mlx5: make Tx scheduling xstats names compliant
Viacheslav Ovsiienko [Thu, 19 Nov 2020 19:18:24 +0000 (19:18 +0000)]
net/mlx5: make Tx scheduling xstats names compliant

xstats names for Tx packet scheduling should be compliant with [1]

[1] http://doc.dpdk.org/guides/prog_guide/poll_mode_drv.html?highlight=xstats#extended-statistics-api

Bugzilla ID: 558

Signed-off-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
4 years agonet/mlx5: make ethernet xstats names compliant
Viacheslav Ovsiienko [Thu, 19 Nov 2020 19:18:05 +0000 (19:18 +0000)]
net/mlx5: make ethernet xstats names compliant

xstats names for simple stats are mostly standardized in ethdev drivers
and should be compliant with [1]

[1] http://doc.dpdk.org/guides/prog_guide/poll_mode_drv.html?highlight=xstats#extended-statistics-api

Bugzilla ID: 558

Reported-by: Igor Ryzhov <iryzhov@nfware.com>
Signed-off-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
4 years agonet/mlx5: allow unknown link speed
Benoît Ganne [Sun, 22 Nov 2020 10:04:04 +0000 (12:04 +0200)]
net/mlx5: allow unknown link speed

mlx5 PMD refuses to update link state if link speed is defined but
status is down or if link speed is undefined but status is up, even if
the ioctl() succeeded.
This prevents application to detect link up/down event, especially when
the link speed is not correctly detected.

Commit [1] allowed returning unknown link speed, so now PMD allows
the return of unknown link speed in the above case.

Due to some old kernel driver bug, link speed wasn't detected properly.

[1] http://git.dpdk.org/dpdk/commit/?id=810b17d116f03

Signed-off-by: Benoît Ganne <bganne@cisco.com>
Signed-off-by: Raslan Darawsheh <rasland@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
4 years agoapp/flow-perf: fix raw encapsulation size
Xiaoyu Min [Mon, 16 Nov 2020 07:55:15 +0000 (15:55 +0800)]
app/flow-perf: fix raw encapsulation size

The rte_flow_item_eth and rte_flow_item_vlan items are refined.
The structs do not exactly represent the packet bits captured on the
wire anymore so add_*_header functions should use real header instead of
the using rte_flow_item_* struct.

Replace the rte_flow_item_* with the existing corresponding rte_*_hdr.

Fixes: 09315fc83861 ("ethdev: add VLAN attributes to ethernet and VLAN items")

Signed-off-by: Xiaoyu Min <jackmin@nvidia.com>
4 years agonet/softnic: fix header size calculation
Dekel Peled [Mon, 16 Nov 2020 07:55:18 +0000 (15:55 +0800)]
net/softnic: fix header size calculation

The rte_flow_item_eth and rte_flow_item_vlan items were updated in [1].
The rte_flow_item_ipv6 item was updated in [2].
The structs now contain additional metadata following the header data.
The size to use for match should be the header data size only, and
not the size of the whole struct.

This patch replaces the rte_flow_item_* with the corresponding rte_*_hdr.

Fixes: 09315fc83861 ("ethdev: add VLAN attributes to ethernet and VLAN items")
Fixes: ad976bd40d28 ("ethdev: add extensions attributes to IPv6 item")

Signed-off-by: Dekel Peled <dekelp@nvidia.com>
Acked-by: Jasvinder Singh <jasvinder.singh@intel.com>
4 years agonet/mlx5: fix encap/decap limit for hairpin flow split
Xiaoyu Min [Mon, 16 Nov 2020 07:55:14 +0000 (15:55 +0800)]
net/mlx5: fix encap/decap limit for hairpin flow split

The rte_flow_item_eth and rte_flow_item_vlan items are refined.
The structs do not exactly represent the packet bits captured on the
wire anymore.
Should use real header instead of the whole struct.

Replace the rte_flow_item_* with the existing corresponding rte_*_hdr.

Fixes: 09315fc83861 ("ethdev: add VLAN attributes to ethernet and VLAN items")
Fixes: f9210259cac7 ("net/mlx5: fix raw encap/decap limit")

Signed-off-by: Xiaoyu Min <jackmin@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
4 years agonet/bnxt: fix VLAN/VXLAN encapsulation header size
Xiaoyu Min [Mon, 16 Nov 2020 07:55:16 +0000 (15:55 +0800)]
net/bnxt: fix VLAN/VXLAN encapsulation header size

The rte_flow_item_eth and rte_flow_item_vlan items are refined.
The structs do not exactly represent the packet bits captured on the
wire anymore so should only copy real header instead of the whole struct.

Replace the rte_flow_item_* with the existing corresponding rte_*_hdr.

Fixes: 09315fc83861 ("ethdev: add VLAN attributes to ethernet and VLAN items")

Signed-off-by: Xiaoyu Min <jackmin@nvidia.com>
Acked-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
4 years agoregex/mlx5: fix leak on queue setup failure
Michael Baum [Wed, 18 Nov 2020 17:00:11 +0000 (17:00 +0000)]
regex/mlx5: fix leak on queue setup failure

In regex QP setup, the PMD creates some SQ objects.

When SQ object creation is failed, the previous SQ objects memory were
not freed what caused a memory leak.

Free them.

Fixes: 54fa1f6a67d7 ("regex/mlx5: add teardown for fastpath buffers")

Signed-off-by: Michael Baum <michaelba@nvidia.com>
Acked-by: Ori Kam <orika@nvidia.com>
4 years agoregex/mlx5: fix type of setup constants
Michael Baum [Wed, 18 Nov 2020 17:00:10 +0000 (17:00 +0000)]
regex/mlx5: fix type of setup constants

The constant representing the size of the metadata is defined as a
regular number (32-bit signed), even though all of its uses request an
unsigned int variable.
Similarly the constant representing the maximal output is also defined
as a regular number, even though all of its uses request an unsigned int
variable.

Change the type of the above constants to unsigned.

Fixes: 5f41b66d12cd ("regex/mlx5: setup fast path")
Cc: stable@dpdk.org
Signed-off-by: Michael Baum <michaelba@nvidia.com>
Acked-by: Ori Kam <orika@nvidia.com>
4 years agoregex/mlx5: improve error messages in RXP rules flush
Michael Baum [Wed, 18 Nov 2020 17:00:09 +0000 (17:00 +0000)]
regex/mlx5: improve error messages in RXP rules flush

During the rules flush, the rxp_poll_csr_for_value function is called
twice. The rxp_poll_csr_for_value function can fail for two reasons:
1. It could not read the value from register, in which case the
function returns -1.
2. It read a value, but not the value it expected to receive. In this
case it returns -EBUSY.

When the function fails it prints an error message that is relevant only
for a second type of failure. Moreover, for failure of the first type it
prints a value of an uninitialized variable.
In case of success, the function prints a debug message about the number
of cycles it took. This line was probably copied by mistake, since the
variable it reads from, is always equal to 0 and is not an indicator of
the number of cycles.

Remove the incorrect line about the cycles, and reduce the error print
only for the relevant error.

Fixes: b34d816363b5 ("regex/mlx5: support rules import")
Cc: stable@dpdk.org
Signed-off-by: Michael Baum <michaelba@nvidia.com>
Acked-by: Ori Kam <orika@nvidia.com>
4 years agoregex/mlx5: check DevX register write
Michael Baum [Wed, 18 Nov 2020 17:00:08 +0000 (17:00 +0000)]
regex/mlx5: check DevX register write

The rxp_flush_rules function tries to read and write to the register
several times using DevX API, and when it fails the function returns an
error.
Similarly the rxp_init_eng function also tries to write to the register
several times, and if writing is failed, it returns an error too.

Both functions have one write that the function does not check if it
succeeded, overriding the return value from the write function without
using it.

Add a check for this writing, and return an error in case of failure.

Fixes: b34d816363b5 ("regex/mlx5: support rules import")
Fixes: e3dbbf718ebc ("regex/mlx5: support configuration")
Cc: stable@dpdk.org
Signed-off-by: Michael Baum <michaelba@nvidia.com>
Acked-by: Ori Kam <orika@nvidia.com>
4 years agoregex/mlx5: remove unnecessary initializations
Michael Baum [Wed, 18 Nov 2020 17:00:07 +0000 (17:00 +0000)]
regex/mlx5: remove unnecessary initializations

The rxp_poll_csr_for_value function defines a variable named ret. It is
the return value of the function, and it is updated to 0 by default
later in the function.
Similarly the rxp_init_rtru function also defines a variable named ret.
The function assigns into it return values from functions during the
function.

In both functions they initialize the ret variable when defining it.
however, in both cases they do not use any ret variable before assigning
into them different values, so the initializations are unnecessary.

Clean the aforementioned unnecessary initializations.

Fixes: e3dbbf718ebc ("regex/mlx5: support configuration")
Fixes: b34d816363b5 ("regex/mlx5: support rules import")
Cc: stable@dpdk.org
Signed-off-by: Michael Baum <michaelba@nvidia.com>
Acked-by: Ori Kam <orika@nvidia.com>
4 years agoregex/mlx5: fix RXP engines iterator size
Michael Baum [Wed, 18 Nov 2020 17:00:06 +0000 (17:00 +0000)]
regex/mlx5: fix RXP engines iterator size

The mlx5_regex_rules_db_import function goes over all engines in the
loop and program rxp rules.

The iterator of the loop is called id and the variable representing the
number of engines is called priv->nb_engines.
The id variable is of uint8_t type while the priv->nb_engines variable
is of uint32_t type. The size of the priv->nb_engines variable is much
larger than the number of iterations allowed by the id type.
Theoretically there may be a situation where the value of the
priv->nb_engines will be greater than can be represented by 8 bits and
the loop will never end.

Change the type of id to uint32_t.

Fixes: b34d816363b5 ("regex/mlx5: support rules import")
Cc: stable@dpdk.org
Signed-off-by: Michael Baum <michaelba@nvidia.com>
Acked-by: Ori Kam <orika@nvidia.com>
4 years agoregex/mlx5: fix crash on probe failure
Michael Baum [Wed, 18 Nov 2020 17:00:05 +0000 (17:00 +0000)]
regex/mlx5: fix crash on probe failure

The mlx5_regex_pci_probe function allocates a mlx5_regex_priv structure
using rte_zmalloc.

If the allocation fails, the function jumps to the dev_error label in
order to release previously allocated resources in the function.
However, in the dev_error label it attempts to refer to the internal
fields of the priv structure and if its allocation fails (as in this
case) it is actually dereferencing to NULL.

Replace the jump with an error label.

Fixes: 1db6ebd4ef58 ("regex/mlx5: fix crash on initialization failure")
Cc: stable@dpdk.org
Signed-off-by: Michael Baum <michaelba@nvidia.com>
Acked-by: Ori Kam <orika@nvidia.com>
4 years agomaintainers: update for OCTEON TX2 DMA and EP
Radha Mohan Chintakuntla [Tue, 10 Nov 2020 00:19:38 +0000 (16:19 -0800)]
maintainers: update for OCTEON TX2 DMA and EP

Replace the maintainers for OcteonTx2 DMA and EP drivers.

Signed-off-by: Radha Mohan Chintakuntla <radhac@marvell.com>
Acked-by: Satha Rao <skoteshwar@marvell.com>
Acked-by: Mahipal Challa <mchalla@marvell.com
4 years agocompress/isal: check allocation in queue setup
Yunjian Wang [Mon, 2 Nov 2020 11:36:24 +0000 (19:36 +0800)]
compress/isal: check allocation in queue setup

The function rte_zmalloc() could return NULL, the return value
need to be checked.

Fixes: dc49e6aa4879 ("compress/isal: add ISA-L compression functionality")
Fixes: 7bf4f0630af6 ("compress/isal: add ISA-L decomp functionality")
Cc: stable@dpdk.org
Signed-off-by: Yunjian Wang <wangyunjian@huawei.com>
Acked-by: Lee Daly <lee.daly@intel.com>
4 years agoevent/octeontx2: unlink queues during port release
Shijith Thotton [Thu, 19 Nov 2020 08:46:11 +0000 (14:16 +0530)]
event/octeontx2: unlink queues during port release

Unlinking queues from port should be done during port release. Doing it
during device re-configuration could result in segfault as ports array
is re-allocated based on new number of ports.

Fixes: f7ac8b66b23c ("event/octeontx2: support linking queues to ports")
Cc: stable@dpdk.org
Signed-off-by: Shijith Thotton <sthotton@marvell.com>
Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
4 years agoevent/octeontx2: fix unconditional Tx flush
Pavan Nikhilesh [Fri, 20 Nov 2020 10:41:46 +0000 (16:11 +0530)]
event/octeontx2: fix unconditional Tx flush

Fix unconditional Tx flush, in case of Tx only we need to check if
work slot is non-empty before issuing flush.
Also, in packet retransmit cases added check for the reference
count and flush the work slot only for the last packet.

Fixes: cb7ee83b6365 ("event/octeontx2: improve single flow performance")
Cc: stable@dpdk.org
Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
4 years agoevent/octeontx: remove selftest option
Pavan Nikhilesh [Thu, 19 Nov 2020 13:57:35 +0000 (19:27 +0530)]
event/octeontx: remove selftest option

Since selftest now depends on dynamic mbuf fields it is not
feasible to run selftest on device probe.

Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
4 years agoevent/octeontx2: remove selftest option
Pavan Nikhilesh [Thu, 19 Nov 2020 13:57:34 +0000 (19:27 +0530)]
event/octeontx2: remove selftest option

Since selftest now depends on dynamic mbuf fields it is not
feasible to run selftest on device probe.

Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
4 years agoevent/dlb: fix mempool query in self test
Timothy McDaniel [Mon, 16 Nov 2020 17:40:38 +0000 (11:40 -0600)]
event/dlb: fix mempool query in self test

Add NULL check before using t->mbuf_pool.

Coverity issue: 363719
Fixes: d1112958f4f5 ("event/dlb: add self-tests")

Signed-off-by: Timothy McDaniel <timothy.mcdaniel@intel.com>
Acked-by: John McNamara <john.mcnamara@intel.com>
4 years agonet/hns3: fix HW exception for unbalanced Rx/Tx queues
Chengchang Tang [Fri, 20 Nov 2020 11:27:34 +0000 (19:27 +0800)]
net/hns3: fix HW exception for unbalanced Rx/Tx queues

For kupeng 930, there are 3 registers to control the enable
status of a TQP(i.e. task queue pair, include a txq and a rxq).
One of them controls whether the TQP is enabled, and the other
two controls whether the rxq and txq are enabled. The registers
used to control the enabled status of the rxq and txq are enabled
by default. Therefore, after the TQP is enabled, the rxq and txq
are enabled by default.

Currently, when the number of rxq is not equal to the number of txq, the
unused rxqs or txqs are not disabled by driver, so these unused queues
will be enabled in this situation.  And the related HW rings have not
been initialized which could lead to a hardware exception.

This patch fix it by disable these unused queues during enable the TQPs.

Fixes: fa29fe45a7b4 ("net/hns3: support queue start and stop")
Cc: stable@dpdk.org
Signed-off-by: Chengchang Tang <tangchengchang@huawei.com>
Signed-off-by: Lijun Ou <oulijun@huawei.com>
4 years agonet/hns3: fix crash with multi-TC
Huisong Li [Fri, 20 Nov 2020 11:27:33 +0000 (19:27 +0800)]
net/hns3: fix crash with multi-TC

The HW and SW DCB configurations need to be updated only
after the DCB configuration information changed. But the
change of tx/rx queue number is ignored. If user decreases
the number of tx queue after configuring multi-TC, the queue
mapping information in hns3_tc_queue_info can not be updated.
And then accessing the released queue resource in
"hns3_init_tx_ring_tc" will trigger a segment fault.

Fixes: 62e3ccc2b94c ("net/hns3: support flow control")
Cc: stable@dpdk.org
Signed-off-by: Huisong Li <lihuisong@huawei.com>
Signed-off-by: Lijun Ou <oulijun@huawei.com>
4 years agoethdev: rename a flow shared action error code
Thomas Monjalon [Fri, 20 Nov 2020 09:54:38 +0000 (10:54 +0100)]
ethdev: rename a flow shared action error code

In the experimental function rte_flow_shared_action_destroy()
introduced in DPDK 20.11, the errno ETOOMANYREFS was used.
This errno is not always available on Windows,
so it is preferred using EBUSY instead.

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Reviewed-by: Tal Shnaiderman <talshn@nvidia.com>
Tested-by: Tal Shnaiderman <talshn@nvidia.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
4 years agonet/hinic: fix hugepage memory leaks
Guoyang Zhou [Fri, 20 Nov 2020 09:11:29 +0000 (17:11 +0800)]
net/hinic: fix hugepage memory leaks

The 'nic_io' memory is set to NULL before it is freed, this is wrong,
and the freeing of some private port resources should be moved from the
".remove(device)" function to the ".dev_close(port)" function.

Fixes: f30e69b41f94 ("ethdev: add device flag to bypass auto-filled queue xstats")
Cc: stable@dpdk.org
Signed-off-by: Guoyang Zhou <zhouguoyang@huawei.com>
4 years agoapp/testpmd: revert setting MTU explicitly after configure
Ferruh Yigit [Mon, 16 Nov 2020 19:03:54 +0000 (19:03 +0000)]
app/testpmd: revert setting MTU explicitly after configure

Setting MTU after each 'rte_eth_dev_configure()' prevents using
"--max-pkt-len=N" parameter and "port config all max-pkt-len #" command

This is breaking DTS scatter test case which is using
"--max-pkt-len=9000" testpmd parameter.

Reverting workaround to recover the DTS testcase.

Fixes: 1c21ee95cf52 ("app/testpmd: fix MTU after device configure")
Cc: stable@dpdk.org
Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
Tested-by: Bo Chen <box.c.chen@intel.com>
4 years agocommon/mlx5: move to formal ASO action API
Dekel Peled [Wed, 18 Nov 2020 08:59:57 +0000 (10:59 +0200)]
common/mlx5: move to formal ASO action API

Existing code uses the previous API offered by rdma-core in order
to create ASO Flow Hit action.

A general API is now formally released, to create ASO action of any
type. This patch moves the MLX5 PMD code to use the formal API.

Signed-off-by: Dekel Peled <dekelp@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
4 years agonet/mlx5: fix input register for ASO object
Dekel Peled [Wed, 18 Nov 2020 08:59:56 +0000 (10:59 +0200)]
net/mlx5: fix input register for ASO object

Existing code uses the hard-coded value REG_C_5 as input for function
mlx5dv_dr_action_create_flow_hit().

This patch updates function mlx5_flow_get_reg_id() to return the
selected REG_C value for ASO Flow Hit operation.
The returned value is used, after reducing offset REG_C_0, as input
for function mlx5dv_dr_action_create_flow_hit().

Fixes: f935ed4b645a ("net/mlx5: support flow hit action for aging")

Signed-off-by: Dekel Peled <dekelp@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
4 years agonet/mlx5: fix memory leak on ASO age close
Dekel Peled [Wed, 18 Nov 2020 08:59:55 +0000 (10:59 +0200)]
net/mlx5: fix memory leak on ASO age close

Recent patch introduced the use of ASO flow hit action for age action.
The relevant management struct uses dynamically allocated memory.
This memory was not freed on closing.

This patch adds memory freeing as needed.

Fixes: f935ed4b645a ("net/mlx5: support flow hit action for aging")

Signed-off-by: Dekel Peled <dekelp@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
4 years agonet/iavf: fix SPDX license text
Stephen Hemminger [Mon, 16 Nov 2020 02:14:39 +0000 (18:14 -0800)]
net/iavf: fix SPDX license text

Obvious spelling error in SPDX license header.

Fixes: 12b435bf8f2f ("net/iavf: support flex desc metadata extraction")

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Ferruh Yigit <ferruh.yigit@intel.com>
4 years agoapp/testpmd: fix flow tunnel commands
Gregory Etelson [Thu, 19 Nov 2020 11:10:24 +0000 (13:10 +0200)]
app/testpmd: fix flow tunnel commands

testpmd provides commands to test tunnel offload rte_flow
capabilities. Testpmd tunnel commands allow to configure new ofloaded
tunnel types, list existing offloaded tunnels and destroy existing
offloaded tunnels.
Tunnel offload commands allowed parameters repetition. For example,
the following commands were accepted:
testpmd> flow tunnel create 0 create 1 type vxlan
or
testpmd> flow tunnel list 0 list 1

Current patch fixed that fault. Correct tunnel commands syntax is:
testpmd> flow tunnel create <port> type <tunnel type>
testpmd> flow tunnel list <port>
testpmd> flow tunnel destroy <port> id <tunnel id>

Fixes: 1b9f274623b8 ("app/testpmd: add commands for tunnel offload")

Signed-off-by: Gregory Etelson <getelson@nvidia.com>
Acked-by: Ori Kam <orika@nvidia.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
4 years agocommon/mlx5: fix name for ConnectX VF device ID
Raslan Darawsheh [Thu, 19 Nov 2020 08:06:10 +0000 (10:06 +0200)]
common/mlx5: fix name for ConnectX VF device ID

Starting ConnectX-6 Dx, the VF device ID is generic
and not per chip.

https://pci-ids.ucw.cz/v2.2/pci.ids
101e  ConnectX Family mlx5Gen Virtual Function

This means that all will have the same VF device ID.

Fixes: 5fc66630bed5 ("net/mlx5: add ConnectX6-DX device ID")
Cc: stable@dpdk.org
Signed-off-by: Raslan Darawsheh <rasland@nvidia.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
4 years agonet/mlx5: fix restore info in non-tunnel traffic
Gregory Etelson [Wed, 18 Nov 2020 18:23:59 +0000 (20:23 +0200)]
net/mlx5: fix restore info in non-tunnel traffic

Tunnel offload API provides applications with ability to restore
packet outer headers after partial offload. Exact feature execution
depends on hardware abilities and PMD implementation. Hardware that is
supported by MLX5 PMD places a mark on a packet after partial offload.
PMD decodes that mark and provides application with required
information.
Application can call the restore API for packets that are part of
offloaded tunnel and not. It's up to a PMD to provide correct
information.
Current MLX5 tunnel offload implementation does not allow applications
to use flow MARK actions. It is restricted to tunnel offload use only.
This fault was triggered by application that did not activate tunnel
offload and called the restore API with a marked packet. The PMD tried
to decode the mark value and crashed. The patch decodes mark value
only if tunnel offload is active.

Fixes: 4ec6360de37d ("net/mlx5: implement tunnel offload")

Signed-off-by: Gregory Etelson <getelson@nvidia.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
4 years agonet/mlx5: fix eCPRI item value with mask
Bing Zhao [Thu, 19 Nov 2020 02:41:32 +0000 (10:41 +0800)]
net/mlx5: fix eCPRI item value with mask

When creating a flow with eCPRI item, the mask and the value are both
needed in order to build the matching criteria.

In the current implementation, the unused value bits clear operation
was missed when filling the mask and value fields. For the value, the
bits not required were not masked with the mask provided. Indeed,
this action is not mandatory. But when creating a flow in the root
table, the kernel driver got involved and a check would prevent this
flow from being created. The same flow could be created successfully
with the userspace rdma-core on the non-root tables.

An AND operation needs to be added to clear the unused bits in the
value when building the matching criteria. Then the same flow can be
created successfully no matter with kernel driver or with rdma-core.

Fixes: daa38a8924a0 ("net/mlx5: add flow translation of eCPRI header")
Cc: stable@dpdk.org
Signed-off-by: Bing Zhao <bingz@nvidia.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
4 years agonet/mlx5: fix sample and mirror flow action deletion
Suanming Mou [Thu, 19 Nov 2020 01:19:47 +0000 (09:19 +0800)]
net/mlx5: fix sample and mirror flow action deletion

The sample and mirror action objects are maintained on the list
shared between the ports belonging to the same multiport Infiniband
device(between representors).

The actions in the NIC steering domains might contain the references
to the sub-flow action objects created over the given port. The action
deletion might happen in the context of the different port and on the
deletion of referenced objects the incorrect port might be specified.
To avoid this we should save the port on what the sub-flow actions
were created and then use this saved port for sub-flow action release.

This commit saves the create device in the sample and mirror actions
struct to avoid using the incorrect port device in releasing.

Fixes: 19784141692e ("net/mlx5: make sample and mirror action thread safe")

Signed-off-by: Suanming Mou <suanmingm@nvidia.com>
Reviewed-by: Jiawei Wang <jiaweiw@nvidia.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
4 years agonet/mlx5: fix header reformat action hash key
Suanming Mou [Wed, 18 Nov 2020 02:20:24 +0000 (10:20 +0800)]
net/mlx5: fix header reformat action hash key

Currently, header reformat action uses the hash list 32-bit key
generated in header reformat register function directly. The key will
not be recalculated in the hash list function.

As the 64-bit key is composed of the 32-bit attributes and 32-bit
reformat buffer csum, the hash list function only gets 32-bit key
directly will take the attribute part only, csum part will be ignored.
For different header reformat actions, the attributes can be the same,
while the buffer will be different. Only take the attribute part causes
lots of the conflicts.

This commits adds the attribute part and the significant different csum
part for the key.

Fixes: f961fd490fd4 ("net/mlx5: make header reformat action thread safe")

Signed-off-by: Suanming Mou <suanmingm@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
4 years agonet/mlx5: fix raw encap/decap limit
Viacheslav Ovsiienko [Wed, 18 Nov 2020 07:37:30 +0000 (07:37 +0000)]
net/mlx5: fix raw encap/decap limit

The MLX5_ENCAPSULATION_DECISION_SIZE constant is used
to check the raw encap/decap actions for the raw header
size. The header is constructed of the rte_xxx_hdr
structures instead of rte items. Hence, constant
must be defined with rte_xxx_hdr structure sizes.

Fixes: 50f576d657d7 ("net/mlx5: fix VLAN actions in meter")
Cc: stable@dpdk.org
Signed-off-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
Acked-by: Ori Kam <orika@nvidia.com>
Acked-by: Suanming Mou <suanmingm@nvidia.com>
4 years agonet/af_xdp: document 32-bit OS kernel requirement
Ciara Loftus [Tue, 17 Nov 2020 14:07:41 +0000 (14:07 +0000)]
net/af_xdp: document 32-bit OS kernel requirement

AF_XDP will not work on 32-bit kernels before version 5.4.
Document this restriction in the driver guide.

Signed-off-by: Ciara Loftus <ciara.loftus@intel.com>
4 years agoethdev: add eCPRI RSS offload type
Simei Su [Wed, 18 Nov 2020 01:34:48 +0000 (09:34 +0800)]
ethdev: add eCPRI RSS offload type

This patch defines new RSS offload types for eCPRI. For eCPRI with
Message Type 0, the hash field is physical channel ID.

Signed-off-by: Simei Su <simei.su@intel.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
4 years agonet/mlx5: set representor to first PF in bonding mode
Xueming Li [Tue, 17 Nov 2020 11:01:38 +0000 (11:01 +0000)]
net/mlx5: set representor to first PF in bonding mode

When the representor device was set to PF1 in bonding mode, iterating
device iterator that looking for representors by bonding device failed
to match PF0 pci address with PF1 address. So detaching PF bonding
device only detached all representors on PF0.

This patch registers all representors of PF1 with PF0 as PCI device.

Signed-off-by: Xueming Li <xuemingl@nvidia.com>
Reviewed-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
4 years agonet/mlx5: fix flow index type
Xueming Li [Tue, 17 Nov 2020 11:01:23 +0000 (11:01 +0000)]
net/mlx5: fix flow index type

Fix assertion check warnings.

Fixes: 8bb81f2649b1 ("net/mlx5: use thread specific flow workspace")
Cc: stable@dpdk.org
Signed-off-by: Xueming Li <xuemingl@nvidia.com>
Reviewed-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
4 years agonet/mlx5: fix WQE counter assert in free completion queue
Alexander Kozyrev [Mon, 16 Nov 2020 19:48:15 +0000 (19:48 +0000)]
net/mlx5: fix WQE counter assert in free completion queue

The following assertion fails in case RTE_ENABLE_ASSERT is enabled:
PANIC in mlx5_tx_handle_completion():
assert "(txq->fcqs[txq->cq_ci & txq->cqe_m] >> 16)
== cqe->wqe_counter" failed

The free completion queue only contains an expected WQE counter if
RTE_LIBRTE_MLX5_DEBUG is enabled as well. Thus enabling
RTE_ENABLE_ASSERT alone causes the assert to fail.

Compile the assert conditionally only if RTE_ENABLE_ASSERT is enabled.

Fixes: 0afacb04f506 ("common/mlx5: remove NDEBUG")
Cc: stable@dpdk.org
Signed-off-by: Alexander Kozyrev <akozyrev@nvidia.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
4 years agonet/mlx5: add wire vport hint
Viacheslav Ovsiienko [Fri, 13 Nov 2020 15:32:52 +0000 (15:32 +0000)]
net/mlx5: add wire vport hint

The kernel can use two approaches to distinguish the E-Switch
source vport in the packet metadata - either with dedicated
source_port field or register C0. To eliminate the extra source
vport matching in the hardware the source_port field can be
set to specific values (0xFFFF) for the wire source port.

This match can be applied to recognize wire port only in FDB
domain. Missing the register C0 match in the NIC Rx domain causes
incorrect representor steering within shared IB device ports
and must be always specified (if kernel uses this approach).

Signed-off-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
4 years agocommon/octeontx2: fix mbox response by syncing data types
Harman Kalra [Mon, 16 Nov 2020 14:41:55 +0000 (20:11 +0530)]
common/octeontx2: fix mbox response by syncing data types

Syncing the data types of msix offset mbox response structure
fields wrt rvu_pfvf structure as in msix offset mbox handler,
respective block LFs response field is initialised with rvu_pfvf
and mismatch in the data types of respective fields may lead
to issues.

This mismatch in data types resulted in a bug where no sso msix
offsets are returned. For 256 SSO hwgrps, 256 msix offsets
are required, but since num of sso lf field (rsp->sso) in
response structure is u8 and is initialised with same field
in pfvf structure viz u16, value 256 corresponds to 0 hence
no sso_msixoff.
Similar mbox changes are required in kernel side also which are
available in marvell SDK version SDK-11.0.

Fixes: 2b71657c8660 ("common/octeontx2: add mbox request and response definition")
Cc: stable@dpdk.org
Signed-off-by: Harman Kalra <hkalra@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
4 years agonet/mlx5: fix Rx descriptor status
Didier Pallard [Tue, 17 Nov 2020 11:26:47 +0000 (12:26 +0100)]
net/mlx5: fix Rx descriptor status

Three bugs in rx_queue_count function:
- One entry may contain several segments, so 'used' must be multiplied
  by number of segments per entry to properly reflect the queue usage.
- The number of cqes is equals to (1U << rxq->elts_n) - 1 in SPRQ mode.
  The range returned by rx_queue_count should be the number of entries
  used in queue, so it ranges from 0 to max number of entries
  in queue, not this number minus one.
- For MPRQ mode, we need to take into account of the number of strd.

Fixes: 8788fec1f269 ("net/mlx5: implement descriptor status API")
Cc: stable@dpdk.org
Signed-off-by: Didier Pallard <didier.pallard@6wind.com>
Signed-off-by: Maxime Leroy <maxime.leroy@6wind.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
4 years agonet/mlx5: fix Rx queue count calculation
Maxime Leroy [Tue, 17 Nov 2020 11:26:46 +0000 (12:26 +0100)]
net/mlx5: fix Rx queue count calculation

The commit d2d57605522d ("net/mlx5: fix Rx queue count calculation") is
incorrect because the count calculation is wrong for the next cqe:

Example:

 Compressed Set of packets 1  |   Compressed Set of packets 2
C | a | e0 | e1 | e2 | e3 | e4 | e5 | C | a | e0

There are 2 compressed set of packets in the first queue. For the first
set, n is computed correctly.

But for the second, n is not computed properly. Because the zip context
is for the first set. The  second set is not yet decompressed, so
there are no context.

To fix the issue, we should only use the zip context for the first CQEs
series.

Fixes: d2d57605522d ("net/mlx5: fix Rx queue count calculation")
Cc: stable@dpdk.org
Signed-off-by: Maxime Leroy <maxime.leroy@6wind.com>
Signed-off-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
4 years agonet/mlx5: fix RSS queue type validation
Xiaoyu Min [Mon, 16 Nov 2020 02:07:59 +0000 (10:07 +0800)]
net/mlx5: fix RSS queue type validation

When the RSS queues' types are not uniformed, i.e, mixed with normal Rx
queue and hairpin queue, PMD accept this flow after commit[1] instead of
rejecting it.

This because commit[1] creates Rx queue object as DevX type via DevX API
instead of IBV type via Verbs, in which the latter will check the queues'
type when creating Verbs ind table but the former doesn't check when
creating DevX ind table.

However, in any case, logically PMD should check whether the input
configuration of RSS action is reasonable or not, which should
include queues' type check as well as the others.

So add the check of RSS queues' type in validation function to fix issue.

[1]:
commit 6deb19e1b2d2 ("net/mlx5: separate Rx queue object creations")

Fixes: 63bd16292c3a ("net/mlx5: support RSS on hairpin")
Cc: stable@dpdk.org
Signed-off-by: Xiaoyu Min <jackmin@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
4 years agonet/mlx5: fix Rx packet padding config via DevX
Alexander Kozyrev [Sun, 15 Nov 2020 14:25:34 +0000 (14:25 +0000)]
net/mlx5: fix Rx packet padding config via DevX

Received packets can be aligned to the size of the cache line on
PCI transactions. This could improve performance by avoiding
partial cache line writes in exchange for increased PCI bandwidth.

This feature is supposed to be controlled by the rxq_pkt_pad_en
devarg and it is true for an RxQ created via the Verbs API.
But in the DevX API case, it is erroneously controlled by the
rxq_cqe_pad_en devarg instead, which is in charge of the CQE
padding instead and should not control the RxQ creation.

Fix DevX RxQ creation by using the proper configuration flag for
Rx packet padding that is being set by the rxq_pkt_pad_en devarg.

Fixes: dc9ceff73c99 ("net/mlx5: create advanced RxQ via DevX")
Cc: stable@dpdk.org
Signed-off-by: Alexander Kozyrev <akozyrev@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
4 years agonet/mlx5: fix crash in tunnel offload setup
Gregory Etelson [Mon, 16 Nov 2020 14:02:23 +0000 (16:02 +0200)]
net/mlx5: fix crash in tunnel offload setup

The new flow table resource management API triggered a PMD crash in
tunnel offload mode, when tunnel match flow rule was inserted before
tunnel set rule.

Reason for the crash was double flow table registration. The table was
registered by the tunnel offload code for the first time and once
more by PMD code, as part of general table processing. The table
counter was decremented only once during the rule destruction and
caused a resource leak that triggered the crash.

The patch updates PMD registration with tunnel offload parameters and
removes table registration in tunnel related code.

Fixes: afd7a62514ad ("net/mlx5: make flow table cache thread safe")

Signed-off-by: Gregory Etelson <getelson@nvidia.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
4 years agonet/mlx5: fix tunnel offload hub multi-thread protection
Gregory Etelson [Mon, 16 Nov 2020 14:02:22 +0000 (16:02 +0200)]
net/mlx5: fix tunnel offload hub multi-thread protection

The original patch was removing active tunnel offload objects from a
tunnels db list without checking its reference counter value.
That action was leading to a PMD crash.

Current patch isolates tunnels db list into a separate API. That API
manages MT protection of the tunnel offload db.

Fixes: 5b38d8cd4663 ("net/mlx5: make tunnel hub list thread safe")

Signed-off-by: Gregory Etelson <getelson@nvidia.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
4 years agonet/mlx5: fix tunnel offload object allocation
Gregory Etelson [Mon, 16 Nov 2020 14:02:21 +0000 (16:02 +0200)]
net/mlx5: fix tunnel offload object allocation

The original patch allocated tunnel offload objects with invalid
indexes. As the result, PMD tunnel object allocation failed.

In this patch indexed pool provides both an index and memory for a new
tunnel offload object.
Also tunnel offload ipool moved to dv enabled code only.

Fixes: 4ae8825c5085 ("net/mlx5: use indexed pool as id generator")

Signed-off-by: Gregory Etelson <getelson@nvidia.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
4 years agonet/mlx5: fix structure passing method in function call
Gregory Etelson [Mon, 16 Nov 2020 14:02:20 +0000 (16:02 +0200)]
net/mlx5: fix structure passing method in function call

Tunnel offload implementation introduced 64 bit-field flow_grp_info
structure. Since the structure size is 64 bits, the code passed that
type by value in function calls.

The patch changes that structure passing method to reference.

Fixes: 4ec6360de37d ("net/mlx5: implement tunnel offload")

Signed-off-by: Gregory Etelson <getelson@nvidia.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
4 years agonet/mlx5: fix build with Direct Verbs disabled
Gregory Etelson [Mon, 16 Nov 2020 14:02:19 +0000 (16:02 +0200)]
net/mlx5: fix build with Direct Verbs disabled

Tunnel offload API is implemented for Direct Verbs environment only.
Current patch re-arranges tunnel related functions for compilation in
non Direct Verbs setups to prevent compilation failures.  The patch
does not introduce new functions.

Fixes: 4ec6360de37d ("net/mlx5: implement tunnel offload")

Signed-off-by: Gregory Etelson <getelson@nvidia.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
4 years agonet/mlx5: fix tunnel offload callback names
Gregory Etelson [Mon, 16 Nov 2020 14:02:18 +0000 (16:02 +0200)]
net/mlx5: fix tunnel offload callback names

Fix mlx5_flow_tunnel_action_release and mlx5_flow_tunnel_item_release
callback names to match tunnel offload names pattern.

Fixes: 4ec6360de37d ("net/mlx5: implement tunnel offload")

Signed-off-by: Gregory Etelson <getelson@nvidia.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
4 years agonet/sfc: rely on native thread safety in flow mechanism
Ivan Malov [Mon, 16 Nov 2020 19:40:29 +0000 (22:40 +0300)]
net/sfc: rely on native thread safety in flow mechanism

The changeset that introduced common flow API thread safety
in fact introduced double locking to this particular PMD as
RTE flow API implementation in the PMD has been thread-safe
since the day zero. State this by setting the corresponding
device flag to skip locking imposed by generic RTE flow API.

Fixes: 80d1a9aff7f6 ("ethdev: make flow API thread safe")

Signed-off-by: Ivan Malov <ivan.malov@oktetlabs.ru>
Acked-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
4 years agonet/sfc: fix double free on encap transfer flow rule path
Ivan Malov [Mon, 16 Nov 2020 19:23:03 +0000 (22:23 +0300)]
net/sfc: fix double free on encap transfer flow rule path

Don't free the outer match spec by its pointer in the parsing context
if it has already been tracked by an entry in the outer rule registry.

Fixes: dadff137931c ("net/sfc: support encap flow items in transfer rules")

Signed-off-by: Ivan Malov <ivan.malov@oktetlabs.ru>
Acked-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
4 years agoexamples/multi_process: add SPDX license tag to makefiles
Bruce Richardson [Mon, 16 Nov 2020 09:33:37 +0000 (09:33 +0000)]
examples/multi_process: add SPDX license tag to makefiles

The makefiles for some of the multi_process example files were missing
SPDX license headers, so add them. These Makefiles completely replaced
the older makefiles and were written from scratch, not based on previous
versions, so add a new copyright year on them.

Fixes: 13abe17c3cd4 ("examples/multi_process: convert to pkg-config-based build")

Suggested-by: Stephen Hemminger <stephen@networkplumber.org>
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
4 years agodevtools: rename build test verbosity variables
Thomas Monjalon [Tue, 17 Nov 2020 10:38:26 +0000 (11:38 +0100)]
devtools: rename build test verbosity variables

The verbosity was meant to be set with options -v and -vv,
or possibly with the environment variables TEST_MESON_BUILD_VERBOSE
and TEST_MESON_BUILD_VERY_VERBOSE.

It is decided to keep only the options -v and -vv,
so the variables are renamed with lower case, marking them as privates.

The handling of the verbosity level is also moved upper in the script,
closer to other initializations.

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Reviewed-by: David Marchand <david.marchand@redhat.com>
4 years agobuild: align wording of non-support reasons
Thomas Monjalon [Fri, 6 Nov 2020 17:08:32 +0000 (18:08 +0100)]
build: align wording of non-support reasons

Reasons for building not supported generally start with lowercase
because printed as the second part of a line.

Other changes:
- "linux" should be "Linux" with a capital letter.
- ARCH_X86_64 may be simply x86_64.
- aarch64 is preferred over arm64.

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Acked-by: David Marchand <david.marchand@redhat.com>
4 years agoeal/windows: remove definition of ETOOMANYREFS
Tal Shnaiderman [Thu, 19 Nov 2020 15:43:10 +0000 (17:43 +0200)]
eal/windows: remove definition of ETOOMANYREFS

The definition of ETOOMANYREFS is reverted as it breaks build of
external applications already defining it.

Fixes: c917b54b0c74 ("eal/windows: add definition of ETOOMANYREFS")

Signed-off-by: Tal Shnaiderman <talshn@nvidia.com>
Reviewed-by: Nick Connolly <nick.connolly@mayadata.io>
Acked-by: Dmitry Kozlyuk <dmitry.kozliuk@gmail.com>
4 years agodoc: fix subport configuration in ip pipeline guide
Savinay Dharmappa [Tue, 17 Nov 2020 10:16:08 +0000 (10:16 +0000)]
doc: fix subport configuration in ip pipeline guide

Update the user guide of ip pipeline sample application
to reflect the changes in command line arguments.

Fixes: 54a298e5f7f4 ("examples/ip_pipeline: update subport rate dynamically")

Signed-off-by: Savinay Dharmappa <savinay.dharmappa@intel.com>
Acked-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
4 years agoexamples/qos_sched: fix subport configuration
Savinay Dharmappa [Tue, 17 Nov 2020 10:06:05 +0000 (10:06 +0000)]
examples/qos_sched: fix subport configuration

Update the qos_sched user guide and profile config file
with default subport profile.

Fixes: 802d214dc880 ("examples/qos_sched: update subport rate dynamically")

Signed-off-by: Savinay Dharmappa <savinay.dharmappa@intel.com>
Acked-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
4 years agodoc: fix rule file parameters in l3fwd-acl guide
Ibtisam Tariq [Mon, 2 Nov 2020 11:19:15 +0000 (11:19 +0000)]
doc: fix rule file parameters in l3fwd-acl guide

Add "--" and remove extra spaces in l3fwd-acl commands.

Fixes: d0dff9ba445e ("doc: sample application user guide")
Cc: stable@dpdk.org
Signed-off-by: Ibtisam Tariq <ibtisam.tariq@emumba.com>
Reviewed-by: David Marchand <david.marchand@redhat.com>
4 years agodoc: allow external build
Anatoly Burakov [Thu, 19 Nov 2020 10:41:56 +0000 (10:41 +0000)]
doc: allow external build

Currently, when building sphinx documentation, the build will only
succeed if being run from the build system, because the conf.py script
expects DPDK_VERSION environment variable to be set, and crashes if it
is not.

However, there are certain external tools (such as sphinx documentation
preview extensions for certain IDE's) that use live preview and thus
rely on running their own sphinx commands. In these cases, it is useful
to permit building sphinx documentation without specifying the
DPDK_VERSION environment variable. The version string is the only thing
preventing manual sphinx build commands from working.

Fix the conf.py to use "None" as a version string in cases when
DPDK_VERSION environment variable is not set.

Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
4 years agobus/pci: fix comment explaining device naming
Gaetan Rivet [Mon, 16 Nov 2020 10:12:12 +0000 (11:12 +0100)]
bus/pci: fix comment explaining device naming

The original triple negative was hard to read and the attempt
to improve the formulation was commendable, unfortunately the new
comment is the inverse of correct.

Fixes: a65a34a85ebf ("eal: replace usage of blacklist/whitelist in enums")

Reported-by: David Marchand <david.marchand@redhat.com>
Signed-off-by: Gaetan Rivet <grive@u256.net>
Acked-by: Luca Boccassi <bluca@debian.org>
Reviewed-by: David Marchand <david.marchand@redhat.com>
4 years agobus/vdev: fix comment
David Marchand [Mon, 16 Nov 2020 10:06:18 +0000 (11:06 +0100)]
bus/vdev: fix comment

RTE_DEV_WHITELISTED is now replaced with RTE_DEV_ALLOWED.

Fixes: a65a34a85ebf ("eal: replace usage of blacklist/whitelist in enums")

Signed-off-by: David Marchand <david.marchand@redhat.com>
Acked-by: Thomas Monjalon <thomas@monjalon.net>
4 years agodoc: fix coremask option for eventdev pipeline
David Marchand [Mon, 16 Nov 2020 10:06:17 +0000 (11:06 +0100)]
doc: fix coremask option for eventdev pipeline

-w option in this context is an application option for coremask.
Restore it.

Fixes: db27370b5720 ("eal: replace blacklist/whitelist options")

Signed-off-by: David Marchand <david.marchand@redhat.com>
Acked-by: Thomas Monjalon <thomas@monjalon.net>
4 years agotest/eal: remove unneeded command
David Marchand [Mon, 16 Nov 2020 10:06:16 +0000 (11:06 +0100)]
test/eal: remove unneeded command

All EAL flags tests are run by calling the "eal_flags_autotest" command.
There is no compatibility to maintain for sub commands only called by
meson.

Fixes: db27370b5720 ("eal: replace blacklist/whitelist options")

Signed-off-by: David Marchand <david.marchand@redhat.com>
Acked-by: Thomas Monjalon <thomas@monjalon.net>
4 years agoversion: 20.11-rc4
Thomas Monjalon [Sun, 15 Nov 2020 23:12:26 +0000 (00:12 +0100)]
version: 20.11-rc4

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
4 years agoeal/windows: add definition of ETOOMANYREFS
Tal Shnaiderman [Sat, 14 Nov 2020 22:21:29 +0000 (00:21 +0200)]
eal/windows: add definition of ETOOMANYREFS

The ETOOMANYREFS errno was missing from the Windows build.
It is used in initialization of flow error structures.

It is defined with the same error code used by WSAETOOMANYREFS.

Signed-off-by: Tal Shnaiderman <talshn@nvidia.com>
Acked-by: Dmitry Kozlyuk <dmitry.kozliuk@gmail.com>
4 years agodoc: replace usage of blacklist/whitelist
Stephen Hemminger [Tue, 10 Nov 2020 22:55:40 +0000 (14:55 -0800)]
doc: replace usage of blacklist/whitelist

The words blacklist and whitelist are avoided in text
about MAC filtering or kernel module.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Luca Boccassi <bluca@debian.org>
Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
4 years agotest: rename blacklist/whitelist in autotest scripts
Stephen Hemminger [Tue, 10 Nov 2020 22:55:40 +0000 (14:55 -0800)]
test: rename blacklist/whitelist in autotest scripts

The options and variables are renamed to use block/allow terminology.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Luca Boccassi <bluca@debian.org>
Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
4 years agoeal: replace blacklist/whitelist options
Stephen Hemminger [Tue, 10 Nov 2020 22:55:40 +0000 (14:55 -0800)]
eal: replace blacklist/whitelist options

Replace -w / --pci-whitelist with -a / --allow options
and --pci-blacklist with --block.
The -b short option remains unchanged.

Allow the old options for now, but print a nag
warning since old options are deprecated.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Luca Boccassi <bluca@debian.org>
Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
4 years agoeal: replace usage of blacklist/whitelist in enums
Stephen Hemminger [Tue, 10 Nov 2020 22:55:38 +0000 (14:55 -0800)]
eal: replace usage of blacklist/whitelist in enums

Rename the enum values in the EAL include files.
As a backward compatible temporary migration tool, define
a replacement mapping for old values.

The old names relating to blacklist and whitelist are replaced
by block list and allow list, but applications may be using the
older compatibility macros, marked as deprecated.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Luca Boccassi <bluca@debian.org>
Acked-by: Gaetan Rivet <grive@u256.net>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
4 years agopipeline: fix multiple SWX emit pattern detection
Cristian Dumitrescu [Thu, 12 Nov 2020 14:50:13 +0000 (14:50 +0000)]
pipeline: fix multiple SWX emit pattern detection

Fix the detection of instruction pattern with multiple emits followed
by TX. Once detected, this is one of the instruction patterns that is
internally replaced with a single optimized instruction, as long as
none of the instructions to be replaced is referenced by a jump
instruction. The fix enforces this check for the TX instruction of
the pattern.

Fixes: 31035e87b207 ("pipeline: add SWX instruction optimizer")

Signed-off-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
4 years agotest/ring: remove unused code
Honnappa Nagarahalli [Mon, 2 Nov 2020 19:56:59 +0000 (13:56 -0600)]
test/ring: remove unused code

Remove unused assignment statement as the assigned variable is
not used in the code further.

Coverity issue: 363690
Fixes: 6c583103a2d1 ("test/ring: factorize object checks")

Signed-off-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
Reviewed-by: Feifei Wang <feifei.wang2@arm.com>
Reviewed-by: Ruifeng Wang <ruifeng.wang@arm.com>
4 years agotest/ring: fix build for O1 optimization
Conor Walsh [Tue, 10 Nov 2020 11:03:13 +0000 (11:03 +0000)]
test/ring: fix build for O1 optimization

When DPDK is compiled with gcc < 9 with the optimization level set to 1
gcc sees zcd in test_ring.h as possibly being uninitialised. To correct
this error if statements from _st_ring_dequeue_bulk and
_st_ring_enqueue_bulk were corrected within test_ring_mt_peek_stress_zc.c

Fixes: f72299fd157d ("test/ring: add stress tests for zero copy API")

Signed-off-by: Conor Walsh <conor.walsh@intel.com>
Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
4 years agoexamples: restore trace point
David Marchand [Sat, 14 Nov 2020 09:05:33 +0000 (10:05 +0100)]
examples: restore trace point

Before make removal, those examples were built with experimental flag
for tracepoints to be compiled in but the pkg-config part of those
makefiles were missed.

Fixes: 78d44153de8f ("ethdev: add tracepoints")
Cc: stable@dpdk.org
Signed-off-by: David Marchand <david.marchand@redhat.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
4 years agoexamples/rxtx_callbacks: fix build with pkg-config
David Marchand [Sat, 14 Nov 2020 09:05:32 +0000 (10:05 +0100)]
examples/rxtx_callbacks: fix build with pkg-config

This example is missing the experimental flag since it uses an
experimental API.

Fixes: cd1dadeb9b2a ("examples/rxtx_callbacks: support HW timestamp")
Cc: stable@dpdk.org
Signed-off-by: David Marchand <david.marchand@redhat.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
4 years agoexamples/vhost_blk: fix build with pkg-config
David Marchand [Sat, 14 Nov 2020 09:05:31 +0000 (10:05 +0100)]
examples/vhost_blk: fix build with pkg-config

vhost_blk.c: In function ‘ctrlr_worker’:
vhost_blk.c:543:2: warning: implicit declaration of function ‘CPU_ZERO’
[-Wimplicit-function-declaration]
  543 |  CPU_ZERO(&cpuset);
      |  ^~~~~~~~
vhost_blk.c:544:2: warning: implicit declaration of function ‘CPU_SET’
[-Wimplicit-function-declaration]
  544 |  CPU_SET(0, &cpuset);
      |  ^~~~~~~
vhost_blk.c:545:2: warning: implicit declaration of function
‘pthread_setaffinity_np’ [-Wimplicit-function-declaration]
  545 |  pthread_setaffinity_np(thread, sizeof(cpu_set_t), &cpuset);
      |  ^~~~~~~~~~~~~~~~~~~~~~
/usr/bin/ld: /tmp/cczpiMWH.o: in function `ctrlr_worker':
vhost_blk.c:(.text+0x1076): undefined reference to `CPU_ZERO'
/usr/bin/ld: vhost_blk.c:(.text+0x1082): undefined reference to
`CPU_SET'
collect2: error: ld returned 1 exit status
gmake: *** [Makefile:34: build/vhost-blk-shared] Error 1

Explicitly pass _GNU_SOURCE and include missing headers (rather than
rely on automagic inclusion from other system headers).

Fixes: c19beb3f38cd ("examples/vhost_blk: introduce vhost storage sample")
Cc: stable@dpdk.org
Signed-off-by: David Marchand <david.marchand@redhat.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
4 years agoexamples/performance-thread: fix build with pkg-config
David Marchand [Sat, 14 Nov 2020 09:05:30 +0000 (10:05 +0100)]
examples/performance-thread: fix build with pkg-config

main.c: In function ‘lthread_tx’:
main.c:2091:25: error: implicit declaration of function ‘sched_getcpu’;
 did you mean ‘sched_getparam’? [-Werror=implicit-function-declaration]
 2091 |  tx_conf->conf.cpu_id = sched_getcpu();
      |                         ^~~~~~~~~~~~
      |                         sched_getparam
cc1: all warnings being treated as errors

Explicitly pass _GNU_SOURCE and include missing header (rather than
rely on automagic inclusion from other system headers).

Fixes: d48415e1fee3 ("examples/performance-thread: add l3fwd-thread app")
Cc: stable@dpdk.org
Signed-off-by: David Marchand <david.marchand@redhat.com>
4 years agoexamples/ntb: fix clean target
David Marchand [Sat, 14 Nov 2020 09:05:29 +0000 (10:05 +0100)]
examples/ntb: fix clean target

When introducing this example, the cleanup from commit 7e9562a107f1
("examples: fix make clean when using pkg-config") was missed.

Fixes: c5eebf85badc ("examples/ntb: add example for NTB")
Cc: stable@dpdk.org
Signed-off-by: David Marchand <david.marchand@redhat.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Xiaoyun Li <xiaoyun.li@intel.com>
4 years agoexamples/l3fwd-graph: fix pkg-config usage
David Marchand [Sat, 14 Nov 2020 09:05:28 +0000 (10:05 +0100)]
examples/l3fwd-graph: fix pkg-config usage

This example missed the fixes from commit 69b1bb49ed82
("examples: hide error for missing pkg-config path flag") and
commit 12a652a02b08 ("examples: fix build with old pkg-config").

Fixes: 08bd1a174461 ("examples/l3fwd-graph: add graph-based l3fwd skeleton")
Cc: stable@dpdk.org
Signed-off-by: David Marchand <david.marchand@redhat.com>
4 years agoexamples/l3fwd-graph: fix static build
David Marchand [Sat, 14 Nov 2020 09:05:27 +0000 (10:05 +0100)]
examples/l3fwd-graph: fix static build

This example missed the rework from commit 8549295db07b
("build/pkg-config: improve static linking flags").

Fixes: 08bd1a174461 ("examples/l3fwd-graph: add graph-based l3fwd skeleton")
Cc: stable@dpdk.org
Signed-off-by: David Marchand <david.marchand@redhat.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
4 years agoexamples/l2fwd-crypto: fix build with pkg-config
David Marchand [Sat, 14 Nov 2020 09:05:26 +0000 (10:05 +0100)]
examples/l2fwd-crypto: fix build with pkg-config

Two issues fixed here.

First add the experimental flag.
Then fix a link issue with the crypto scheduler driver:
/usr/bin/ld: /tmp/cchr7aHA.o: in function `main':
main.c:(.text.startup+0x1673): undefined reference to
`rte_cryptodev_scheduler_workers_get'
collect2: error: ld returned 1 exit status

Fixes: e3bcb99a5e13 ("examples/l2fwd-crypto: limit number of sessions")
Fixes: 261bbff75e34 ("examples: use separate crypto session mempools")
Cc: stable@dpdk.org
Signed-off-by: David Marchand <david.marchand@redhat.com>
4 years agoexamples/kni: fix build with pkg-config
David Marchand [Sat, 14 Nov 2020 09:05:25 +0000 (10:05 +0100)]
examples/kni: fix build with pkg-config

rm -f build/kni build/kni-static build/kni-shared
test -d build && rmdir -p build || true
[...]
/usr/bin/ld: /tmp/cc72ssnK.o: undefined reference to symbol
'pthread_join@@GLIBC_2.2.5'

This example explicitly call pthread API and should be linked against
the pthread library.

Fixes: 724beb913b44 ("examples/kni: monitor and update link state continually")
Cc: stable@dpdk.org
Signed-off-by: David Marchand <david.marchand@redhat.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
4 years agoexamples/ipsec-gw: fix build with pkg-config
David Marchand [Sat, 14 Nov 2020 09:05:24 +0000 (10:05 +0100)]
examples/ipsec-gw: fix build with pkg-config

flow.c: In function ‘parse_flow_tokens’:
flow.c:153:23: error: taking address of packed member of ‘struct
rte_ipv4_hdr’ may result in an unaligned pointer value
[-Werror=address-of-packed-member]
  153 |     if (ipv4_addr_cpy(&rule->ipv4.spec.hdr.src_addr,
      |                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
flow.c:154:9: error: taking address of packed member of ‘struct
rte_ipv4_hdr’ may result in an unaligned pointer value
[-Werror=address-of-packed-member]
  154 |         &rule->ipv4.mask.hdr.src_addr,
      |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
flow.c:170:23: error: taking address of packed member of ‘struct
rte_ipv4_hdr’ may result in an unaligned pointer value
[-Werror=address-of-packed-member]
  170 |     if (ipv4_addr_cpy(&rule->ipv4.spec.hdr.dst_addr,
      |                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
flow.c:171:9: error: taking address of packed member of ‘struct
rte_ipv4_hdr’ may result in an unaligned pointer value
[-Werror=address-of-packed-member]
  171 |         &rule->ipv4.mask.hdr.dst_addr,
      |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
cc1: all warnings being treated as errors

Meson build is fine since we waive those warnings.
Replicate it for make.

Fixes: 8e693616fcb2 ("examples/ipsec-secgw: enable flow based distribution")
Cc: stable@dpdk.org
Signed-off-by: David Marchand <david.marchand@redhat.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
4 years agoexamples/fips_validation: fix build with pkg-config
David Marchand [Sat, 14 Nov 2020 09:05:23 +0000 (10:05 +0100)]
examples/fips_validation: fix build with pkg-config

When this example started using rte_cryptodev_sym_session_pool_create,
the part for pkg-config builds was not updated.

Fixes: 261bbff75e34 ("examples: use separate crypto session mempools")
Cc: stable@dpdk.org
Signed-off-by: David Marchand <david.marchand@redhat.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
4 years agoapp/eventdev: check timer adadpters number
Pavan Nikhilesh [Thu, 12 Nov 2020 17:43:29 +0000 (23:13 +0530)]
app/eventdev: check timer adadpters number

Fix SEGFAULT when nb_timer_adapters command line parameter is
set to 0.

Fixes: 98c6292105d4 ("app/eventdev: add options for event timer adapter")
Cc: stable@dpdk.org
Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
4 years agoevent/dlb: remove duplicate/unused PCI code
Timothy McDaniel [Wed, 11 Nov 2020 20:27:02 +0000 (14:27 -0600)]
event/dlb: remove duplicate/unused PCI code

Use rte_pci_find_ext_capability instead of private version,
Remove unused PCI offsets and values
Use PCI definitions from rte_pci.h, where available.

Signed-off-by: Timothy McDaniel <timothy.mcdaniel@intel.com>
4 years agoevent/dlb: skip memzone freeing if port created
Timothy McDaniel [Wed, 11 Nov 2020 20:27:01 +0000 (14:27 -0600)]
event/dlb: skip memzone freeing if port created

Add missing returns so that the memzone free is not called if
port create is successful.

Signed-off-by: Timothy McDaniel <timothy.mcdaniel@intel.com>
Reviewed-by: Mike Ximing Chen <mike.ximing.chen@intel.com>
4 years agoevent/dlb2: remove duplicate/unused PCI code
Timothy McDaniel [Wed, 11 Nov 2020 20:27:00 +0000 (14:27 -0600)]
event/dlb2: remove duplicate/unused PCI code

Use rte_pci_find_ext_capability instead of private version,
Remove unused PCI offsets and values
Use PCI definitions from rte_pci.h, where available.

Signed-off-by: Timothy McDaniel <timothy.mcdaniel@intel.com>
4 years agoevent/dlb2: add delayed token pop logic
Timothy McDaniel [Wed, 11 Nov 2020 20:26:59 +0000 (14:26 -0600)]
event/dlb2: add delayed token pop logic

The code contained in this commit was inadvertently omitted
when dissecting the dlb2 code base into discrete patches for
upstream.

Signed-off-by: Timothy McDaniel <timothy.mcdaniel@intel.com>
Reviewed-by: Mike Ximing Chen <mike.ximing.chen@intel.com>
4 years agodoc: add some features to DLB2 guide
Timothy McDaniel [Thu, 5 Nov 2020 21:22:51 +0000 (15:22 -0600)]
doc: add some features to DLB2 guide

Add queue depth threshold and class of service sections
to DLB2 rst file.

Fixes: 5433956 ("event/dlb2: add eventdev probe")

Signed-off-by: Timothy McDaniel <timothy.mcdaniel@intel.com>
4 years agoevent/dlb2: fix mempool query in self test
Timothy McDaniel [Thu, 5 Nov 2020 21:22:52 +0000 (15:22 -0600)]
event/dlb2: fix mempool query in self test

Add NULL check before using t->mbuf_pool.

Coverity issue: 363719
Fixes: 6f1b828 ("event/dlb2: add self-tests")

Signed-off-by: Timothy McDaniel <timothy.mcdaniel@intel.com>