dpdk.git
4 years agoversion: 20.08-rc4
Thomas Monjalon [Thu, 6 Aug 2020 00:47:03 +0000 (02:47 +0200)]
version: 20.08-rc4

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
4 years agodoc: announce deprecation of port mirroring API
Thomas Monjalon [Mon, 3 Aug 2020 15:33:09 +0000 (17:33 +0200)]
doc: announce deprecation of port mirroring API

A new API is planned to be introduced for sampling and mirroring
with rte_flow. It should be more generic and allow more use cases.

This deprecation is to show the direction, avoiding overlapping APIs.

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Acked-by: Jerin Jacob <jerinj@marvell.com>
Acked-by: Andrew Rybchenko <arybchenko@solarflare.com>
Acked-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Acked-by: David Marchand <david.marchand@redhat.com>
4 years agodoc: announce removal of L2 tunnel filtering API
Thomas Monjalon [Mon, 3 Aug 2020 18:06:27 +0000 (20:06 +0200)]
doc: announce removal of L2 tunnel filtering API

The functions for L2 tunnel were missed when marking the legacy
filtering API as deprecated. That's why a separate notice is done
to make clear that it will be removed as well in DPDK 20.11.

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Acked-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Acked-by: David Marchand <david.marchand@redhat.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
Acked-by: Andrew Rybchenko <arybchenko@solarflare.com>
4 years agodoc: announce removal of ethdev flow director API
Thomas Monjalon [Mon, 3 Aug 2020 17:49:09 +0000 (19:49 +0200)]
doc: announce removal of ethdev flow director API

The flow director config, part of the legacy filtering API,
was marked as deprecated last year.
A separate notice is added to make clear that these specific structs
will be removed as well in DPDK 20.11, as the rest of the legacy
filtering API.

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Acked-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
Acked-by: David Marchand <david.marchand@redhat.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
Acked-by: Andrew Rybchenko <arybchenko@solarflare.com>
4 years agodoc: announce removal of legacy ethdev filtering API
Thomas Monjalon [Mon, 3 Aug 2020 11:49:01 +0000 (13:49 +0200)]
doc: announce removal of legacy ethdev filtering API

Deprecation of rte_eth_dev_filter_ctrl() was announced in 2016,
and confirmed last year by avoiding include of rte_eth_ctrl.h.
After 4 years, it is time to complete the removal of the API
which is replaced with rte_flow.

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Acked-by: Andrew Rybchenko <arybchenko@solarflare.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
Acked-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Acked-by: David Marchand <david.marchand@redhat.com>
4 years agodoc: announce ethdev port freeing on close operation
Thomas Monjalon [Tue, 4 Aug 2020 09:20:14 +0000 (11:20 +0200)]
doc: announce ethdev port freeing on close operation

Since DPDK 18.11, some drivers are migrating to a new behaviour,
releasing port resources on close.
The temporary flag RTE_ETH_DEV_CLOSE_REMOVE triggers this new mode
in the migrated drivers.
After 2 years, the flag and the old behaviour will be removed.
Last drivers not migrated will have to complete the switch.

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Acked-by: Jerin Jacob <jerinj@marvell.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
Acked-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Acked-by: Andrew Rybchenko <arybchenko@solarflare.com>
4 years agodoc: announce mbuf layout change
Thomas Monjalon [Fri, 31 Jul 2020 16:03:49 +0000 (18:03 +0200)]
doc: announce mbuf layout change

In order to prepare for adding more features requiring more space in mbuf,
some static fields must become dynamic.
Some small layout changes may have performance benefits as well.

The deprecation notice for atomic refcount is moved and reworded
to fit below the layout deprecation.

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
Acked-by: Andrew Rybchenko <arybchenko@solarflare.com>
Acked-by: David Marchand <david.marchand@redhat.com>
4 years agodoc: announce eventdev ABI change to support DLB PMD
Timothy McDaniel [Mon, 3 Aug 2020 17:55:35 +0000 (12:55 -0500)]
doc: announce eventdev ABI change to support DLB PMD

The ABI changes associated with this notification will better support
devices that:
1. Have limits on the number or queues that may be linked to a port
2. Have ports that are limited to exactly one linked queue
3. Are not able to transparently transfer the event flow_id field

Signed-off-by: Timothy McDaniel <timothy.mcdaniel@intel.com>
Acked-by: Harry van Haaren <harry.van.haaren@intel.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
4 years agodoc: announce PCI resources map API removal
David Marchand [Tue, 4 Aug 2020 08:47:32 +0000 (10:47 +0200)]
doc: announce PCI resources map API removal

The PCI resources map API (pci_map_resource/pci_unmap_resource) was
imposing use of Unix mmap flags while it does not make sense on Windows.
This API was only used to internally setup PCI devices in the PCI bus
driver and has no known external users.

Announce its removal in 20.11 with its associated structures.

The workaround implemented in the commit 9d2b24593724 ("pci: keep API
compatibility with mmap values") will be removed at the same time.

Signed-off-by: David Marchand <david.marchand@redhat.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
Acked-by: Gaetan Rivet <grive@u256.net>
Acked-by: Thomas Monjalon <thomas@monjalon.net>
4 years agodoc: announce kernel driver enum removal
David Marchand [Tue, 4 Aug 2020 14:07:52 +0000 (16:07 +0200)]
doc: announce kernel driver enum removal

rte_kernel_driver is only used by the PCI subsystem and has polluted
ethdev for no reason.
Hide it in the PCI bus driver.

Signed-off-by: David Marchand <david.marchand@redhat.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Gaetan Rivet <grive@u256.net>
Acked-by: Thomas Monjalon <thomas@monjalon.net>
4 years agodoc: announce rawdev API change
Bruce Richardson [Mon, 13 Jul 2020 12:31:05 +0000 (13:31 +0100)]
doc: announce rawdev API change

Add to the documentation for 20.08 a notice about the changes of rawdev
APIs proposed by patchset [1].

[1] http://inbox.dpdk.org/dev/20200709152047.167730-1-bruce.richardson@intel.com/

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
Acked-by: Rosen Xu <rosen.xu@intel.com>
4 years agodoc: announce removal of make build system
Bruce Richardson [Mon, 13 Jul 2020 12:31:04 +0000 (13:31 +0100)]
doc: announce removal of make build system

Add in an official notice that the make build system is being removed in
20.11 and provide a link to instructions on how to build using meson and
ninja instead.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Andrew Rybchenko <arybchenko@solarflare.com>
Acked-by: Thomas Monjalon <thomas@monjalon.net>
4 years agonet/bnxt: fix flow counter query
Somnath Kotur [Mon, 3 Aug 2020 14:12:19 +0000 (19:42 +0530)]
net/bnxt: fix flow counter query

OVS-DPDK seems to set the reset bit for every flow query. Honor
the bit by resetting the SW counter values after assigning them.
Also set the 'hit' bit only if the counter value retrieved by HW
is non-zero.
While querying flow stats, use max possible entries in the fc table scan
for valid entries instead of active entries as the active entry can be in
any slot in the table.

This is a critical fix for OVS-DPDK flow aging.

Fixes: 306c2d28e247 ("net/bnxt: support count action in flow query")

Signed-off-by: Somnath Kotur <somnath.kotur@broadcom.com>
Reviewed-by: Venkat Duvvuru <venkatkumar.duvvuru@broadcom.com>
4 years agonet/bnxt: update resource allocation settings
Shahaji Bhosle [Mon, 3 Aug 2020 06:45:59 +0000 (12:15 +0530)]
net/bnxt: update resource allocation settings

Adjusted resource allocations for the hardware resources
like TCAM entries, action records, stat counters, exact match records to
scale up offload flows.
Also increased IPv4 nat entries to 1023.
This patch is a critical fix to enable driver load on current and all
FW versions going forward.

Fixes: cef3749d501e2 ("net/bnxt: update TruFlow resource allocation numbers")

Signed-off-by: Shahaji Bhosle <sbhosle@broadcom.com>
Signed-off-by: Kishore Padmanabha <kishore.padmanabha@broadcom.com>
Signed-off-by: Venkat Duvvuru <venkatkumar.duvvuru@broadcom.com>
Reviewed-by: Mike Baucom <michael.baucom@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
4 years agoethdev: remove device-specific comments from VLAN API
Thomas Monjalon [Tue, 4 Aug 2020 09:48:08 +0000 (11:48 +0200)]
ethdev: remove device-specific comments from VLAN API

Some confusing comments were still present from old days,
when most drivers were from Intel.

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Reviewed-by: David Marchand <david.marchand@redhat.com>
Acked-by: Andrew Rybchenko <arybchenko@solarflare.com>
Acked-by: Ferruh Yigit <ferruh.yigit@intel.com>
4 years agodoc: update firmware/driver mapping table for i40e
Bo Chen [Wed, 5 Aug 2020 02:41:18 +0000 (10:41 +0800)]
doc: update firmware/driver mapping table for i40e

Update i40e PMD firmware/driver mapping table.

Signed-off-by: Bo Chen <box.c.chen@intel.com>
4 years agonet/iavf: fix default RSS hash configuration
Jeff Guo [Tue, 4 Aug 2020 02:58:31 +0000 (10:58 +0800)]
net/iavf: fix default RSS hash configuration

Different device has different hash capability, it should not be
expected that all hash set would be successful to set into all
devices by default. So remove the return checking when hash default
set. And remove gtpu hash default set, iavf only enable hash for
general protocols.

Fixes: c94366cfc641 ("net/iavf: add GTPU in default hash")

Signed-off-by: Jeff Guo <jia.guo@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
Tested-by: Wei Xie <weix.xie@intel.com>
4 years agonet/ice: revert fake TSO fixes
Haiyue Wang [Fri, 31 Jul 2020 05:59:40 +0000 (13:59 +0800)]
net/ice: revert fake TSO fixes

The two fixes are not the real root cause for MDD event, it mitigates
the failure rate when different test mode, so revert them.

Fixes: 2a0c9ae4f646 ("net/ice: fix TCP checksum offload")
Fixes: 7365a3cee51f ("net/ice: calculate TCP header size for offload")
Cc: stable@dpdk.org
Signed-off-by: Haiyue Wang <haiyue.wang@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
4 years agonet/ice: fix Tx hang with TSO
Haiyue Wang [Fri, 31 Jul 2020 04:27:13 +0000 (12:27 +0800)]
net/ice: fix Tx hang with TSO

The variables 'td_offset' and 'td_tag' should be reset to 0 for every
burst packet, otherwise the fields of Tx Descriptor will be set wrong,
this will cause the MDD event error, and Tx will hang.

Fixes: 17c7d0f9d6a4 ("net/ice: support basic Rx/Tx")
Cc: stable@dpdk.org
Signed-off-by: Haiyue Wang <haiyue.wang@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
4 years agonet/i40e: remove duplicate tunnel type check
Gaurav Singh [Sat, 1 Aug 2020 01:57:52 +0000 (21:57 -0400)]
net/i40e: remove duplicate tunnel type check

remove duplicate check

Fixes: 62e94f7f66fb ("net/i40e: configure packet type mapping")
Cc: stable@dpdk.org
Signed-off-by: Gaurav Singh <gaurav1086@gmail.com>
Acked-by: Ferruh Yigit <ferruh.yigit@intel.com>
4 years agoregex/mlx5: fix registered driver name
Thomas Monjalon [Wed, 5 Aug 2020 14:51:01 +0000 (16:51 +0200)]
regex/mlx5: fix registered driver name

The driver name was registered as "net_mlx5_regex".
It is renamed as "regex_mlx5".
The same name is used in mlx5_regex_driver.pci_driver.driver.name,
instead of "mlx5_regex", for consistency.

The string used for log registration (pmd.regex.mlx5) could be derived
from the driver name. A macro is created so name definitions are close.

Fixes: cfc672a90b74 ("regex/mlx5: support probing")

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Acked-by: Ori Kam <orika@mellanox.com>
4 years agovdpa/mlx5: fix virtio queue unset
Matan Azrad [Mon, 3 Aug 2020 08:25:24 +0000 (08:25 +0000)]
vdpa/mlx5: fix virtio queue unset

When a virtq is destroyed, the SW should be able to continue the virtq
processing from where the HW stopped.

The current destroy behavior in the driver saves the virtq state (used
and available indexes) only when LM is requested.
So, when LM is not requested the queue state is not saved and the SW
indexes stay invalid.

Save the virtq state in the virtq destroy process.

Fixes: bff735011078 ("vdpa/mlx5: prepare virtio queues")
Cc: stable@dpdk.org
Signed-off-by: Matan Azrad <matan@mellanox.com>
Acked-by: Xueming Li <xuemingl@mellanox.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
4 years agovdpa/mlx5: fix queue update synchronization
Xueming Li [Sun, 2 Aug 2020 09:21:51 +0000 (09:21 +0000)]
vdpa/mlx5: fix queue update synchronization

The driver CQ event management is done by non vhost library thread,
either the dpdk host thread or the internal vDPA driver thread.

When a queue is updated the CQ may be destroyed and created by the vhost
library thread via the queue state operation.

When the queue update feature was added, it didn't synchronize the CQ
management to the queue update what may cause invalid memory access.

Add the aforementioned synchronization by a new per device configuration
mutex.

Fixes: c47d6e83334e ("vdpa/mlx5: support queue update")

Signed-off-by: Xueming Li <xuemingl@mellanox.com>
Acked-by: Matan Azrad <matan@mellanox.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
4 years agonet/netvsc: fix chimney index
Long Li [Sun, 2 Aug 2020 06:04:28 +0000 (23:04 -0700)]
net/netvsc: fix chimney index

The code should look into "slab" to figure out the index returned from
rte_bitmap_scan().

Fixes: cc02518132 ("net/netvsc: split send buffers from Tx descriptors")
Cc: stable@dpdk.org
Signed-off-by: Long Li <longli@microsoft.com>
Acked-by: Stephen Hemminger <stephen@networkplumber.org>
4 years agonet/bonding: fix dead loop on RSS RETA update
Zhiguang He [Sun, 2 Aug 2020 12:27:27 +0000 (20:27 +0800)]
net/bonding: fix dead loop on RSS RETA update

When parameter reta_size < RTE_RETA_GROUP_SIZE, reta_count will be 0.
Then this function will be deadloop.

Fixes: 734ce47f71e0 ("bonding: support RSS dynamic configuration")
Cc: stable@dpdk.org
Signed-off-by: Zhiguang He <hezhiguang3@huawei.com>
Acked-by: Wei Hu (Xavier) <xavier.huwei@huawei.com>
4 years agodoc: add timestamp upper limitation in mlx5 guide
Viacheslav Ovsiienko [Mon, 27 Jul 2020 15:51:04 +0000 (15:51 +0000)]
doc: add timestamp upper limitation in mlx5 guide

Add description about Tx scheduling timestamp upper limit.
If timestamp exceeds the value, it is marked by PMD as being
into "too-distant-future" and not scheduled at all
(is being sent without any wait).

Signed-off-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
4 years agonet/mlx5: fix number of retries for UAR allocation
Dekel Peled [Mon, 3 Aug 2020 09:18:27 +0000 (12:18 +0300)]
net/mlx5: fix number of retries for UAR allocation

Previous fix added definition of number of retries for UAR allocation.
This value is adequate for x86 systems with 4K pages.
On Power9 system with 64K pages the required value is 32.
This patch updates the defined value from 2 to 32.

Fixes: a0bfe9d56f74 ("net/mlx5: fix UAR memory mapping type")

Signed-off-by: Dekel Peled <dekelp@mellanox.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
4 years agoversion: 20.08-rc3
Thomas Monjalon [Thu, 30 Jul 2020 23:37:05 +0000 (01:37 +0200)]
version: 20.08-rc3

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
4 years agodoc: refer to default directory for hugepages
Sarosh Arif [Tue, 23 Jun 2020 05:55:59 +0000 (10:55 +0500)]
doc: refer to default directory for hugepages

Change /dev/huge to /dev/hugepages which is the default directory
on most systems.

Bugzilla ID: 492

Signed-off-by: Sarosh Arif <sarosh.arif@emumba.com>
4 years agodoc: fix ethtool app path
Sarosh Arif [Thu, 4 Jun 2020 09:59:31 +0000 (14:59 +0500)]
doc: fix ethtool app path

The path to the ethtool application was slightly incorrect in the
documentation. This patch corrects that path.

Fixes: bda68ab9d1e7 ("examples/ethtool: add user-space ethtool sample application")
Cc: stable@dpdk.org
Signed-off-by: Sarosh Arif <sarosh.arif@emumba.com>
4 years agodoc: add patch dependency syntax to contributing guide
Ferruh Yigit [Fri, 3 Jul 2020 09:53:48 +0000 (10:53 +0100)]
doc: add patch dependency syntax to contributing guide

To help managing patch dependencies, both for maintainers or automation
tasks, document a syntax for commit logs or cover letters to express
their dependencies.

Using the syntax proposed in Bugzilla ID 210:
[https://bugs.dpdk.org/show_bug.cgi?id=210]

Depends-on: series-NNNNN ("Title of the series")
OR
Depends-on: patch-NNNNN ("Title of the patch")

Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
4 years agodoc: fix build when sphinx reports version to stderr
Bruce Richardson [Mon, 22 Jun 2020 14:00:02 +0000 (15:00 +0100)]
doc: fix build when sphinx reports version to stderr

When sphinx-build reports its version information to stderr rather
than stdout, the wrapper script misses it, and then fails to run.
We can fix this by redirecting stderr to stdout for the version
query call.

Fixes: f5ab2074cfba ("doc: rebuild with meson whenever a file changes")
Cc: stable@dpdk.org
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Tested-by: Ciara Power <ciara.power@intel.com>
Tested-by: David Marchand <david.marchand@redhat.com>
4 years agodevtools: summarize git log check
Ciara Power [Tue, 23 Jun 2020 09:29:35 +0000 (10:29 +0100)]
devtools: summarize git log check

When all checks are completed on the specified commit logs, the script
indicates if all are valid, or if there were some failures.

Signed-off-by: Ciara Power <ciara.power@intel.com>
Acked-by: Ferruh Yigit <ferruh.yigit@intel.com>
Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
4 years agodevtools: standardize script arguments
Ciara Power [Tue, 23 Jun 2020 09:29:34 +0000 (10:29 +0100)]
devtools: standardize script arguments

This patch modifies the arguments expected by the check-git-log script,
to match the format of arguments for the checkpatches script. Both
scripts now take certain argument options in the same format, making
them easier to use.
e.g. Both now take a commit ID range by "-r <range>"

The checkpatches help print is also updated to include the "-h" option.

The contributor's guide includes the usage of both the checkpatches and
check-git-log scripts, which needed to be updated to reflect the now
standardised format.

Signed-off-by: Ciara Power <ciara.power@intel.com>
Acked-by: Ferruh Yigit <ferruh.yigit@intel.com>
Reviewed-by: Thomas Monjalon <thomas@monjalon.net>
4 years agodevtools: add new SPDX license compliance checker
Stephen Hemminger [Tue, 14 Jul 2020 23:21:01 +0000 (16:21 -0700)]
devtools: add new SPDX license compliance checker

Simple script to look for drivers and scripts that
are missing requires SPDX header.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
4 years agodevtools: add checkpatch spelling dictionary builder
Thomas Monjalon [Tue, 7 Jul 2020 08:35:55 +0000 (10:35 +0200)]
devtools: add checkpatch spelling dictionary builder

The script checkpatch.pl (used in checkpatches.sh) can use a dictionary
from the codespell project to check spelling.
There are multiple dictionaries to be used.

The script build-dict.sh concatenate multiple dictionaries and remove
some annoying false positives.

The dictionary built by this script must be saved in a file which
is referenced with the environment variable DPDK_CHECKPATCH_CODESPELL.
The easiest is to export this variable in ~/.config/dpdk/devel.config.

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
4 years agodevtools: avoid explicit experimental build flag
David Marchand [Thu, 16 Jul 2020 07:26:48 +0000 (09:26 +0200)]
devtools: avoid explicit experimental build flag

-DALLOW_EXPERIMENTAL_API is always set for in-tree compilation since
https://git.dpdk.org/dpdk/commit/?id=acec04c4b2f5

Warn people not to copy/paste this flag that was needed before.

Signed-off-by: David Marchand <david.marchand@redhat.com>
4 years agonet/netvsc: fix crash during Tx
Chas Williams [Wed, 29 Jul 2020 13:58:44 +0000 (09:58 -0400)]
net/netvsc: fix crash during Tx

Commit cc0251813277 ("net/netvsc: split send buffers from Tx
descriptors") changed the way that transmit descriptors are
allocated. They come from a single pool instead of being
individually attached to each mbuf. To find the IOVA, you need
to calculate the offset from the base of the pool.

Fixes: cc0251813277 ("net/netvsc: split send buffers from Tx descriptors")
Cc: stable@dpdk.org
Signed-off-by: Chas Williams <3chas3@gmail.com>
Acked-by: Stephen Hemminger <stephen@networkplumber.org>
4 years agoexamples/packet_ordering: use proper exit method
Sarosh Arif [Fri, 5 Jun 2020 11:48:28 +0000 (16:48 +0500)]
examples/packet_ordering: use proper exit method

rte_exit should be called when the application exits due to
invalid EAL or application arguments.

Fixes: 850f3733f840 ("examples/packet_ordering: new sample app")

Signed-off-by: Sarosh Arif <sarosh.arif@emumba.com>
4 years agoexamples: fix port mask parsing failure handling
Sarosh Arif [Thu, 11 Jun 2020 12:36:24 +0000 (17:36 +0500)]
examples: fix port mask parsing failure handling

Giving invalid or zero portmask as command line option to
these applications will have an unexpected response.
The reason behind this is that the return value of function
that parses portmask is stored in a variable whose datatype is
unsigned int, hence returning -1 in case of zero or
invalid portmask causes an unexpected behaviour.
If we return 0 instead of -1 this issue can be resolved.
The program already contains the functionality to print
"invalid portmask" and program usage if zero is returned.

Signed-off-by: Sarosh Arif <sarosh.arif@emumba.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
4 years agodoc: add more detail to telemetry guides
Ciara Power [Fri, 24 Jul 2020 11:20:33 +0000 (12:20 +0100)]
doc: add more detail to telemetry guides

This patch adds examples to the Telemetry HowTo guide, to demonstrate
commands that use parameters. The programmer's guide is also modified to
include details on writing a callback function for a new command.

Signed-off-by: Ciara Power <ciara.power@intel.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
4 years agodoc: add tested platforms with Mellanox NICs
Raslan Darawsheh [Wed, 29 Jul 2020 12:22:14 +0000 (15:22 +0300)]
doc: add tested platforms with Mellanox NICs

Signed-off-by: Raslan Darawsheh <rasland@mellanox.com>
4 years agonet/kni: set packet input port in Rx
Jecky Pei [Fri, 24 Jul 2020 15:10:28 +0000 (16:10 +0100)]
net/kni: set packet input port in Rx

Store port_id in pmd_internals when eth kni device is created.
Then set packet port of rte_mbuf in function eth_kni_rx.

Cc: stable@dpdk.org
Signed-off-by: Jecky Pei <jpei@sonicwall.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
4 years agocommon/mlx5: fix regex register layout
Yuval Avnery [Tue, 28 Jul 2020 17:50:44 +0000 (17:50 +0000)]
common/mlx5: fix regex register layout

Reserved field should be 0x60 instead of 0x40.
Will fail FW check otherwise.

Fixes: 9428310ae1f1 ("regex/mlx5: add engine status check")

Signed-off-by: Yuval Avnery <yuvalav@mellanox.com>
Acked-by: Ori Kam <orika@mellanox.com>
4 years agocommon/mlx5: fix MAC addresses flush
Shiri Kuzin [Wed, 29 Jul 2020 14:29:00 +0000 (17:29 +0300)]
common/mlx5: fix MAC addresses flush

mlx5_nl_mac_addr_flush should flush all allocated MAC
addresses.

The MAC addresses array size should be of size
MLX5_MAX_MAC_ADDRESSES, but currently we return without
flushing the addresses if size is MLX5_MAX_MAC_ADDRESSES.

This was fixed by not allowing an array larger than
MLX5_MAX_MAC_ADDRESSES.

Fixes: e9a8ac59b6e2 ("common/mlx5: fix MAC addresses assert")
Cc: stable@dpdk.org
Signed-off-by: Shiri Kuzin <shirik@mellanox.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
4 years agocommon/mlx5: fix user mode register access command
Viacheslav Ovsiienko [Wed, 29 Jul 2020 12:29:14 +0000 (12:29 +0000)]
common/mlx5: fix user mode register access command

To detect the timestamp mode configured on the NIC the mlx5
PMD uses the firmware command ACCESS_REGISTER_USER. This
command is relatively new and might be not supported by
older firmware versions and was rejected, causing annoying
messages in kernel log.

This patch adds the attribute flag check whether firmware
supports the command and avoid the call if it does not.

Fixes: bb7ef9a96281 ("common/mlx5: add register access DevX routine")

Signed-off-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
4 years agovhost: fix async copy on multi-page buffers
Patrick Fu [Wed, 29 Jul 2020 02:04:56 +0000 (10:04 +0800)]
vhost: fix async copy on multi-page buffers

Async copy fails when single ring buffer vector is split on multiple
physical pages. This happens because current hpa address translation
function doesn't handle multi-page buffers. A new gpa to hpa address
conversion function, which returns the hpa on the first hitting host
pages, is implemented in this patch. Async data path recursively calls
this new function to construct a multi-segments async copy descriptor
for ring buffers crossing physical page boundaries.

Fixes: cd6760da1076 ("vhost: introduce async enqueue for split ring")

Signed-off-by: Patrick Fu <patrick.fu@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
4 years agonet/virtio-user: check tap system call setting
Chenbo Xia [Wed, 29 Jul 2020 13:12:30 +0000 (13:12 +0000)]
net/virtio-user: check tap system call setting

Setting the flags of tapfd may fail and the return value
should be checked.

Coverity issue: 140739
Fixes: e3b434818bbb ("net/virtio-user: support kernel vhost")
Cc: stable@dpdk.org
Signed-off-by: Chenbo Xia <chenbo.xia@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
4 years agonet/vhost: fix interrupt mode
Maxime Coquelin [Fri, 24 Jul 2020 14:45:30 +0000 (16:45 +0200)]
net/vhost: fix interrupt mode

At .new_device() time, only the first vring pair is
now ready, other vrings are configured later.

Problem is that when application will setup and enable
interrupts, only the first queue pair Rx interrupt will
be enabled.

This patches fixes the issue by setting the number of
max interrupts to the number of Rx queues that will be
later initialized. Then, as soon as a Rx vring is ready
and interrupt enabled by the application, it removes the
corresponding uninitialized epoll event, and installs a
new one with the valid FD.

Fixes: 604052ae5395 ("net/vhost: support queue update")

Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Reviewed-by: Chenbo Xia <chenbo.xia@intel.com>
4 years agonet/vhost: fix queue update
Maxime Coquelin [Thu, 23 Jul 2020 13:08:54 +0000 (15:08 +0200)]
net/vhost: fix queue update

Now that the vhost library saves the guest notifications
enablement value in its virtqueues metadata, it is not
necessary to do it in the vring_state_changed callback.

One effect of the patch is also to prevent possible
deadlock happening in vhost library.

Fixes: 604052ae5395 ("net/vhost: support queue update")

Reported-by: Yinan Wang <yinan.wang@intel.com>
Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Tested-by: Yinan Wang <yinan.wang@intel.com>
Reviewed-by: Chenbo Xia <chenbo.xia@intel.com>
4 years agovhost: fix guest notification setting
Maxime Coquelin [Thu, 23 Jul 2020 13:08:53 +0000 (15:08 +0200)]
vhost: fix guest notification setting

If rte_vhost_enable_guest_notification is called before
the virtqueue is ready, the configuration is lost.

This patch fixes this by saving the guest notification
enablement value requested by the application, and apply
it before the virtqueue is made ready to the application.

Fixes: 604052ae5395 ("net/vhost: support queue update")

Reported-by: Yinan Wang <yinan.wang@intel.com>
Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Tested-by: Yinan Wang <yinan.wang@intel.com>
Reviewed-by: Chenbo Xia <chenbo.xia@intel.com>
4 years agonet/bnxt: remove EEM system memory support
Randy Schacher [Tue, 28 Jul 2020 21:03:42 +0000 (17:03 -0400)]
net/bnxt: remove EEM system memory support

Remove the memory management scheme for Extended Exact Match
using system memory. Using host memory scheme instead which
was the default anyway.

Fixes: b2da02480cb7 ("net/bnxt: support EEM system memory")

Signed-off-by: Randy Schacher <stuart.schacher@broadcom.com>
Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Reviewed-by: Peter Spreadborough <peter.spreadborough@broadcom.com>
Reviewed-by: Farah Smith <farah.smith@broadcom.com>
4 years agoapp/testpmd: fix timestamp init in txonly mode
Viacheslav Ovsiienko [Wed, 29 Jul 2020 12:29:54 +0000 (12:29 +0000)]
app/testpmd: fix timestamp init in txonly mode

The testpmd application forwards data in multiple threads.
In the txonly mode the Tx timestamps must be initialized
on per thread basis to provide phase shift for the packet
burst being sent. This per thread initialization was performed
on zero value of the variable in thread local storage and
happened only once after testpmd forwarding start. Executing
"start" and "stop" commands did not cause thread local variables
zeroing and wrong timestamp values were used.

Fixes: 4940344dab1d ("app/testpmd: add Tx scheduling command")

Signed-off-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
Reviewed-by: Phil Yang <phil.yang@arm.com>
4 years agonet: fix IPv6 checksum with TSO
Yuying Zhang [Tue, 28 Jul 2020 17:09:50 +0000 (17:09 +0000)]
net: fix IPv6 checksum with TSO

The ol_flags check lacks of flag for IPv6 which causes checksum
flag configuration error while IPv6/TCP TSO packet is sent.
This patch fixes the issue by adding PKT_TX_TCP_SEG flag.

The rte_net_intel_cksum_flags_prepare() function prepares the
pseudo header checksum in packet data when doing checksum or TSO
offload.

Fixes: 520059a41aa9 ("net: check fragmented headers in non-debug as well")

Signed-off-by: Yuying Zhang <yuying.zhang@intel.com>
Tested-by: Xi Zhang <xix.zhang@intel.com>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
Reviewed-by: David Marchand <david.marchand@redhat.com>
Acked-by: Andrew Rybchenko <arybchenko@solarflare.com>
4 years agonet/ice: calculate TCP header size for offload
Haiyue Wang [Wed, 29 Jul 2020 07:50:39 +0000 (15:50 +0800)]
net/ice: calculate TCP header size for offload

The ice needs the exact TCP header size including options for TCP
checksum offload, but according to PKT_TX_TCP_CKSUM note, l4_len
is not required to be set, so it needs to calculate the TCP header
size if not set.

Fixes: 17c7d0f9d6a4 ("net/ice: support basic Rx/Tx")
Cc: stable@dpdk.org
Signed-off-by: Haiyue Wang <haiyue.wang@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Qiming Yang <qiming.yang@intel.com>
4 years agonet/ice: fix GTPU down/uplink and extension conflict
Simei Su [Tue, 28 Jul 2020 11:07:56 +0000 (19:07 +0800)]
net/ice: fix GTPU down/uplink and extension conflict

When adding a RSS rule with GTPU_DWN/UP, it will write from top to
bottom for profile due to firmware limitation. If a RSS rule with
GTPU_EH already exists, then GTPU_DWN/UP packet will match GTPU_EH
profile. This patch solves this issue by remembering a gtpu_eh RSS
configure and removing it before the corresponding RSS configure
for downlink/uplink rule is issued.

Fixes: 2e2810fc1868 ("net/ice: fix GTPU RSS")

Signed-off-by: Simei Su <simei.su@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
4 years agonet/ice: add memory allocation check in RSS init
Yunjian Wang [Tue, 28 Jul 2020 13:11:27 +0000 (21:11 +0800)]
net/ice: add memory allocation check in RSS init

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

Fixes: 50370662b727 ("net/ice: support device and queue ops")
Cc: stable@dpdk.org
Signed-off-by: Yunjian Wang <wangyunjian@huawei.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
4 years agonet/ice: fix memory leak when releasing VSI
Yunjian Wang [Tue, 28 Jul 2020 13:11:12 +0000 (21:11 +0800)]
net/ice: fix memory leak when releasing VSI

At the end of the vsi release, we should free the 'rss_lut'
and 'rss_key' for the vsi.

Fixes: 50370662b727 ("net/ice: support device and queue ops")
Cc: stable@dpdk.org
Signed-off-by: Yunjian Wang <wangyunjian@huawei.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
4 years agonet/ice: fix GTPU TEID hash
Jeff Guo [Tue, 28 Jul 2020 09:20:57 +0000 (17:20 +0800)]
net/ice: fix GTPU TEID hash

Refine gtpu teid hash rule mapping for GTPU_IP/GTPU_EH/GTPU_DWN/GTPU_UP.

Fixes: 37e444b77814 ("net/ice: support hash for GTPU protocols")

Signed-off-by: Jeff Guo <jia.guo@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
4 years agonet/i40e: fix bitmap free
Chenmin Sun [Tue, 28 Jul 2020 12:50:58 +0000 (20:50 +0800)]
net/i40e: fix bitmap free

This patch fixes the coverity warning #361024.
rte_bitmap_free() is not a right way to free a bitmap, replacing
it with rte_free().

Coverity issue: 361024
Fixes: febc61d350bf ("net/i40e: optimize flow director update rate")

Signed-off-by: Chenmin Sun <chenmin.sun@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
4 years agonet/ice: fix TCP checksum offload
Haiyue Wang [Tue, 28 Jul 2020 13:42:03 +0000 (21:42 +0800)]
net/ice: fix TCP checksum offload

The L4LEN field of the Descriptor Header Offset for TCP should be the
real length including the TCP options.

Fixes: 17c7d0f9d6a4 ("net/ice: support basic Rx/Tx")
Cc: stable@dpdk.org
Signed-off-by: Haiyue Wang <haiyue.wang@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
4 years agodoc: add vhost multi-queue reconnection issue
Xuan Ding [Tue, 28 Jul 2020 01:33:47 +0000 (01:33 +0000)]
doc: add vhost multi-queue reconnection issue

This patch added known issue for vhost multi-queue reconnection
with virtio-net/virtio-pmd.

Signed-off-by: Xuan Ding <xuan.ding@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
4 years agovdpa/ifc: support vring update after device config
Chenbo Xia [Tue, 28 Jul 2020 14:32:24 +0000 (14:32 +0000)]
vdpa/ifc: support vring update after device config

The device ready state in vhost lib is now defined as the state
that first queue pair is ready. And kick/callfd may be updated
by QEMU when ifc device is configured.

Although now ifc driver only supports one queue pair, it still
has to update callfd when working with QEMU. This patch fixes
this vring update problem by implementing the set_vring_state
callback.

Suggested-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Signed-off-by: Chenbo Xia <chenbo.xia@intel.com>
Acked-by: Xiao Wang <xiao.w.wang@intel.com>
Acked-by: Rosen Xu <rosen.xu@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
4 years agovdpa/mlx5: fix event queue number query
Xueming Li [Tue, 28 Jul 2020 12:32:29 +0000 (12:32 +0000)]
vdpa/mlx5: fix event queue number query

Vdpa example failed on vq setup, the api to get event queue of specified
core failed.

Internal api devx_query_eqn expects index of event queue vectors, no
need to use cpu id. As the doorbell handling thread is per device, it's
sufficient to use default event queue.

This patch uses the default id(0) as event queue index.

Fixes: 8395927cdfaf ("vdpa/mlx5: prepare HW queues")
Cc: stable@dpdk.org
Signed-off-by: Xueming Li <xuemingl@mellanox.com>
Acked-by: Matan Azrad <matan@mellanox.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
4 years agonet/virtio-user: fix status management
Xiao Wang [Tue, 28 Jul 2020 06:52:12 +0000 (14:52 +0800)]
net/virtio-user: fix status management

Apart from the virtio status, there should be also a network related
status for link status management, current implementation mixes up these
two statuses.

One issue caused by this mixup is when virtio-user running in server mode
and vhost as a client connects to it, a RARP packet will be generated by
virtio-user due to VIRTIO_NET_S_ANNOUNCE bit is detected in the "status"
in interrupt handler.

VIRTIO_NET_S_LINK_UP and VIRTIO_NET_S_ANNOUNCE should be managed by a
separated field. This patch adds a "net_status" field for this purpose.

Fixes: e9efa4d93821 ("net/virtio-user: add new virtual PCI driver")
Cc: stable@dpdk.org
Signed-off-by: Adrian Moreno <amorenoz@redhat.com>
Signed-off-by: Xiao Wang <xiao.w.wang@intel.com>
Reviewed-by: Chenbo Xia <chenbo.xia@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
4 years agovdpa/mlx5: fix completion queue initialization
Xueming Li [Mon, 27 Jul 2020 14:29:53 +0000 (14:29 +0000)]
vdpa/mlx5: fix completion queue initialization

Vdpa device failed to initialize 2nd VQ during setup. From FW syndrome,
unsupported CQE size was specified in CQ initialization attributes.

The unsupported CQE size comes from uninitialized stack struct data, and
the struct has new fields defined recently which are not initialized in
vdpa code.

This patch initializes cq creation attributes with zero to avoid such
random data.

Fixes: 79a7e409a2f6 ("common/mlx5: prepare support of packet pacing")

Signed-off-by: Xueming Li <xuemingl@mellanox.com>
Acked-by: Matan Azrad <matan@mellanox.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
4 years agovdpa/mlx5: fix notification timing
Matan Azrad [Mon, 27 Jul 2020 14:00:44 +0000 (14:00 +0000)]
vdpa/mlx5: fix notification timing

The issue is relevant only for the timer event modes: 0 and 1.

When the HW finishes to consume a burst of the guest Rx descriptors,
it creates a CQE in the CQ.
When traffic stops, the mlx5 driver arms the CQ to get a notification
when a specific CQE index is created - the index to be armed is the
next CQE index which should be polled by the driver.

The mlx5 driver configured the kernel driver to send notification to
the guest callfd in the same time of the armed CQE event.
It means that the guest was notified only for each first CQE in a
poll cycle, so if the driver polled CQEs of all the virtio queue
available descriptors, the guest was not notified again for the rest
because there was no any new CQE to trigger the guest notification.

Hence, the Rx queues might be stuck when the guest didn't work with
poll mode.

Remove prior kernel notification, and do manual notification after CQ
polling.

Fixes: a9dd7275a149 ("vdpa/mlx5: optimize notification events")

Signed-off-by: Matan Azrad <matan@mellanox.com>
Acked-by: Xueming Li <xuemingl@mellanox.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
4 years agovdpa/mlx5: fix steering update in virtq unset
Matan Azrad [Mon, 27 Jul 2020 08:07:59 +0000 (08:07 +0000)]
vdpa/mlx5: fix steering update in virtq unset

When a virtq is destroyed by the driver, it must be removed from the
steering RQT which holds its reference.

The driver didn't remove the virtq from RQT before destroying it what
caused HW syndrome in virtq unset.

Remove the virtq from RQT before destroying it.

Fixes: 9f09b1ca15c5 ("vdpa/mlx5: recreate a virtq becoming enabled")
Cc: stable@dpdk.org
Signed-off-by: Xueming Li <xuemingl@mellanox.com>
Signed-off-by: Matan Azrad <matan@mellanox.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
4 years agodoc: add a supported NIC in mlx5 vDPA guide
Sergey Madaminov [Sat, 25 Jul 2020 03:03:07 +0000 (23:03 -0400)]
doc: add a supported NIC in mlx5 vDPA guide

Update the docs, adding MCX621102AN-ADAT to the list of NICs supported
by MLX5 vDPA driver.

Suggested-by: William Tu <u9012063@gmail.com>
Signed-off-by: Sergey Madaminov <sergey.madaminov@gmail.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
4 years agovdpa/mlx5: fix live migration termination
Matan Azrad [Fri, 24 Jul 2020 12:07:11 +0000 (12:07 +0000)]
vdpa/mlx5: fix live migration termination

There are a lot of per virtq operations in the live migration
handling.

Before the driver support for queue update, when a virtq was not valid,
all the LM handling was terminated.

But now, when the driver supports queue update, the virtq can be invalid
as legal stage.

Skip invalid virtq in LM handling.

Fixes: c47d6e83334e ("vdpa/mlx5: support queue update")

Signed-off-by: Matan Azrad <matan@mellanox.com>
Acked-by: Xueming Li <xuemingl@mellanox.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
4 years agovhost: fix async callback return type
Patrick Fu [Thu, 23 Jul 2020 05:39:06 +0000 (13:39 +0800)]
vhost: fix async callback return type

The async copy device callbacks are used by async APIs to transfer data
and check completion status. Async APIs return the number of packets
successfully processed to the caller applications and no error
(negative) value is allowed for API return value. Thus, negative return
values from async device callbacks don't have meaningful usage, while
adding overhead in checking the return value validity. This patch change
the callback return values from "int" to "uint32_t" to get aligned with
async API definition.

Fixes: 78639d54563a ("vhost: introduce async enqueue registration API")

Signed-off-by: Patrick Fu <patrick.fu@intel.com>
Reviewed-by: Chenbo Xia <chenbo.xia@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
4 years agodoc: describe async API in vhost guide
Patrick Fu [Wed, 22 Jul 2020 15:01:52 +0000 (23:01 +0800)]
doc: describe async API in vhost guide

Update vhost guides to document vhost async APIs

Signed-off-by: Patrick Fu <patrick.fu@intel.com>
Reviewed-by: Chenbo Xia <chenbo.xia@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
4 years agovdpa/mlx5: fix compatibility with MISC4
Bing Zhao [Tue, 21 Jul 2020 08:13:40 +0000 (16:13 +0800)]
vdpa/mlx5: fix compatibility with MISC4

When dynamic flex parser feature is introduced, the support for misc
parameters 4 of flow table entry (FTE) match set is needed. The
structure of "mlx5_ifc_fte_match_param_bits" is extended with
"mlx5_ifc_fte_match_set_misc4_bits" at the end of it. The total size
of the FTE match set will be changed into 384 bytes from 320 bytes.
Low level user space driver (rdma-core) will have the validation of
the length of FTE match set. In the old release that no MISC4
supported in the rdma-core, and this will break the backward
compatibility, even if the MISC4 is not used in most cases, like
in vDPA driver.
In order not to break the compatibility old rdma-core, the length
adjustment needs to be done. In mlx5 vDPA driver, the lengths of
the matcher and value are both set to 320 without MISC4. There is
no need to change the structure definition, all bytes of the MISC4
will be discarded if it is not needed. Since the MISC4 parameter
is aligned with a 64B boundary and so does the whole FTE match set
parameter, there is no need to take any padding and alignment into
consideration when calculating the size.

Fixes: daa38a8924a0 ("net/mlx5: add flow translation of eCPRI header")

Signed-off-by: Bing Zhao <bingz@mellanox.com>
Acked-by: Matan Azrad <matan@mellanox.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
4 years agonet/bnxt: fix build with extra cflags
Ajit Khaparde [Fri, 24 Jul 2020 06:40:01 +0000 (23:40 -0700)]
net/bnxt: fix build with extra cflags

When we compile PMD with CFLAGS set to -O -g, build fails because of
uninitialized error. This patch fixes it.

Bugzilla ID: 509
Fixes: 1e46b3962620 ("net/bnxt: fill cfa action in Tx descriptor")

Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Reviewed-by: Somnath Kotur <somnath.kotur@broadcom.com>
Reviewed-by: Venkat Duvvuru <venkatkumar.duvvuru@broadcom.com>
4 years agonet/bnxt: fix logical AND in if condition
Ajit Khaparde [Fri, 24 Jul 2020 00:04:37 +0000 (17:04 -0700)]
net/bnxt: fix logical AND in if condition

The if condition in bnxt_restore_mac_filters needs to check for
the result of logical AND. But it was not doing it resulting in
an incorrect check.

Fixes: b02f1573cd07 ("net/bnxt: restore MAC filters during reset recovery")
Cc: stable@dpdk.org
Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
4 years agonet/bnxt: cleanup VF representor device operations
Somnath Kotur [Thu, 23 Jul 2020 11:56:39 +0000 (17:26 +0530)]
net/bnxt: cleanup VF representor device operations

No need to access rx_cfa_code, cfa_code_map from the VF-Rep functions
anymore.

Fixes: 322bd6e70272 ("net/bnxt: add port representor infrastructure")

Reviewed-by: Venkat Duvvuru <venkatkumar.duvvuru@broadcom.com>
Signed-off-by: Somnath Kotur <somnath.kotur@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
4 years agonet/bnxt: enable shadow tables during session open
Mike Baucom [Thu, 23 Jul 2020 11:56:38 +0000 (17:26 +0530)]
net/bnxt: enable shadow tables during session open

Turn on shadow memory in the core to allow search before allocate.
This allows reuse of constrained resources.

Signed-off-by: Mike Baucom <michael.baucom@broadcom.com>
Reviewed-by: Venkat Duvvuru <venkatkumar.duvvuru@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
4 years agonet/bnxt: add templates for search before alloc
Mike Baucom [Thu, 23 Jul 2020 11:56:37 +0000 (17:26 +0530)]
net/bnxt: add templates for search before alloc

Search before alloc allows reuse of constrained resources such as tcam,
encap, and source modifications.  The new templates will search the
entry and alloc only if necessary.

Signed-off-by: Mike Baucom <michael.baucom@broadcom.com>
Reviewed-by: Venkat Duvvuru <venkatkumar.duvvuru@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
4 years agonet/bnxt: add TCAM table processing for search and alloc
Kishore Padmanabha [Thu, 23 Jul 2020 11:56:36 +0000 (17:26 +0530)]
net/bnxt: add TCAM table processing for search and alloc

Added support for tcam table processing to enable the search
and allocate support. This also includes the tcam entry update
support.

Signed-off-by: Kishore Padmanabha <kishore.padmanabha@broadcom.com>
Reviewed-by: Mike Baucom <michael.baucom@broadcom.com>
4 years agonet/bnxt: fix FW rule deletion on representor create
Venkat Duvvuru [Thu, 23 Jul 2020 11:56:34 +0000 (17:26 +0530)]
net/bnxt: fix FW rule deletion on representor create

Truflow stack adds VFR to VF and VF to VFR conduits when VF
representor is created. However, in the ingress direction the
VF's fw rules conflict with Truflow rules, resulting in not hitting
the Truflow VFR rules. To fix this, fw is going to remove it’s
VF rules when vf representor is created in Truflow mode and will
restore the removed rules when vf representor is destroyed.

This patch invokes the vf representor alloc and free hwrm commands
as part of which fw will do the above mentioned actions.

Fixes: 1e18ec58ed5c ("net/bnxt: create default flow rules for port reprentor")

Signed-off-by: Venkat Duvvuru <venkatkumar.duvvuru@broadcom.com>
Signed-off-by: Somnath Kotur <somnath.kotur@broadcom.com>
Reviewed-by: Shahaji Bhosle <sbhosle@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
4 years agonet/bnxt: fix port default rule create/destroy
Venkat Duvvuru [Thu, 23 Jul 2020 11:56:33 +0000 (17:26 +0530)]
net/bnxt: fix port default rule create/destroy

Currently, the flow_ids of port_to_app/app_to_port & tx_cfa_action
for the first port are getting over-written by the second port because
these fields are stored in the ulp context which is common across the
ports.

This patch fixes the problem by having per port structure to store these
fields.

Fixes: 9f702636d7ba ("net/bnxt: add port default rules for ingress and egress")

Signed-off-by: Venkat Duvvuru <venkatkumar.duvvuru@broadcom.com>
Reviewed-by: Somnath Kotur <somnath.kotur@broadcom.com>
Reviewed-by: Kishore Padmanabha <kishore.padmanabha@broadcom.com>
4 years agonet/bnxt: modify ULP mapper to use table search
Mike Baucom [Thu, 23 Jul 2020 11:56:32 +0000 (17:26 +0530)]
net/bnxt: modify ULP mapper to use table search

Modified ulp mapper to use the new tf_search_tbl_entry API.
When search before allocation is requested, mapper calls
tc_search_tbl_entry with the alloc flag.

- On HIT, the result and table index is returned.
- On MISS, the table index is returned but the result is
created and the table entry is set.
- On REJECT, the flow request is rejected.

Signed-off-by: Mike Baucom <michael.baucom@broadcom.com>
Reviewed-by: Kishore Padmanabha <kishore.padmanabha@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
4 years agonet/bnxt: add shadow table capability with search
Mike Baucom [Thu, 23 Jul 2020 11:56:31 +0000 (17:26 +0530)]
net/bnxt: add shadow table capability with search

- Added Index Table shadow tables for searching
- Added Search API to allow reuse of Table entries

Signed-off-by: Mike Baucom <michael.baucom@broadcom.com>
Reviewed-by: Farah Smith <farah.smith@broadcom.com>
4 years agonet/bnxt: update shadow TCAM to use TruFlow hash
Mike Baucom [Thu, 23 Jul 2020 11:56:30 +0000 (17:26 +0530)]
net/bnxt: update shadow TCAM to use TruFlow hash

Removed the hash calculation from tf_shadow_tcam in favor of using a
new common implementation.

Signed-off-by: Mike Baucom <michael.baucom@broadcom.com>
Reviewed-by: Kishore Padmanabha <kishore.padmanabha@broadcom.com>
Reviewed-by: Farah Smith <farah.smith@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
4 years agonet/bnxt: add egress template with VLAN tag match
Kishore Padmanabha [Thu, 23 Jul 2020 11:56:29 +0000 (17:26 +0530)]
net/bnxt: add egress template with VLAN tag match

Added egress template with VLAN tag match

Signed-off-by: Kishore Padmanabha <kishore.padmanabha@broadcom.com>
Reviewed-by: Shahaji Bhosle <sbhosle@broadcom.com>
4 years agonet/bnxt: ignore VLAN priority mask
Kishore Padmanabha [Thu, 23 Jul 2020 11:56:28 +0000 (17:26 +0530)]
net/bnxt: ignore VLAN priority mask

This is a work around for the OVS setting offload rules that
are passing vlan priority mask as wild card and currently we
do not support it.

Signed-off-by: Kishore Padmanabha <kishore.padmanabha@broadcom.com>
Reviewed-by: Mike Baucom <michael.baucom@broadcom.com>
4 years agonet/bnxt: configure PARIF for egress rules
Kishore Padmanabha [Thu, 23 Jul 2020 11:56:27 +0000 (17:26 +0530)]
net/bnxt: configure PARIF for egress rules

The parif for the egress rules need to be dynamically
configured based on the port type.
PARIF is handler to a partition of the physical port.

Signed-off-by: Kishore Padmanabha <kishore.padmanabha@broadcom.com>
Reviewed-by: Mike Baucom <michael.baucom@broadcom.com>
4 years agonet/bnxt: fix NAT template
Kishore Padmanabha [Thu, 23 Jul 2020 11:56:26 +0000 (17:26 +0530)]
net/bnxt: fix NAT template

The template is updated to support additional combinations
of NAT actions.

Fixes: 2951f7f31112 ("net/bnxt: support NAT action items")

Signed-off-by: Kishore Padmanabha <kishore.padmanabha@broadcom.com>
Reviewed-by: Mike Baucom <michael.baucom@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
4 years agonet/bnxt: fix mark id update to mbuf
Venkat Duvvuru [Thu, 23 Jul 2020 11:56:25 +0000 (17:26 +0530)]
net/bnxt: fix mark id update to mbuf

When a packet is looped back from VF to VFR, it is marked to identify
the VFR interface. However, this mark_id shouldn't be percolated up to
the OVS as it is internal to pmd.
This patch fixes it by skipping mark injection into mbuf if the packet
is received on VFR interface.

Fixes: 6dc83230b43b ("net/bnxt: support port representor data path")

Signed-off-by: Venkat Duvvuru <venkatkumar.duvvuru@broadcom.com>
Signed-off-by: Sriharsha Basavapatna <sriharsha.basavapatna@broadcom.com>
Reviewed-by: Somnath Kotur <somnath.kotur@broadcom.com>
4 years agonet/bnxt: add TruFlow hash function
Mike Baucom [Thu, 23 Jul 2020 11:56:24 +0000 (17:26 +0530)]
net/bnxt: add TruFlow hash function

Added TruFlow hash API for common hash uses across TruFlow
core functions.

Signed-off-by: Mike Baucom <michael.baucom@broadcom.com>
Reviewed-by: Farah Smith <farah.smith@broadcom.com>
Reviewed-by: Kishore Padmanabha <kishore.padmanabha@broadcom.com>
4 years agonet/bnxt: modify ULP mapper to use TCAM search
Mike Baucom [Thu, 23 Jul 2020 11:56:23 +0000 (17:26 +0530)]
net/bnxt: modify ULP mapper to use TCAM search

Modified ulp mapper to use the new tf_search_tcam_entry API.
When search before allocation is requested, mapper calls
tc_search_tcam_entry with the alloc flag.

- On HIT, the result and tcam index is returned.
- On MISS, the tcam index is returned but the result is
created and the tcam entry is set.
- On REJECT, the flow request is rejected.

Signed-off-by: Mike Baucom <michael.baucom@broadcom.com>
Reviewed-by: Kishore Padmanabha <kishore.padmanabha@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
4 years agonet/bnxt: configure PARIF for offload miss rules
Kishore Padmanabha [Thu, 23 Jul 2020 11:56:22 +0000 (17:26 +0530)]
net/bnxt: configure PARIF for offload miss rules

PARIF is handler to a partition of the physical port.
For the offload miss rules, the parif miss path needs to be
considered. The higher parif are reserved for handling this.

Signed-off-by: Kishore Padmanabha <kishore.padmanabha@broadcom.com>
Reviewed-by: Mike Baucom <michael.baucom@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
4 years agonet/bnxt: add access to NAT global register
Kishore Padmanabha [Thu, 23 Jul 2020 11:56:21 +0000 (17:26 +0530)]
net/bnxt: add access to NAT global register

Add support to enable or disable the NAT global registers.
The NAT feature is enabled in hardware during initialization
and disabled at deinitialization of the application.

Signed-off-by: Kishore Padmanabha <kishore.padmanabha@broadcom.com>
Reviewed-by: Mike Baucom <michael.baucom@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
4 years agonet/bnxt: add shadow and search capability to TCAM
Mike Baucom [Thu, 23 Jul 2020 11:56:20 +0000 (17:26 +0530)]
net/bnxt: add shadow and search capability to TCAM

- Add TCAM shadow tables for searching
- Add Search API to allow reuse of TCAM entries

Signed-off-by: Mike Baucom <michael.baucom@broadcom.com>
Reviewed-by: Randy Schacher <stuart.schacher@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
4 years agonet/mlx4: fix premature disabling of interrupt
Ophir Munk [Tue, 28 Jul 2020 11:54:06 +0000 (11:54 +0000)]
net/mlx4: fix premature disabling of interrupt

RXQ interrupts under Linux are based on the epoll mechanism. An
expected order of operations is as follows:
1. Call rte_eth_dev_rx_intr_enable(), to arm the CQ for receiving events
on data input.
2. Block on rte_epoll_wait() with an array of file descriptors
representing the CQ events. Upon data arrival the kernel will signal an
input event on the corresponding CQ fd.
3. Call rte_eth_dev_rx_intr_disable() after the event was received and
continue in polling mode. The mlx4 implementation of
rte_eth_dev_rx_intr_disable() is to get the CQ event and ack it.

In practice applications may wake up from rte_epoll_wait() due to
timeout with no event to ack but still call
rte_eth_dev_rx_intr_disable() unconditionally.  In such cases the call
should return EAGAIN (since the file descriptors are non-blocked), as
opposed to EINVAL which indicates a real failure.  In case of EAGAIN the
PMD should not warn on "unable to disable interrupt on rx queue".

Signed-off-by: Ophir Munk <ophirmu@mellanox.com>
Acked-by: Raslan Darawsheh <rasland@mellanox.com>
4 years agonet/hinic: check memory allocations in flow creation
Yunjian Wang [Tue, 28 Jul 2020 12:34:46 +0000 (20:34 +0800)]
net/hinic: check memory allocations in flow creation

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

Fixes: f4ca3fd54c4d ("net/hinic: create and destroy flow director filter")
Cc: stable@dpdk.org
Signed-off-by: Yunjian Wang <wangyunjian@huawei.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
4 years agonet/hinic/base: avoid system time jump
Xiaoyun Wang [Sat, 25 Jul 2020 08:15:36 +0000 (16:15 +0800)]
net/hinic/base: avoid system time jump

Replace gettimeofday() with clock_gettime(CLOCK_MONOTONIC_RAW, &now),
the reason is same with
commit d08d304508a8 ("eal/linux: make alarm not affected by system time
jump")

Fixes: 81d53291a466 ("net/hinic/base: add various headers")
Cc: stable@dpdk.org
Signed-off-by: Xiaoyun Wang <cloud.wangxiaoyun@huawei.com>
4 years agonet/hinic/base: modify VHD type for SDI
Xiaoyun Wang [Sat, 25 Jul 2020 08:15:35 +0000 (16:15 +0800)]
net/hinic/base: modify VHD type for SDI

For ovs offload scenario, when fw processes the virtio header,
there is no need to offset; and for standard card scenarios,
fw does not care about the vhd_type parameter, so in order to
be compatible with these two scenarios, use 0 offset instead.

Signed-off-by: Xiaoyun Wang <cloud.wangxiaoyun@huawei.com>
4 years agonet/hinic: optimize Rx performance for x86
Xiaoyun Wang [Sat, 25 Jul 2020 08:15:34 +0000 (16:15 +0800)]
net/hinic: optimize Rx performance for x86

For x86 platform, the rq cqe without cache aligned, which can
improve performance for some gateway scenarios.

Fixes: 361a9ccf81d6 ("net/hinic: optimize Rx performance")
Cc: stable@dpdk.org
Signed-off-by: Xiaoyun Wang <cloud.wangxiaoyun@huawei.com>
4 years agonet/hinic: refactor checksum functions
Xiaoyun Wang [Sat, 25 Jul 2020 08:15:33 +0000 (16:15 +0800)]
net/hinic: refactor checksum functions

Encapsulate different types of packet checksum preprocessing
into functions.

Signed-off-by: Xiaoyun Wang <cloud.wangxiaoyun@huawei.com>