Commit Graph

27552 Commits

Author SHA1 Message Date
Thomas Monjalon
4113ddd452 devtools: skip removed DLB driver in ABI check
The eventdev driver DLB was removed in DPDK 21.05,
breaking the ABI check.
The exception was agreed so we just need to skip this check.

Note: complete removal of a driver cannot be ignored
in devtools/libabigail.abignore, so the script must be patched.

Fixes: 698fa82941 ("event/dlb: remove driver")

Reported-by: David Marchand <david.marchand@redhat.com>
Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Reviewed-by: David Marchand <david.marchand@redhat.com>
2021-04-13 11:25:56 +02:00
Harman Kalra
340d22cdd1 event/octeontx2: fix device reconfigure for single slot
When device is re-configured, memory allocated for work slot is freed
and new memory is allocated. Due to this we may loose some important
configurations/mappings done with initial work slot memory.

For example, whenever rte_event_eth_tx_adapter_queue_add is called
some important meta i.e. txq handle is stored in work slot structure.
If device gets reconfigured after this tx adaptor add, txq to work
slot mapping will be lost resulting in seg fault during packet
processing, as txq handle could not be retrieved from work slot.

Fixes: 67b5f46864 ("event/octeontx2: add port config functions")
Cc: stable@dpdk.org

Signed-off-by: Harman Kalra <hkalra@marvell.com>
2021-04-12 09:23:34 +02:00
Pavan Nikhilesh
005e6265e0 doc: announce event Rx adapter config changes
The Rx adapter event vector configuration will be merged into
Rx adapter queue configuration to simplify enabling event
vectorization.

Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
Acked-by: Ray Kinsella <mdr@ashroe.eu>
Acked-by: Jerin Jacob <jerinj@marvell.com>
Acked-by: Jay Jayatheerthan <jay.jayatheerthan@intel.com>
2021-04-12 09:23:34 +02:00
Pavan Nikhilesh
2eaa37b866 app/eventdev: add vector mode in pipeline test
Add event vector support in pipeline tests. By default this mode
is disabled, it can be enabled by using the option --enable_vector.
example:
	dpdk-test-eventdev -l 7-23 -s 0xff00 -- --prod_type_ethdev
	--nb_pkts=0 --verbose 2 --test=pipeline_atq --stlist=a
	--wlcores=20-23  --enable_vector

Additional options to configure vector size and vector timeout are
also implemented and can be used by specifying --vector_size and
--vector_tmo_ns

This patch also adds a new option to set the number of Rx queues
configured per event eth rx adapter.
example:
	dpdk-test-eventdev -l 7-23 -s 0xff00 -- --prod_type_ethdev
	--nb_pkts=0 --verbose 2 --test=pipeline_atq --stlist=a
	--wlcores=20-23  --nb_eth_queues 4

Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
2021-04-12 09:23:34 +02:00
Pavan Nikhilesh
bc7d4b0346 eventdev: support Tx adapter event vector
Add event vector support for event eth Tx adapter, the implementation
receives events from the single linked queue and based on
rte_event_vector::attr_valid transmits the vector of mbufs to a given
port, queue pair.

Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
Acked-by: Jay Jayatheerthan <jay.jayatheerthan@intel.com>
2021-04-12 09:23:34 +02:00
Pavan Nikhilesh
d7c428e557 eventdev: support Rx adapter event vector
Add event vector support for event eth Rx adapter, the implementation
creates vector flows based on port and queue identifier of the received
mbufs.
The flow id for SW Rx event vectorization will use 12-bits of queue
identifier and 8-bits port identifier when custom flow id is not set
for simplicity.

Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
Acked-by: Jay Jayatheerthan <jay.jayatheerthan@intel.com>
2021-04-12 09:23:34 +02:00
Pavan Nikhilesh
3da4060a30 eventdev: introduce event vector Tx capability
Introduce event vector transmit capability for event eth
tx adapter.

The capability indicates that the Tx adapter is capable of
transmitting event vectors.
When rte_event_vector::union_valid is set, the Tx adapter should
transmit all the packets to the rte_event_vector::port using the
rte_event_vector::queue.
If rte_event_vector::union_valid is not set then the Tx adapter
should peek into each mbuf to get the destination port and queue
pair.

Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
Acked-by: Jay Jayatheerthan <jay.jayatheerthan@intel.com>
2021-04-12 09:23:34 +02:00
Pavan Nikhilesh
3c838062b9 eventdev: introduce event vector Rx capability
Introduce event ethernet Rx adapter event vector capability.

If an event eth Rx adapter has the capability of
RTE_EVENT_ETH_RX_ADAPTER_CAP_EVENT_VECTOR then a given Rx queue
can be configured to enable event vectorization by passing the
flag RTE_EVENT_ETH_RX_ADAPTER_QUEUE_EVENT_VECTOR to
rte_event_eth_rx_adapter_queue_conf::rx_queue_flags while configuring
Rx adapter through rte_event_eth_rx_adapter_queue_add().

The max vector size, vector timeout define the vector size and
mempool used for allocating vector event are configured through
rte_event_eth_rx_adapter_queue_add. The element size of the element
in the vector pool should be equal to
    sizeof(struct rte_event_vector) + (vector_sz * sizeof(uintptr_t))

Application can use `rte_event_vector_pool_create` to create the
vector mempool used for
rte_event_eth_rx_adapter_queue_conf::vector_mp.

The Rx adapter would be responsible for vectorizing the mbufs
based on the flow, the vector limits configured by the application
and add the vector event of mbufs to the event queue set via
rte_event_eth_rx_adapter_queue_conf::ev::queue_id.
It should also mark rte_event_vector::union_valid and fill
rte_event_vector::port, rte_event_vector::queue.

Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
Acked-by: Ray Kinsella <mdr@ashroe.eu>
Acked-by: Jay Jayatheerthan <jay.jayatheerthan@intel.com>
2021-04-12 09:23:34 +02:00
Pavan Nikhilesh
1cc44d4092 eventdev: introduce event vector capability
Introduce rte_event_vector datastructure which is capable of holding
multiple uintptr_t of the same flow thereby allowing applications
to vectorize their pipeline and reducing the complexity of pipelining
the events across multiple stages.
This approach also reduces the scheduling overhead on a event device.

Add a event vector mempool create handler to create mempools based on
the best mempool ops available on a given platform.

Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
Acked-by: Ray Kinsella <mdr@ashroe.eu>
Acked-by: Jay Jayatheerthan <jay.jayatheerthan@intel.com>
2021-04-12 09:23:34 +02:00
Pavan Nikhilesh
fc00b664e7 event/octeontx2: use always virtual counter for timer
Use virtual counter for estimating current bucket as PMU cannot be
reliably used to estimate time.

Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
2021-04-12 09:23:34 +02:00
Pavan Nikhilesh
94f0159ba7 event/octeontx2: reduce chunk pool memory usage
Reduce amount of memory used by chunk pool when the mempool used
is OCTEONTX2 NPA.
Previously, the number of chunks configured when NPA is used is
equal to the number of timers requested plus the number of buckets
and if the max timeout is long enough w.r.t. resolution requested
there will a large number of buckets which would cause high memory
usage.
Reduce the number of chunks when NPA is used to the number of timers
requested as buckets that are processed chunk lists are automatically
freed.

Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
2021-04-12 09:23:34 +02:00
Pavan Nikhilesh
703c02647b event/octeontx2: optimize timer Arm routine
Use relaxed load exclusive when polling for other threads or
hardware to complete.

Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
2021-04-12 09:23:34 +02:00
Pavan Nikhilesh
25b401c8b6 event/octeontx2: simplify timer bucket estimation
Simplify timer bucket estimation we need not align buckets to
power of 2 instead use reciprocal division to compute mod.

Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
2021-04-12 09:23:34 +02:00
Shijith Thotton
64ea4ae178 event/octeontx2: support timer periodic mode
Add support for periodic mode in event timer adapter.

Signed-off-by: Shijith Thotton <sthotton@marvell.com>
Acked-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
2021-04-12 09:23:34 +02:00
Shijith Thotton
7d761b07fc test/event: add unit tests for periodic timer
Add tests to arm and cancel periodic timer.

Signed-off-by: Shijith Thotton <sthotton@marvell.com>
Acked-by: Erik Gabriel Carrillo <erik.g.carrillo@intel.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
2021-04-12 09:23:34 +02:00
Shijith Thotton
a10d79a60b eventdev: introduce adapter flags for periodic mode
A timer adapter in periodic mode can be used to arm periodic timers.
This patch adds flags used to advertise capability and configure timer
adapter in periodic mode. Capability flag should be set for adapters
which support periodic mode.

Below is a programming sequence on the usage:
	/* check for periodic mode support by reading capability. */
	rte_event_timer_adapter_caps_get(...);

	/* create adapter in periodic mode by setting periodic flag
	   (RTE_EVENT_TIMER_ADAPTER_F_PERIODIC) and resolution. */
	rte_event_timer_adapter_create_ext(...);

	/* arm periodic timer of configured resolution */
	rte_event_timer_arm_burst(...);

	/* timer event will be periodically generated at configured
	   resolution till cancel is called. */
	while (running) { rte_event_dequeue_burst(...); }

	/* cancel periodic timer which stops generating events */
	rte_event_timer_cancel_burst(...);

Signed-off-by: Shijith Thotton <sthotton@marvell.com>
Acked-by: Erik Gabriel Carrillo <erik.g.carrillo@intel.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
2021-04-12 09:23:34 +02:00
Pavan Nikhilesh
626b12a8d3 app/eventdev: fix timeout accuracy
Round timeout ticks when converting from nanoseconds, this prevents
loss of accuracy and deviation from requested timeout value.

Fixes: d008f20bce ("app/eventdev: add event timer adapter as a producer")
Cc: stable@dpdk.org

Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
Reviewed-by: Erik Gabriel Carrillo <erik.g.carrillo@intel.com>
2021-04-12 09:23:34 +02:00
Pavan Nikhilesh
052a5d3867 event/octeontx2: fix XAQ pool reconfigure
When XAQ pool is being re-configured, and if the same memzone
is used for fc_mem when freeing the old mempool the fc_mem
will be incorrectly updated with the free count.

Fixes: ffa4ec0b60 ("event/octeontx2: allow adapters to resize inflight buffers")
Cc: stable@dpdk.org

Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
2021-04-12 09:23:34 +02:00
Timothy McDaniel
698fa82941 event/dlb: remove driver
Remove event/dlb driver from DPDK code base.
Updated release note's removal section to reflect the same.

Also updated doc/guides/rel_notes/release_20_11.rst to fix the
the missing link issue due to removal of doc/guides/eventdevs/dlb.rst

Signed-off-by: Timothy McDaniel <timothy.mcdaniel@intel.com>
2021-04-12 09:21:30 +02:00
Pavan Nikhilesh
41f27795bb test/event: fix timeout accuracy
Round timeout ticks when converting from nanoseconds, this prevents
loss of accuracy and deviation from requested timeout value.

Fixes: d1f3385d00 ("test: add event timer adapter auto-test")
Cc: stable@dpdk.org

Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
Acked-by: Erik Gabriel Carrillo <erik.g.carrillo@intel.com>
2021-04-12 09:19:02 +02:00
Harry van Haaren
324b37e637 event/sw: add xstats to expose progress details
Today it is difficult to know if the SW Eventdev PMD is making
forward progress when it runs an iteration of its service. This
commit adds two xstats to give better visibility to the application.

The new xstats provide an application with which Eventdev ports
received work in the last iteration of scheduling, as well if
forward progress was made by the scheduler.

This patch implements an xstat for the SW PMD that exposes a
bitmask of ports that were scheduled to. In the unlikely case
that the SW PMD instance has 64 or more ports, return UINT64_MAX.

Signed-off-by: Harry van Haaren <harry.van.haaren@intel.com>
2021-04-12 09:19:02 +02:00
Mattias Rönnblom
8b1af885f6 event/dsw: use C11 built-ins for atomics
Use C11-style GCC built-in functions for atomic operations.

Signed-off-by: Mattias Rönnblom <mattias.ronnblom@ericsson.com>
2021-04-12 09:19:02 +02:00
Tal Shnaiderman
13e06abc9d eal/windows: fix return codes of pthread shim layer
The macro definitions of the following pthread functions
return incorrect values from the inner function return code.

While pthread_barrier_init(), pthread_barrier_destroy() and
pthread_cancel() return 0 in a case of success and non-zero (errno) value
otherwise the shimming functions InitializeSynchronizationBarrier,
DeleteSynchronizationBarrier and TerminateThread return FALSE (0)
in a case of failure and TRUE(1) in a case of success.

This issue was undetected as none of the functions return codes were
checked until such check was added in
commit 34cc55cce6 ("eal: fix race in control thread creation")
exposing the issue by failing pthread_barrier_init()
and rte_eal_init() on Windows as a result.

The fix aligned the return value of the 3 function with the expected
pthread API return values.

Fixes: e8428a9d89 ("eal/windows: add some basic functions and macros")
Cc: stable@dpdk.org

Signed-off-by: Tal Shnaiderman <talshn@nvidia.com>
2021-04-12 22:35:31 +02:00
Tal Shnaiderman
8ec36fb17b common/mlx5: add missing internal tags
Several functions introduced in the addition of the Windows support
to mlx5 were missing the __rte_internal tag.
This miss is better revealed when symbols became exported on Linux too,
and it is caught by the symbol checker with --buildtype=debug.

Fixes: 1552fb2871 ("common/mlx5: add alloc/dealloc PD on Windows")
Fixes: 1969ee4244 ("common/mlx5: add UMEM reg/dereg functions on Windows")
Fixes: ba42071982 ("common/mlx5: add reg/dereg MR on Windows")
Fixes: 56ea803e87 ("build: remove Windows export symbol list")
Cc: stable@dpdk.org

Signed-off-by: Tal Shnaiderman <talshn@nvidia.com>
2021-04-12 17:22:51 +02:00
Wisam Jaddo
83f9be10f2 app/flow-perf: fix encap/decap actions
When using decap actions it's been set to the data to decap
into the encap_data instead of decap_data, as a results we end
up with bad encap and decap data in many cases.

Fixes: 0c8f1f4ab9 ("app/flow-perf: support raw encap/decap actions")
Cc: stable@dpdk.org

Signed-off-by: Wisam Jaddo <wisamm@nvidia.com>
Acked-by: Alexander Kozyrev <akozyrev@nvidia.com>
2021-04-12 16:30:50 +02:00
Wisam Jaddo
96923debef app/flow-perf: report first flow latency
Starting from this commit the app will always
report the first flow latency.

This is useful in debugging to check the first
flow insertion before any caching effect.

Signed-off-by: Wisam Jaddo <wisamm@nvidia.com>
Acked-by: Alexander Kozyrev <akozyrev@nvidia.com>
2021-04-12 16:29:59 +02:00
Wisam Jaddo
f2cb939365 app/flow-perf: fix IPv6 source address increment
Currently the memset() will not set a correct src ip that represent
the incremental value of the counter.

This commit will fix this and each flow will have correct IPv6.src
that it's incremental from previous flow and equal to the decimal
values.

Fixes: bf3688f1e8 ("app/flow-perf: add insertion rate calculation")
Cc: stable@dpdk.org

Signed-off-by: Wisam Jaddo <wisamm@nvidia.com>
Acked-by: Alexander Kozyrev <akozyrev@nvidia.com>
2021-04-12 16:26:25 +02:00
Wisam Jaddo
b22a5a1e56 app/flow-perf: skip dumps for masked ports
Take into consideration that the user may call portmask for
any run, thus the app should always check if port is needed
to collect and report or not.

Fixes: 070316d01d ("app/flow-perf: add multi-core rule insertion and deletion")
Fixes: d8099d7ecb ("app/flow-perf: split dump functions")
Cc: stable@dpdk.org

Signed-off-by: Wisam Jaddo <wisamm@nvidia.com>
Acked-by: Alexander Kozyrev <akozyrev@nvidia.com>
2021-04-12 16:22:50 +02:00
Wisam Jaddo
c304358e9d app/flow-perf: rename records of used CPU time
create_flow and create_meter are not correct names since those
are records that contain creation and deletion, which makes
them more of a record for such data.

Fixes: d8099d7ecb ("app/flow-perf: split dump functions")
Cc: stable@dpdk.org

Signed-off-by: Wisam Jaddo <wisamm@nvidia.com>
Acked-by: Alexander Kozyrev <akozyrev@nvidia.com>
2021-04-12 15:54:18 +02:00
Wisam Jaddo
eb4df25f53 app/flow-perf: add runtime option to use unique data
Current support for unique data is to compile with config.h
var FIXED_VALUES as 0, and this is only supported on
compilation time, as a result the user may use only single
mode for each compilation.

Starting with this commit the user will have the ability to
use this feature on the fly by using this new option:
--unique-data

Example of unique data usage:
Insert many rules with different encap data for a flows that
have encap action in it.

Signed-off-by: Wisam Jaddo <wisamm@nvidia.com>
Acked-by: Alexander Kozyrev <akozyrev@nvidia.com>
2021-04-12 15:51:04 +02:00
Wisam Jaddo
b611605b05 app/flow-perf: use more generic wrapper to get cycles
rdtsc() is x86 related, while this might fail for other archs,
so it's better to use more generic API for cycles measurement.

Signed-off-by: Wisam Jaddo <wisamm@nvidia.com>
Acked-by: Alexander Kozyrev <akozyrev@nvidia.com>
2021-04-12 15:50:36 +02:00
Hemant Agrawal
b40d7062ff net/dpaa2: fix RSS distribution size field
RSS distribution field is U64, while the DPAA2 code
was using integer value, which is causing a issue
for MPLS having bit position 33.
This patch fixes the code to use unsigned long long.

Fixes: 1832bc8ee8 ("net/dpaa2: support MPLS distribution")
Cc: stable@dpdk.org

Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
2021-04-09 11:00:30 +02:00
John Daley
5aa67931ec net/enic: fix flow initialization error handling
Fix a rare case in rte_flow initialization where the action hash table
is not freed if allocating a NIC match table fails.

Fixes: ea7768b5bb ("net/enic: add flow implementation based on Flow Manager API")
Cc: stable@dpdk.org

Signed-off-by: John Daley <johndale@cisco.com>
Reviewed-by: Hyong Youb Kim <hyonkim@cisco.com>
2021-04-09 10:54:57 +02:00
Hongbo Zheng
3f3fac61bd net/hns3: fix code style
Add one space before the left brace to solve the static warning.

Fixes: 63e05f19b8 ("net/hns3: support Rx descriptor status query")

Signed-off-by: Hongbo Zheng <zhenghongbo3@huawei.com>
Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
2021-04-08 18:57:09 +02:00
Hongbo Zheng
d7e8b721fc net/hns3: delete redundant blank line
Delete redundant blank line in "hns3vf_check_event_cause" to
solve the static warning.

Fixes: a5475d61fa ("net/hns3: support VF")
Cc: stable@dpdk.org

Signed-off-by: Hongbo Zheng <zhenghongbo3@huawei.com>
Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
2021-04-08 18:57:09 +02:00
Chengwen Feng
214917f66b net/hns3: support get device version when dump register
Support get device version which is equal to the firmware version
when dump register.

Fixes: 936eda25e8 ("net/hns3: support dump register")
Cc: stable@dpdk.org

Signed-off-by: Chengwen Feng <fengchengwen@huawei.com>
Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
2021-04-08 18:57:09 +02:00
Chengwen Feng
38d5b71c27 net/hns3: fix VF mailbox head field
Currently, the VF mailbox synchronization communication is based on
three fields: head/tail/lost, when head equals tail plus lost, it
means the response is received successfully.

The head field indicates the number of requests that are successfully
sent. If the request sending fails, it should not be updated.

This patch fix the above bug by roll back updates when the sending
fails.

Fixes: 463e748964 ("net/hns3: support mailbox")
Cc: stable@dpdk.org

Signed-off-by: Chengwen Feng <fengchengwen@huawei.com>
Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
2021-04-08 18:57:09 +02:00
Chengwen Feng
a06c3b0e9f net/hns3: fix flow counter value
User could create flow rules with specified counter by the action of
RTE_FLOW_ACTION_TYPE_COUNT, but the counter may retain the original
value when create.

This patch fix the bug by read the counter when creating the rule
because the counter is read-clear.

Fixes: fcba820d9b ("net/hns3: support flow director")
Cc: stable@dpdk.org

Signed-off-by: Chengwen Feng <fengchengwen@huawei.com>
Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
2021-04-08 18:57:09 +02:00
Huisong Li
f1c555219f net/hns3: fix flow control exception
In multi-TC scenarios, MAC pause is not supported. Otherwise, only
TC0 can trigger pause frames, and other TCs cannot trigger pause
frames. In this case, flow control does not meet the expectation.

Fixes: 62e3ccc2b9 ("net/hns3: support flow control")
Cc: stable@dpdk.org

Signed-off-by: Huisong Li <lihuisong@huawei.com>
Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
2021-04-08 18:57:09 +02:00
Chengchang Tang
39c4fe7042 net/hns3: fix rollback after setting PVID failure
Currently, three hardware operations are involved in setting the PVID.
If any operation fails, a failure will be returned. And there may be
residual hardware configurations because no rollback is performed.

This patch adds rollback operation for setting PVID to avoid residual
hardware configuration after the PVID fails to be configured.

Fixes: 411d23b9ea ("net/hns3: support VLAN")
Cc: stable@dpdk.org

Signed-off-by: Chengchang Tang <tangchengchang@huawei.com>
Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
2021-04-08 18:57:09 +02:00
Hongbo Zheng
32040ae365 net/hns3: fix FLR miss detection
When FLR occurs, the head pointer register of
the command queue will be cleared, resulting in
abnormal detection of the head pointer register
of the command queue. At present, FLR is detected
in this way, and the reset recovery process is
executed.

However, when FLR occurs, the header pointer
register of the command queue is not necessarily
abnormal. For example, when the driver runs
normally, the value of the header pointer register
of the command queue may also be 0, which will
lead to the miss detection of FLR.

Therefore, the judgment that whether the base
address register of command queue is 0 is added
to ensure that FLR not miss detection.

Fixes: 2790c64647 ("net/hns3: support device reset")
Cc: stable@dpdk.org

Signed-off-by: Hongbo Zheng <zhenghongbo3@huawei.com>
Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
2021-04-08 18:57:09 +02:00
Chengwen Feng
76a3836b98 net/hns3: fix setting default MAC address in bonding of VF
When start testpmd with two hns3 VFs(0000:bd:01.0, 0000:bd:01.7), and
then execute the following commands:
	testpmd> create bonded device 1 0
	testpmd> set bonding mac_addr 2 3c:12:34:56:78:9a
	testpmd> add bonding slave 0 2
	testpmd> add bonding slave 1 2
	testpmd> set portmask 0x4
	testpmd> port start 2

It will occurs the following error in a low probability:
	0000:bd:01.0 hns3_get_mbx_resp(): VF could not get mbx(3,0)
		head(16) tail(15) lost(1) from PF in_irq:0
	0000:bd:01.0 hns3vf_set_default_mac_addr(): Failed to set mac
		addr(3C:**:**:**:78:9A) for vf: -62
	mac_address_slaves_update(1541) - Failed to update port Id 0
		MAC address

The problem replay:
1. The 'port start 2' command will start slave ports and then set slave
   mac address, the function call flow: bond_ethdev_start ->
   mac_address_slaves_update.
2. There are also a monitor task which running in intr thread will check
   slave ports link status and update slave ports mac address, the
   function call flow: bond_ethdev_slave_link_status_change_monitor ->
   bond_ethdev_lsc_event_callback -> mac_address_slaves_update.
3. Because the above step1&2 running on different threads, they may both
   call drivers ops mac_addr_set which is hns3vf_set_default_mac_addr.
4. hns3vf_set_default_mac_addr will first acquire hw.lock and then send
   mailbox to PF and wait PF's response message.  Note: the PF's
   response is an independent message which will received in hw.cmq.crq,
   the receiving operation can only performed in intr thread.
5. So if the step1 operation hold the hw.lock and try get response
   message, and step2 operation try acquire the hw.lock and so it can't
   process the response message, this will lead to step1 fail.

The solution:
1. make all threads could process the mailbox response message, which
   protected by the hw.cmq.crq.lock.
2. use the following rules to avoid deadlock:
2.1. ensure use the correct locking sequence: hw.lock >
     hw.mbx_resp.lock > hw.cmq.crq.lock.
2.2. make sure don't acquire such as hw.lock & hw.mbx_resp.lock again
     when process mailbox response message.

Fixes: 463e748964 ("net/hns3: support mailbox")
Cc: stable@dpdk.org

Signed-off-by: Chengwen Feng <fengchengwen@huawei.com>
Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
2021-04-08 18:57:09 +02:00
Huisong Li
85a2dc75af net/hns3: fix some function names for copper media type
PHY is a common concept for the copper and optical media type interface.
There are some inappropriate function names for copper ports, which
needs to be adjusted.

Fixes: 2e4859f3b3 ("net/hns3: support PF device with copper PHYs")

Signed-off-by: Huisong Li <lihuisong@huawei.com>
Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
2021-04-08 18:57:09 +02:00
Min Hu (Connor)
53e6f86cf5 net/hns3: fix copyright date
This patch updates copyright date for hns3 PMD files.

Fixes: 565829db8b ("net/hns3: add build and doc infrastructure")
Fixes: 952ebacce4 ("net/hns3: support SVE Rx")
Fixes: e31f123db0 ("net/hns3: support NEON Tx")
Fixes: c09c7847d8 ("net/hns3: support traffic management")

Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
2021-04-08 17:55:35 +02:00
Smadar Fuks
1b14508b3b net/octeontx2: support flow action port ID
Action port_id was not supported until now.
In this patch the action port_id supports passing from input
port PF to output port which is one of input port respective VF

Signed-off-by: Smadar Fuks <smadarf@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
2021-04-08 17:09:57 +02:00
Huisong Li
d69b9dd854 net/hns3: support wait in link update
There are two APIs in ethdev layer to get link status of device, namely,
"rte_eth_link_get" and "rte_eth_link_get_nowait". When the device link
is unstable or auto-negotiation is in progress, the first API supports
the function of waiting for the NIC to link up, and the maximum waiting
time is 9 seconds based on DPDK Documentation. For the hns3 PMD driver,
the link can be established within 2 seconds.

Signed-off-by: Huisong Li <lihuisong@huawei.com>
Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
2021-04-08 16:12:42 +02:00
Alexander Kozyrev
d2cf28145f doc: add fields enum for modify action in flow guide
Fix the documentation about the MODIFY_FIELD flow action.
1. Include the rte_flow_field_id enumeration reference to point
to the full list of all supported Field IDs available.
2. Correct the formatting of the MODIFY_FIELD action and the
destination/source field definition tables.

Fixes: 73b68f4c54 ("ethdev: introduce generic modify flow action")
Cc: stable@dpdk.org

Signed-off-by: Alexander Kozyrev <akozyrev@nvidia.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2021-04-08 15:21:43 +02:00
Stephen Hemminger
b797b049b5 net/netvsc: fix log format
The PMD_DRV_LOG macro in netvsc (like other drivers) adds a newline to
the log message as part of the macro expansion; therefore the
message should not have its own newline.

In a couple places, log messages were split across source lines
which can make looking them up in the source tree harder.

Fixes: a2a23a794b ("net/netvsc: support VF device hot add/remove")
Cc: stable@dpdk.org

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Long Li <longli@microsoft.com>
2021-04-08 10:20:40 +02:00
Salem Sol
3b622711bc app/testpmd: support NVGRE encap as sample action
Add support for rte_flow_action_nvge_encap as a sample action.

The example of test-pmd command:

1.  set nvgre ip-version ... tni ... ip-src ... ip-dst ...
    set raw_encap 1 eth src... / ipv4... /...
    set sample_actions 2 nvgre / port_id id 0 / end
    flow create 0 ... pattern eth / end actions
       sample ratio 1 index 2 / raw_encap index 1 / port_id id 0...

    The flow will result in all the matched egress packets will be
    encapsulated and sent to wire, and also mirrored the packets
    using NVGRE encapsulation data and sent to wire.

Signed-off-by: Salem Sol <salems@nvidia.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2021-04-08 01:09:24 +02:00
Salem Sol
a1f20f1abc app/testpmd: support VXLAN encap as sample action
Add support for rte_flow_action_vxlan_encap as a sample action.

The example of test-pmd command:

1.  set vxlan ip-version ... vni ... udp-src ...
    set raw_encap 1 eth src.../ ipv4.../...
    set sample_actions 2 vxlan_encap / port_id id 0 / end
    flow create 0 ... pattern eth / end actions
       sample ratio 1 index 2 / raw_encap index 1 / port_id id 0...

    The flow will result in all the matched egress packets will be
    encapsulated and sent to wire, and also mirrored the packets
    using VXLAN encapsulation data and sent to wire.

Signed-off-by: Salem Sol <salems@nvidia.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2021-04-08 01:09:24 +02:00