dpdk.git
3 years agodoc: fix sphinx rtd theme import in GHA
David Marchand [Thu, 1 Apr 2021 19:58:42 +0000 (21:58 +0200)]
doc: fix sphinx rtd theme import in GHA

If the rtd theme is available, passing it by name is enough to select
it. Sphinx itself recognises the "sphinx_rtd_theme" name as a special
case and tries to find its path automatically.

On the other hand, passing a html_theme_path makes sphinx parse all
themes availables in this path, which in some environment (like GHA) is
/usr/share and makes sphinx error on the first zipfile it finds (in GHA,
some Azure CLI thingy) that has no sphinx theme in it.

Fixes: 46562be65094 ("doc: import sphinx rtd theme when available")
Cc: stable@dpdk.org
Signed-off-by: David Marchand <david.marchand@redhat.com>
Acked-by: Aaron Conole <aconole@redhat.com>
3 years agovdpa/mlx5: fix virtq cleaning
Matan Azrad [Mon, 1 Mar 2021 10:41:31 +0000 (10:41 +0000)]
vdpa/mlx5: fix virtq cleaning

The HW virtq object can be destroyed either when the device is closed or
when the state of the virtq becomes disabled.

Some parameters of the virtq should continue to be managed when the
virtq state is changed but all of them must be initialized when the
device is closed.

Wrongly, the enable parameter stayed on when the device is closed what
might cause creation of invalid virtq in the next time a device is
assigned to the driver.

Clean all the virtqs memory when the device is closed.

Fixes: c47d6e83334e ("vdpa/mlx5: support queue update")
Cc: stable@dpdk.org
Signed-off-by: Matan Azrad <matan@nvidia.com>
Acked-by: Xueming Li <xuemingl@nvidia.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
3 years agonet/virtio: remove duplicated port ID from virtio-user
David Marchand [Mon, 1 Feb 2021 17:46:01 +0000 (18:46 +0100)]
net/virtio: remove duplicated port ID from virtio-user

The private virtio_user_dev structure embeds a virtio_hw which itself
contains the ethdev port_id.
Make use of it and remove the duplicate port_id field.

Signed-off-by: David Marchand <david.marchand@redhat.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
3 years agoexamples/vhost_crypto: remove unused short option
Ibtisam Tariq [Thu, 4 Feb 2021 08:05:42 +0000 (08:05 +0000)]
examples/vhost_crypto: remove unused short option

Short option "s" was passed to getopt_long function, while there was
no condition on this option.

Fixes: f5188211c721 ("examples/vhost_crypto: add sample application")
Cc: stable@dpdk.org
Signed-off-by: Ibtisam Tariq <ibtisam.tariq@emumba.com>
Acked-by: Fan Zhang <roy.fan.zhang@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
3 years agovhost: fix batch dequeue potential buffer overflow
Marvin Liu [Wed, 31 Mar 2021 06:49:39 +0000 (14:49 +0800)]
vhost: fix batch dequeue potential buffer overflow

Similar as single dequeue, the multiple accesses of descriptor length
will lead to potential risk. One-time access of descriptor length can
eliminate this risk.

Fixes: 75ed51697820 ("vhost: add packed ring batch dequeue")
Cc: stable@dpdk.org
Signed-off-by: Marvin Liu <yong.liu@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
3 years agovhost: fix packed ring potential buffer overflow
Marvin Liu [Wed, 31 Mar 2021 06:49:38 +0000 (14:49 +0800)]
vhost: fix packed ring potential buffer overflow

Similar as split ring, the multiple accesses of descriptor length will
lead to potential risk. One-time access of descriptor length can
eliminate this risk.

Fixes: 2f3225a7d69b ("vhost: add vector filling support for packed ring")
Cc: stable@dpdk.org
Signed-off-by: Marvin Liu <yong.liu@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
3 years agovhost: fix split ring potential buffer overflow
Marvin Liu [Wed, 31 Mar 2021 06:49:37 +0000 (14:49 +0800)]
vhost: fix split ring potential buffer overflow

In vhost datapath, descriptor's length are mostly used in two coherent
operations. First step is used for address translation, second step is
used for memory transaction from guest to host. But the interval between
two steps will give a window for malicious guest, in which can change
descriptor length after vhost calculated buffer size. Thus may lead to
buffer overflow in vhost side. This potential risk can be eliminated by
accessing the descriptor length once.

Fixes: 1be4ebb1c464 ("vhost: support indirect descriptor in mergeable Rx")
Cc: stable@dpdk.org
Signed-off-by: Marvin Liu <yong.liu@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
3 years agoexamples/vhost: check memory table query
Chenbo Xia [Fri, 19 Feb 2021 02:40:11 +0000 (10:40 +0800)]
examples/vhost: check memory table query

This patch fixes unchecked return value for rte_vhost_get_mem_table(),
which is reported by coverity.

Coverity issue: 364233
Fixes: ca059fa5e290 ("examples/vhost: demonstrate the new generic APIs")
Cc: stable@dpdk.org
Signed-off-by: Chenbo Xia <chenbo.xia@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
3 years agovdpa/ifc: check PCI config read
Xiao Wang [Tue, 9 Mar 2021 08:43:15 +0000 (16:43 +0800)]
vdpa/ifc: check PCI config read

The return value of rte_pci_read_config should be checked.

Coverity issue: 302860
Fixes: a3f8150eac6d ("net/ifcvf: add ifcvf vDPA driver")
Cc: stable@dpdk.org
Signed-off-by: Xiao Wang <xiao.w.wang@intel.com>
Reviewed-by: Chenbo Xia <chenbo.xia@intel.com>
3 years agoexamples/vhost_blk: check features before inflight API
Keiichi Watanabe [Mon, 22 Mar 2021 07:22:57 +0000 (16:22 +0900)]
examples/vhost_blk: check features before inflight API

Avoid calling rte_vhost_get_vhost_ring_inflight() and
rte_vhost_get_vring_base_from_inflight() when
VHOST_USER_PROTOCOL_F_INFLIGHT_SHMFD is not set.

Signed-off-by: Keiichi Watanabe <keiichiw@chromium.org>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
3 years agovhost: get negotiated protocol features
Keiichi Watanabe [Mon, 22 Mar 2021 07:22:56 +0000 (16:22 +0900)]
vhost: get negotiated protocol features

Add rte_vhost_get_negotiated_protocol_features, which returns a set of
enabled protocol features.

Signed-off-by: Keiichi Watanabe <keiichiw@chromium.org>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
3 years agovhost: optimize virtqueue structure
Maxime Coquelin [Tue, 23 Mar 2021 09:02:19 +0000 (10:02 +0100)]
vhost: optimize virtqueue structure

This patch moves vhost_virtqueue struct fields in order
to both optimize packing and move hot fields on the first
cachelines.

Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Reviewed-by: Chenbo Xia <chenbo.xia@intel.com>
Reviewed-by: David Marchand <david.marchand@redhat.com>
Tested-by: Balazs Nemeth <bnemeth@redhat.com>
3 years agovhost: move dirty logging cache out of virtqueue
Maxime Coquelin [Tue, 23 Mar 2021 09:02:18 +0000 (10:02 +0100)]
vhost: move dirty logging cache out of virtqueue

This patch moves the per-virtqueue's dirty logging cache
out of the virtqueue struct, by allocating it dynamically
only when live-migration is enabled.

It saves 8 cachelines in vhost_virtqueue struct.

Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Reviewed-by: Chenbo Xia <chenbo.xia@intel.com>
Reviewed-by: David Marchand <david.marchand@redhat.com>
Tested-by: Balazs Nemeth <bnemeth@redhat.com>
3 years agovhost: remove unused virtqueue field
Maxime Coquelin [Tue, 23 Mar 2021 09:02:17 +0000 (10:02 +0100)]
vhost: remove unused virtqueue field

This patch removes the "backend" field of the
vhost_virtqueue struct, which is not used by the
library.

Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Reviewed-by: Chenbo Xia <chenbo.xia@intel.com>
Reviewed-by: David Marchand <david.marchand@redhat.com>
Tested-by: Balazs Nemeth <bnemeth@redhat.com>
3 years agonet/virtio: pack virtqueue structure
Maxime Coquelin [Tue, 16 Mar 2021 09:38:25 +0000 (10:38 +0100)]
net/virtio: pack virtqueue structure

This patch optimizes packing of the virtqueue
struct by moving fields around to fill holes.

Offset field is not used and so can be removed.

Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Reviewed-by: Chenbo Xia <chenbo.xia@intel.com>
Reviewed-by: David Marchand <david.marchand@redhat.com>
Tested-by: Balazs Nemeth <bnemeth@redhat.com>
3 years agonet/virtio: allocate fake mbuf in Rx queue
Maxime Coquelin [Tue, 16 Mar 2021 09:38:24 +0000 (10:38 +0100)]
net/virtio: allocate fake mbuf in Rx queue

While it is worth clarifying whether the fake mbuf
in virtnet_rx struct is really necessary, it is sure
that it heavily impacts cache usage by being part of
the struct. Indeed, it uses two cachelines, and
requires alignment on a cacheline.

Before this series, it means it took 120 bytes in
virtnet_rx struct:

struct virtnet_rx {
 struct virtqueue *vq; /*0 8*/

 /* XXX 56 bytes hole, try to pack */

 /* --- cacheline 1 boundary (64 bytes) --- */
 struct rte_mbuf fake_mbuf __attribute__((__aligned__(64))); /*64 128*/
 /* --- cacheline 3 boundary (192 bytes) --- */

This patch allocates it using malloc in order to optimize
virtnet_rx cache usage and so virtqueue cache usage.

Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Reviewed-by: David Marchand <david.marchand@redhat.com>
Reviewed-by: Chenbo Xia <chenbo.xia@intel.com>
Tested-by: Balazs Nemeth <bnemeth@redhat.com>
3 years agonet/virtio: improve queue init error path
Maxime Coquelin [Tue, 16 Mar 2021 09:38:23 +0000 (10:38 +0100)]
net/virtio: improve queue init error path

This patch improves the error path of virtio_init_queue(),
by cleaning in reversing order all resources that have
been allocated.

Suggested-by: Chenbo Xia <chenbo.xia@intel.com>
Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Reviewed-by: David Marchand <david.marchand@redhat.com>
Reviewed-by: Chenbo Xia <chenbo.xia@intel.com>
Tested-by: Balazs Nemeth <bnemeth@redhat.com>
3 years agonet/virtio: remove reference to virtqueue in vrings
Maxime Coquelin [Tue, 16 Mar 2021 09:38:22 +0000 (10:38 +0100)]
net/virtio: remove reference to virtqueue in vrings

Vrings are part of the virtqueues, so we don't need
to have a pointer to it in Vrings descriptions.

Instead, let's just subtract from its offset to
calculate virtqueue address.

Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Reviewed-by: Chenbo Xia <chenbo.xia@intel.com>
Reviewed-by: David Marchand <david.marchand@redhat.com>
Tested-by: Balazs Nemeth <bnemeth@redhat.com>
3 years agonet/qede: remove unnecessary field in Rx entry and simplify
Balazs Nemeth [Fri, 26 Mar 2021 11:01:30 +0000 (12:01 +0100)]
net/qede: remove unnecessary field in Rx entry and simplify

The member page_offset is always zero. Having this in the qede_rx_entry
makes it larger than it needs to be and this has cache performance
implications so remove that field. In addition, since qede_rx_entry only
has an rte_mbuf*, remove the definition of qede_rx_entry.

Signed-off-by: Balazs Nemeth <bnemeth@redhat.com>
Reviewed-by: Igor Russkikh <irusskikh@marvell.com>
3 years agonet/qede: prefetch next packet to free
Balazs Nemeth [Fri, 26 Mar 2021 11:01:29 +0000 (12:01 +0100)]
net/qede: prefetch next packet to free

While handling the current mbuf, pull the next mbuf into the cache. Note
that the last four mbufs pulled into the cache are not handled, but that
doesn't matter.

Signed-off-by: Balazs Nemeth <bnemeth@redhat.com>
Reviewed-by: Igor Russkikh <irusskikh@marvell.com>
3 years agonet/qede: prefetch hardware consumer
Balazs Nemeth [Fri, 26 Mar 2021 11:01:28 +0000 (12:01 +0100)]
net/qede: prefetch hardware consumer

Ensure that, while ecore_chain_get_cons_idx is running, txq->hw_cons_ptr
is prefetched. This shows a slight performance improvement.

Signed-off-by: Balazs Nemeth <bnemeth@redhat.com>
Reviewed-by: Igor Russkikh <irusskikh@marvell.com>
3 years agonet/qede: free packets in bulk
Balazs Nemeth [Fri, 26 Mar 2021 11:01:27 +0000 (12:01 +0100)]
net/qede: free packets in bulk

rte_pktmbuf_free_bulk calls rte_mempool_put_bulk with the number of
pending packets to return to the mempool. In contrast, rte_pktmbuf_free
calls rte_mempool_put that calls rte_mempool_put_bulk with one object.
An important performance related downside of adding one packet at a time
to the mempool is that on each call, the per-core cache pointer needs to
be read from tls while a single rte_mempool_put_bulk only reads from the
tls once.

Signed-off-by: Balazs Nemeth <bnemeth@redhat.com>
Reviewed-by: Igor Russkikh <irusskikh@marvell.com>
3 years agonet/qede: assume mbuf to free is never null
Balazs Nemeth [Fri, 26 Mar 2021 11:01:26 +0000 (12:01 +0100)]
net/qede: assume mbuf to free is never null

The ring txq->sw_tx_ring is managed with txq->sw_tx_cons. As long as
txq->sw_tx_cons is correct, there is no need to check if
txq->sw_tx_ring[idx] is null explicitly.

Signed-off-by: Balazs Nemeth <bnemeth@redhat.com>
Reviewed-by: Igor Russkikh <irusskikh@marvell.com>
3 years agonet/qede: get consumer index once
Balazs Nemeth [Fri, 26 Mar 2021 11:01:25 +0000 (12:01 +0100)]
net/qede: get consumer index once

Calling ecore_chain_get_cons_idx repeatedly is slower than calling it
once and using the result for the remainder of qede_process_tx_compl.

Signed-off-by: Balazs Nemeth <bnemeth@redhat.com>
Reviewed-by: Igor Russkikh <irusskikh@marvell.com>
3 years agonet/qede: remove flags from Tx entry
Balazs Nemeth [Fri, 26 Mar 2021 11:01:24 +0000 (12:01 +0100)]
net/qede: remove flags from Tx entry

Each sw_tx_ring entry was of type struct qede_tx_entry:

struct qede_tx_entry {
       struct rte_mbuf *mbuf;
       uint8_t flags;
};

Leaving the unused flags member here has a few performance implications.
First, each qede_tx_entry takes up more memory which has caching
implications as less entries fit in a cache line while multiple entries
are frequently handled in batches. Second, an array of qede_tx_entry
entries is incompatible with existing APIs that expect an array of
rte_mbuf pointers. Consequently, an extra array need to be allocated
before calling such APIs and each entry needs to be copied over.

This patch omits the flags field and replaces the qede_tx_entry entry
by a simple rte_mbuf pointer.

Signed-off-by: Balazs Nemeth <bnemeth@redhat.com>
Reviewed-by: Igor Russkikh <irusskikh@marvell.com>
3 years agonet/mlx5: reject tunnel ID modification
Alexander Kozyrev [Wed, 24 Mar 2021 15:04:39 +0000 (15:04 +0000)]
net/mlx5: reject tunnel ID modification

Modification of the 802.1Q Tag Identifier, VXLAN Network
Identifier or GENEVE Network Identifier is not supported.
Reject attempt to modify these fields via the MODIFY_FIELD
action and document this mlx5 driver limitation.

Fixes: 641dbe4fb053 ("net/mlx5: support modify field flow action")
Cc: stable@dpdk.org
Signed-off-by: Alexander Kozyrev <akozyrev@nvidia.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
3 years agonet/mlx5: allow modify field action on group 0
Alexander Kozyrev [Wed, 24 Mar 2021 15:04:37 +0000 (15:04 +0000)]
net/mlx5: allow modify field action on group 0

There is a limitation about copying one header field to another for
the Flow group 0. Such copy action is not allowed there. But setting
a header field with an immediate value is perfectly fine.
Allow the MODIFY_FIELD action on group 0 in case the source field
is an immediate value or a pointer to it.

Signed-off-by: Alexander Kozyrev <akozyrev@nvidia.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
3 years agonet/mlx5: check extended metadata for mark modification
Alexander Kozyrev [Wed, 24 Mar 2021 15:04:36 +0000 (15:04 +0000)]
net/mlx5: check extended metadata for mark modification

The MODIFY_FIELD action requires the extended metadata support
in order to manipulate on MARK register. Check if it is supported
and reject the MODIFY_FIELD action if it is not.

Fixes: 641dbe4fb053 ("net/mlx5: support modify field flow action")
Cc: stable@dpdk.org
Signed-off-by: Alexander Kozyrev <akozyrev@nvidia.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
3 years agonet/mlx5: adjust modify field action endianness
Alexander Kozyrev [Wed, 24 Mar 2021 15:04:35 +0000 (15:04 +0000)]
net/mlx5: adjust modify field action endianness

Masks that used to modify a packet field must be in a big
endian format. Convert then to BE to ensure proper modification.

Fixes: 641dbe4fb053 ("net/mlx5: support modify field flow action")
Cc: stable@dpdk.org
Signed-off-by: Alexander Kozyrev <akozyrev@nvidia.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
3 years agonet/mlx5: check field size in modify field action
Alexander Kozyrev [Wed, 24 Mar 2021 15:04:34 +0000 (15:04 +0000)]
net/mlx5: check field size in modify field action

Add a validation check to make sure that the specified width
for MODIFY_FIELD RTE action is not bigger than a field size.

Fixes: 641dbe4fb053 ("net/mlx5: support modify field flow action")
Cc: stable@dpdk.org
Signed-off-by: Alexander Kozyrev <akozyrev@nvidia.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
3 years agonet/mlx5: probe host PF representor with sub-function
Xueming Li [Sun, 28 Mar 2021 13:48:15 +0000 (13:48 +0000)]
net/mlx5: probe host PF representor with sub-function

To simplify BlueField HPF representor(vf[-1]) probe, this patch allows
probe it with "sf" syntax: "sf[-1]".

Signed-off-by: Xueming Li <xuemingl@nvidia.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
3 years agonet/mlx5: improve xstats of bonding port
Xueming Li [Sun, 28 Mar 2021 13:48:14 +0000 (13:48 +0000)]
net/mlx5: improve xstats of bonding port

In case of kernel bonding device, counter was read from first bonding PF
member.

This patch reads all member PFs and sums to get bond xstats.

Signed-off-by: Xueming Li <xuemingl@nvidia.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
3 years agonet/mlx5: fix setting VF default MAC through representor
Xueming Li [Sun, 28 Mar 2021 13:48:13 +0000 (13:48 +0000)]
net/mlx5: fix setting VF default MAC through representor

With kernel bonding, there was an error when setting VF MAC address
through representor. The Netlink API requires ifindex of owner PF, not
bonding device ifindex.

Uses owner PF ifindex to modify VF default MAC in case of bonding
device.

Fixes: c21e5facf7d2 ("net/mlx5: use bond index for netdev operations")
Cc: stable@dpdk.org
Signed-off-by: Xueming Li <xuemingl@nvidia.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
3 years agonet/mlx5: save bonding member ports information
Xueming Li [Sun, 28 Mar 2021 13:48:12 +0000 (13:48 +0000)]
net/mlx5: save bonding member ports information

Since kernel bonding netdev doesn't provide statistics counter that
reflects all member ports, PMD has to manually summarize counters from
each member ports.

As a preparation, this patch collects bonding member port information
and saves to shared context data.

Signed-off-by: Xueming Li <xuemingl@nvidia.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
3 years agonet/mlx5: support list of representor PF
Xueming Li [Sun, 28 Mar 2021 13:48:11 +0000 (13:48 +0000)]
net/mlx5: support list of representor PF

To probe representors from different kernel bonding PFs, had to specify
2 separate devargs like this:
    -a 03:00.0,representor=pf0vf[0-3] -a 03:00.0,representor=pf1vf[0-3]

This patch supports range or list of PF section in devargs, so the
alternative short devargs of above is:
    -a 03:00.0,representor=pf[0-1]vf[0-3]

Signed-off-by: Xueming Li <xuemingl@nvidia.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
3 years agonet/mlx5: refactor bonding representor probing
Xueming Li [Sun, 28 Mar 2021 13:48:10 +0000 (13:48 +0000)]
net/mlx5: refactor bonding representor probing

To probe representor on 2nd PF of kernel bonding device, had to specify
PF1 BDF in devarg:
  <PF1_BDF>,representor=0
When closing bonding device, all representors had to be closed together
and this implies all representors have to use primary PF of bonding
device. So after probing representor port on 2nd PF, when locating new
probed device using device argument, the filter used 2nd PF as PCI
address and failed to locate new device.

Conflict happened by using current representor devargs:
 - Use PCI BDF to specify representor owner PF
 - Use PCI BDF to locate probed representor device.
 - PMD uses primary PCI BDF as PCI device.

To resolve such conflicts, new representor syntax is introduced here:
  <primary BDF>,representor=pfXvfY
All representors must use primary PF as owner PCI device, PMD internally
locate owner PCI address by checking representor "pfX" part. To EAL, all
representors are registered to primary PCI device, the 2nd PF is hidden
to EAL, thus all search should be consistent.

Same to VF representor, HPF (host PF on BlueField) uses same syntax to
probe, example: representor=pf1vf[0-3,-1]

This patch also adds pf index into kernel bonding representor port name:
<BDF>_<ib_name>_representor_pf<X>vf<Y>

Signed-off-by: Xueming Li <xuemingl@nvidia.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
3 years agonet/mlx5: revert setting bonding representor to first PF
Xueming Li [Sun, 28 Mar 2021 13:48:09 +0000 (13:48 +0000)]
net/mlx5: revert setting bonding representor to first PF

With kernel bonding, representors on second PF are being probed by
devargs:
<primary_bdf>,representor=pf1vf<N>
No need to save primary PF port ID and lookup when probing sibling
ports, revert patch [1]

[1]:
commit e6818853c022 ("net/mlx5: set representor to first PF in bonding mode")

Signed-off-by: Xueming Li <xuemingl@nvidia.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
3 years agonet/mlx5: support sub-function representor
Xueming Li [Sun, 28 Mar 2021 13:48:08 +0000 (13:48 +0000)]
net/mlx5: support sub-function representor

This patch adds support for SF representor. Similar to VF representor,
switch port name of SF representor in phys_port_name sysfs key is
"pf<x>sf<y>".

Device representor argument is "representors=sf[list]", list member
could be mix of instance and range. Example:
  representors=sf[0,2,4,8-12,-1]

To probe VF representor and SF representor, need to separate into 2
devices:
  -a <BDF>,representor=vf[list] -a <BDF>,representor=sf[list]

Signed-off-by: Xueming Li <xuemingl@nvidia.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
3 years agocommon/mlx5: support sub-function representor parsing
Xueming Li [Sun, 28 Mar 2021 13:48:07 +0000 (13:48 +0000)]
common/mlx5: support sub-function representor parsing

This patch supports representor name parsing for SF.
In sysfs, representor name stored under "phys_port_name" sysfs key,
similar to VF representor, switch port name of SF representor is
"pf<x>sf<y>".

For netlink message, net SF type is supported.

Examples:

pf0sf1
pf0sf[0-3]

Signed-off-by: Xueming Li <xuemingl@nvidia.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
3 years agonet/mlx5: fix using flow tunnel before null check
Yunjian Wang [Sat, 27 Mar 2021 02:44:09 +0000 (10:44 +0800)]
net/mlx5: fix using flow tunnel before null check

Coverity flags that 'ctx->tunnel' variable is used before
it's checked for NULL. This patch fixes this issue.

Coverity issue: 366201
Fixes: 868d2e342cf3 ("net/mlx5: fix tunnel offload hub multi-thread protection")
Cc: stable@dpdk.org
Signed-off-by: Yunjian Wang <wangyunjian@huawei.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
3 years agonet/ice: refine RSS configure
Qi Zhang [Thu, 25 Mar 2021 12:42:41 +0000 (20:42 +0800)]
net/ice: refine RSS configure

The ICE_RSS_ANY_HEADERS will try to enable outer RSS for
non-tunnel case and inner RSS for tunnel case. This confuse
user.

As we already have ICE_RSS_INNER_HEADER for tunnel case,
So, replace ICE_RSS_ANY_HEADERS with ICE_RSS_OUTER_HEADERS
for all exist flow which only specified the outer pattern.

To enable inner RSS for any tunnel cases, a separated rule
should be enabled.

The patch also remove some unnecessary condition check for GTPU
in base code, as we already can support outer RSS for GTPU.

Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Xuan Ding <xuan.ding@intel.com>
3 years agonet/ixgbe: fix RSS RETA being reset after port start
Murphy Yang [Mon, 29 Mar 2021 08:28:45 +0000 (08:28 +0000)]
net/ixgbe: fix RSS RETA being reset after port start

If one calls ‘rte_eth_dev_rss_reta_update’ with ixgbe before starting
the device (but after setting everything else), then RSS RETA
configuration will be zero after starting the device.

This patch gives a notification if the port not started.

Bugzilla ID: 664
Fixes: 249358424eab ("ixgbe: RSS RETA configuration")
Cc: stable@dpdk.org
Signed-off-by: Murphy Yang <murphyx.yang@intel.com>
Acked-by: Haiyue Wang <haiyue.wang@intel.com>
3 years agonet/ice: remove redundant function
Haiyue Wang [Mon, 29 Mar 2021 04:56:26 +0000 (12:56 +0800)]
net/ice: remove redundant function

The function 'ice_is_profile_rule' is defined as 'ice_is_prof_rule' in
base code, which has the exactly same function body.

So remove the 'ice_is_profile_rule', use the 'ice_is_prof_rule' instead.

Signed-off-by: Haiyue Wang <haiyue.wang@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
3 years agonet/iavf: fix TSO max segment size
Qi Zhang [Mon, 1 Mar 2021 07:57:14 +0000 (15:57 +0800)]
net/iavf: fix TSO max segment size

According to Intel® AVF spec
(https://www.intel.com/content/dam/
www/public/us/en/documents/product-specifications/
ethernet-adaptive-virtual-function-hardware-spec.pdf)
section 2.2.2.3:
The max segment size(MSS) of TSO should not be set lower than 88.

Fixes: a2b29a7733ef ("net/avf: enable basic Rx Tx")
Cc: stable@dpdk.org
Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Beilei Xing <beilei.xing@intel.com>
3 years agonet/iavf: support GTPU inner IPv6 for flow director
Junfeng Guo [Fri, 26 Mar 2021 10:42:16 +0000 (10:42 +0000)]
net/iavf: support GTPU inner IPv6 for flow director

Support GTPU_(EH)_IPV6 inner L3 and L4 fields matching for AVF FDIR.

+------------------------------+---------------------------------+
|           Pattern            |            Input Set            |
+------------------------------+---------------------------------+
| eth/ipv4/gtpu/ipv6           | inner: src/dst ip               |
| eth/ipv4/gtpu/ipv6/udp       | inner: src/dst ip, src/dst port |
| eth/ipv4/gtpu/ipv6/tcp       | inner: src/dst ip, src/dst port |
| eth/ipv4/gtpu/eh/ipv6        | inner: src/dst ip               |
| eth/ipv4/gtpu/eh/ipv6/udp    | inner: src/dst ip, src/dst port |
| eth/ipv4/gtpu/eh/ipv6/tcp    | inner: src/dst ip, src/dst port |
| eth/ipv4/gtpu/eh(0)/ipv6     | inner: src/dst ip               |
| eth/ipv4/gtpu/eh(0)/ipv6/udp | inner: src/dst ip, src/dst port |
| eth/ipv4/gtpu/eh(0)/ipv6/tcp | inner: src/dst ip, src/dst port |
| eth/ipv4/gtpu/eh(1)/ipv6     | inner: src/dst ip               |
| eth/ipv4/gtpu/eh(1)/ipv6/udp | inner: src/dst ip, src/dst port |
| eth/ipv4/gtpu/eh(1)/ipv6/tcp | inner: src/dst ip, src/dst port |
+------------------------------+---------------------------------+

Signed-off-by: Junfeng Guo <junfeng.guo@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
3 years agonet/iavf: support GTPU inner IPv4 for flow director
Junfeng Guo [Fri, 26 Mar 2021 10:42:15 +0000 (10:42 +0000)]
net/iavf: support GTPU inner IPv4 for flow director

Support GTPU_(EH)_IPV4 inner L3 and L4 fields matching for AVF FDIR.

+------------------------------+---------------------------------+
|           Pattern            |            Input Set            |
+------------------------------+---------------------------------+
| eth/ipv4/gtpu/ipv4           | inner: src/dst ip               |
| eth/ipv4/gtpu/ipv4/udp       | inner: src/dst ip, src/dst port |
| eth/ipv4/gtpu/ipv4/tcp       | inner: src/dst ip, src/dst port |
| eth/ipv4/gtpu/eh/ipv4        | inner: src/dst ip               |
| eth/ipv4/gtpu/eh/ipv4/udp    | inner: src/dst ip, src/dst port |
| eth/ipv4/gtpu/eh/ipv4/tcp    | inner: src/dst ip, src/dst port |
| eth/ipv4/gtpu/eh(0)/ipv4     | inner: src/dst ip               |
| eth/ipv4/gtpu/eh(0)/ipv4/udp | inner: src/dst ip, src/dst port |
| eth/ipv4/gtpu/eh(0)/ipv4/tcp | inner: src/dst ip, src/dst port |
| eth/ipv4/gtpu/eh(1)/ipv4     | inner: src/dst ip               |
| eth/ipv4/gtpu/eh(1)/ipv4/udp | inner: src/dst ip, src/dst port |
| eth/ipv4/gtpu/eh(1)/ipv4/tcp | inner: src/dst ip, src/dst port |
+------------------------------+---------------------------------+

Signed-off-by: Junfeng Guo <junfeng.guo@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
3 years agonet/igc: fix Rx RSS hash offload capability
Alvin Zhang [Thu, 25 Mar 2021 01:51:50 +0000 (09:51 +0800)]
net/igc: fix Rx RSS hash offload capability

Add DEV_RX_OFFLOAD_RSS_HASH flag to the PMD's Rx offload capabilities
for it supports RSS hash delivery.

Fixes: 4f09bc55ac3d ("net/igc: implement device base operations")
Cc: stable@dpdk.org
Signed-off-by: Alvin Zhang <alvinx.zhang@intel.com>
Acked-by: Haiyue Wang <haiyue.wang@intel.com>
3 years agonet/i40e: announce request queue capability in PF
Robin Zhang [Fri, 12 Mar 2021 08:52:09 +0000 (08:52 +0000)]
net/i40e: announce request queue capability in PF

A new feature requesting additional queues from PF is added in iavf;
before sending VIRTCHNL_OP_REQUEST_QUEUES op code, the offload
capability flag VIRTCHNL_VF_OFFLOAD_REQ_QUEUES will be checked.

And due to DPDK PF is still used by some cases, add this offload
capability flag in i40e PF.

Fixes: cbdbd360f77f ("net/i40e: support AVF basic interface")
Cc: stable@dpdk.org
Signed-off-by: Robin Zhang <robinx.zhang@intel.com>
Acked-by: Jeff Guo <jia.guo@intel.com>
3 years agonet/iavf: fix packet length parsing in AVX512
Leyi Rong [Wed, 17 Mar 2021 09:17:56 +0000 (17:17 +0800)]
net/iavf: fix packet length parsing in AVX512

Fix pkt_len parsing when DEV_RX_OFFLOAD_KEEP_CRC is set in AVX512 path.

Fixes: 31737f2b66fb ("net/iavf: enable AVX512 for legacy Rx")
Fixes: 6df587028e57 ("net/iavf: enable AVX512 for flexible Rx")
Cc: stable@dpdk.org
Signed-off-by: Leyi Rong <leyi.rong@intel.com>
Tested-by: David Coyle <david.coyle@intel.com>
3 years agonet/iavf: implement power management
David Hunt [Thu, 11 Mar 2021 11:55:10 +0000 (11:55 +0000)]
net/iavf: implement power management

Implement support for the power management API by implementing a
`get_monitor_addr` function that will return an address of an RX ring's
status bit.

This patch is basically a cut-and-paste of the changes already
committed in ixgbe, i40e and ice drivers in 21.02. This extends
the availability of the power-saving mechanism to the iavf driver,
which is needed for those use-cases using virtual functions.

Patchset where PMD Power Management added in 21.02:
http://patchwork.dpdk.org/project/dpdk/list/?series=14756

Signed-off-by: David Hunt <david.hunt@intel.com>
Acked-by: Anatoly Burakov <anatoly.burakov@intel.com>
3 years agonet/i40e: fix parsing packet type for NEON
Feifei Wang [Wed, 10 Mar 2021 02:40:29 +0000 (10:40 +0800)]
net/i40e: fix parsing packet type for NEON

In i40e NEON vector Rx path, the packet descs processing is incorrect.
This caused wrong packet type been filled in mbuf.

To fix this, when shifting the pktlen field to be 16-bit aligned, it
only needs to process the high 16bit of the packet descs instead of
the high 32bit.

Test Results:
Architecture: arm64
NIC: XL710
Driver: i40e
Package: Ether()/IP()/

Without this patch:
desc_to_ptype_v: ptype = 7 (error)

With this patch:
desc_to_ptype_v: ptype = 23 (correct)

Fixes: ae0eb310f253 ("net/i40e: implement vector PMD for ARM")
Cc: stable@dpdk.org
Signed-off-by: Feifei Wang <feifei.wang2@arm.com>
Reviewed-by: Ruifeng Wang <ruifeng.wang@arm.com>
Tested-by: Kathleen Capella <kathleen.capella@arm.com>
3 years agoapp/testpmd: fix Tx/Rx descriptor query error log
Hongbo Zheng [Mon, 29 Mar 2021 06:46:43 +0000 (14:46 +0800)]
app/testpmd: fix Tx/Rx descriptor query error log

This patch adds more err info for Tx/Rx descriptor query command.

Fixes: fae9aa717d6c ("app/testpmd: support checking descriptor status")
Cc: stable@dpdk.org
Signed-off-by: Hongbo Zheng <zhenghongbo3@huawei.com>
Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
Acked-by: Xiaoyun Li <xiaoyun.li@intel.com>
3 years agonet/sfc: fix error path inconsistency
Ivan Malov [Fri, 26 Mar 2021 09:39:27 +0000 (12:39 +0300)]
net/sfc: fix error path inconsistency

At the fail label, there's a statement to set general errno and
error message. However, before the label is reached, a custom
error message can be set by the code which parses actions.
This custom (action-specific) message, when present,
must not be replaced by the general one.

Fixes: 662286ae61d2 ("net/sfc: add actions parsing stub to MAE backend")
Cc: stable@dpdk.org
Signed-off-by: Ivan Malov <ivan.malov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
Reviewed-by: Andy Moreton <amoreton@xilinx.com>
3 years agonet/af_xdp: mark recvfrom return as ignored
Ciara Loftus [Thu, 25 Mar 2021 08:22:09 +0000 (08:22 +0000)]
net/af_xdp: mark recvfrom return as ignored

Coverity complains that the return value of recvfrom() in the AF_XDP
datapath is not checked. We don't care about the return value because in
the case of an error we still return 0 from the receive function to
indicate no packets were received. So to make Coverity happy we cast the
return to 'void'.

Coverity issue: 369671
Fixes: 63e8989fe5a4 ("net/af_xdp: use recvfrom instead of poll syscall")

Signed-off-by: Ciara Loftus <ciara.loftus@intel.com>
3 years agonet/hinic: fix crash in secondary process
Guoyang Zhou [Tue, 23 Mar 2021 13:17:51 +0000 (21:17 +0800)]
net/hinic: fix crash in secondary process

Some apps, such as fstack, will use secondary process to access the
memory of eth_dev_ops, and they want to get the info of dev, but hinic
driver does not initialized it when in secondary process.

Fixes: 66f64dd6dc86 ("net/hinic: fix secondary process")
Cc: stable@dpdk.org
Signed-off-by: Guoyang Zhou <zhouguoyang@huawei.com>
3 years agoethdev: install driver headers
Tyler Retzlaff [Fri, 12 Mar 2021 22:20:06 +0000 (14:20 -0800)]
ethdev: install driver headers

Introduce a meson option 'enable_driver_sdk', when true installs internal
driver headers for ethdev. This allows drivers that do not depend on
stable api/abi to be built external to the dpdk source tree.

Signed-off-by: Tyler Retzlaff <roretzla@linux.microsoft.com>
Acked-by: Ferruh Yigit <ferruh.yigit@intel.com>
3 years agonet/hns3: fix long task queue pairs reset time
Chengchang Tang [Tue, 23 Mar 2021 13:45:56 +0000 (21:45 +0800)]
net/hns3: fix long task queue pairs reset time

Currently, the queue reset process needs to be performed one by one,
which is inefficient. However, the queues reset in the same function is
almost at the same stage. To optimize the queue reset process, a new
function has been added to the firmware command HNS3_OPC_CFG_RST_TRIGGER
to reset all queues in the same function at a time. And the related
queue reset MBX message is adjusted in the same way too.

Fixes: bba636698316 ("net/hns3: support Rx/Tx and related operations")
Cc: stable@dpdk.org
Signed-off-by: Chengchang Tang <tangchengchang@huawei.com>
Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
3 years agonet/hns3: fix link update when failed to get link info
Huisong Li [Tue, 23 Mar 2021 13:45:55 +0000 (21:45 +0800)]
net/hns3: fix link update when failed to get link info

In the "hns3_dev_link_update" API, the link information of the port is
obtained first, and then 'dev_link' in dev->data is updated. When the
driver is resetting or fails to obtain link info, the current driver
still reports the previous link info to the user. This may cause that
the dev->data->dev_link may be inconsistent with the hw link status.

Therefore, the link status consistency between the hardware, driver,
and framework can be ensured in this interface regardless of whether
the driver is normal or abnormal.

Fixes: 109e4dd1bd7a ("net/hns3: get link state change through mailbox")
Cc: stable@dpdk.org
Signed-off-by: Huisong Li <lihuisong@huawei.com>
Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
3 years agonet/hns3: fix Tx checksum for UDP packets with special port
Chengchang Tang [Tue, 23 Mar 2021 13:45:54 +0000 (21:45 +0800)]
net/hns3: fix Tx checksum for UDP packets with special port

For Kunpeng920 network engine, UDP packets with destination port 6081,
4789 or 4790 will be identified as tunnel packets. If the UDP CKSUM
offload is set in the mbuf, and the TX tunnel mask is not set, the
CKSUM of these packets will be wrong. In this case, the upper layer
user may not identify the packet as a tunnel packet, and processes it
as non-tunnel packet, and expect to offload the outer UDP CKSUM, so
they may not fill the outer L2/L3 length to mbuf. However, the HW
identifies these packet as tunnel packets and therefore offload the
inner UDP CKSUM. As a result, the inner and outer UDP CKSUM are
incorrect. And for non-tunnel UDP packets with preceding special
destination port will also exist similar checksum error.

For the new generation Kunpeng930 network engine, the above errata
have been fixed. Therefore, the concept of udp_cksum_mode is
introduced. There are two udp_cksum_mode for hns3 PMD,
HNS3_SPECIAL_PORT_HW_CKSUM_MODE means HW could solve the above
problem. And in HNS3_SPECIAL_PORT_SW_CKSUM_MODE, hns3 PMD will check
packets in the Tx prepare and perform the UDP CKSUM for such packets
to avoid a checksum error.

Fixes: bba636698316 ("net/hns3: support Rx/Tx and related operations")
Cc: stable@dpdk.org
Signed-off-by: Chengchang Tang <tangchengchang@huawei.com>
Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
3 years agonet/hns3: fix processing Tx offload flags
Chengchang Tang [Tue, 23 Mar 2021 13:45:53 +0000 (21:45 +0800)]
net/hns3: fix processing Tx offload flags

Currently, if the PKT_TX_TCP_SEG and PKT_TX_TCP_CKSUM offload flags set
in the same time, hns3 PMD can not process the descriptors correctly.

This patch fixes it by adding the processing of this situation.

Fixes: fb6eb9009f41 ("net/hns3: fix Tx checksum with fixed header length")
Cc: stable@dpdk.org
Signed-off-by: Chengchang Tang <tangchengchang@huawei.com>
Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
3 years agonet/hns3: fix build for SVE path
Huisong Li [Tue, 23 Mar 2021 13:45:52 +0000 (21:45 +0800)]
net/hns3: fix build for SVE path

The 'queue_full_cnt' stats have been encapsulated in 'dfx_stats'.
However, the modification in the SVE algorithm is omitted.
As a result, the driver fails to be compiled when the SVE
algorithm is used.

Fixes: 9b77f1fe303f ("net/hns3: encapsulate DFX stats in datapath")
Cc: stable@dpdk.org
Signed-off-by: Huisong Li <lihuisong@huawei.com>
Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
3 years agonet/hns3: fix reporting undefined speed
Huisong Li [Tue, 23 Mar 2021 13:45:51 +0000 (21:45 +0800)]
net/hns3: fix reporting undefined speed

There may be a case in future that the speed obtained from firmware
is undefined (such as, 400G or other rate), and link status of device is
up. At this case, PMD driver will reports 100Mbps to the user in the
"hns3_dev_link_update" API, which is unreasonable. Besides, if the
speed from firmware is zero, driver should report zero instead of
100Mbps.

Fixes: 59fad0f32135 ("net/hns3: support link update operation")
Cc: stable@dpdk.org
Signed-off-by: Huisong Li <lihuisong@huawei.com>
Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
3 years agonet/txgbe: add FFE parameters for user debugging
Jiawen Wu [Mon, 29 Mar 2021 03:17:24 +0000 (11:17 +0800)]
net/txgbe: add FFE parameters for user debugging

Support to set PHY link mode by user defined.

Signed-off-by: Jiawen Wu <jiawenwu@trustnetic.com>
3 years agonet/txgbe: handle AN interrupt and link update
Jiawen Wu [Mon, 29 Mar 2021 03:17:23 +0000 (11:17 +0800)]
net/txgbe: handle AN interrupt and link update

Read AN interrupt from misc, and do the AN configuration action.
When link status is down, PHY power should be restarted to config KR
mode again.

Signed-off-by: Jiawen Wu <jiawenwu@trustnetic.com>
3 years agonet/txgbe/base: support handling backplane AN73 flow
Jiawen Wu [Mon, 29 Mar 2021 03:17:22 +0000 (11:17 +0800)]
net/txgbe/base: support handling backplane AN73 flow

Suppot to handle the interrupt of auto-negotiation, improve the
link training process of connecting with other switches.

Signed-off-by: Jiawen Wu <jiawenwu@trustnetic.com>
3 years agonet/txgbe: update link setup process of backplane NICs
Jiawen Wu [Mon, 29 Mar 2021 03:17:21 +0000 (11:17 +0800)]
net/txgbe: update link setup process of backplane NICs

Add device arguments to support runtime options.
And use these configuration to control the link setup flow, to adapt to
different NIC's construction. Use firmware version to control the impact
of firmware update. And fix some left bugs.

Signed-off-by: Jiawen Wu <jiawenwu@trustnetic.com>
3 years agonet/txgbe: move firmware version get function to base code
Jiawen Wu [Mon, 29 Mar 2021 03:17:20 +0000 (11:17 +0800)]
net/txgbe: move firmware version get function to base code

Move firmware version get function to base code,
and store firmware version in PHY info.

Signed-off-by: Jiawen Wu <jiawenwu@trustnetic.com>
3 years agonet/txgbe: update device ID
Jiawen Wu [Mon, 29 Mar 2021 03:17:19 +0000 (11:17 +0800)]
net/txgbe: update device ID

For more different devices, update device ID and subsystem id.

Signed-off-by: Jiawen Wu <jiawenwu@trustnetic.com>
3 years agoethdev: replace callback getting filter operations
Thomas Monjalon [Sun, 21 Mar 2021 09:00:00 +0000 (10:00 +0100)]
ethdev: replace callback getting filter operations

Since rte_flow is the only API for filtering operations,
the legacy driver interface filter_ctrl was too much complicated
for the simple task of getting the struct rte_flow_ops.

The filter type RTE_ETH_FILTER_GENERIC and
the filter operarion RTE_ETH_FILTER_GET are removed.
The new driver callback flow_ops_get replaces filter_ctrl.

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Acked-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Acked-by: Haiyue Wang <haiyue.wang@intel.com>
Acked-by: Rosen Xu <rosen.xu@intel.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
Reviewed-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
3 years agonet/vmxnet3: enable on Windows
Dmitry Kozlyuk [Sun, 21 Feb 2021 00:55:52 +0000 (03:55 +0300)]
net/vmxnet3: enable on Windows

Remove OS restriction and update release notes.

For the record, tested on the following setup with Windows Server 2019 in
QEMU (-device vmxnet3) :

[ping     ]           [                     ]           [     ping]
[OS       ]           [    dpdk-skeleton    ]           [       OS]
[virtio---]--sockets--[---vmxnet3 vmxnet3---]--sockets--[---virtio]
[Debian VM]           [     Windows VM      ]           [Debian VM]

Debian VMs successfully ping'd each other with Windows forwarding.

Signed-off-by: Dmitry Kozlyuk <dmitry.kozliuk@gmail.com>
Acked-by: Yong Wang <yongwang@vmware.com>
3 years agonet/mlx5: support RSS expansion for IPv6 GRE
Xiaoyu Min [Thu, 18 Mar 2021 11:03:57 +0000 (11:03 +0000)]
net/mlx5: support RSS expansion for IPv6 GRE

Currently RSS expansion only support IPv4 as GRE payload or
delivery protocol (RFC2784). IPv6 as GRE payload or delivery protocol
(RFC7676) is not supported.

This patch add RSS expansion for RFC7676 so PMD can expand flow item
correctly.

Fixes: f4b901a46aec ("net/mlx5: add flow GRE item")
Cc: stable@dpdk.org
Signed-off-by: Xiaoyu Min <jackmin@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
3 years agodoc: update sample actions support in mlx5 guide
Jiawei Wang [Tue, 16 Mar 2021 15:18:19 +0000 (17:18 +0200)]
doc: update sample actions support in mlx5 guide

Updates the documentation for supported sample actions in the NIC Rx
and E-Switch steering flow.

Signed-off-by: Jiawei Wang <jiaweiw@nvidia.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
3 years agonet/mlx5: fix flow actions index in cache
Li Zhang [Tue, 16 Mar 2021 12:05:17 +0000 (14:05 +0200)]
net/mlx5: fix flow actions index in cache

When using port id or push VLAN action index to find
the action in cache, it will fail to find actions.
The root cause is the index is not saved in cache when
creating the port id action or push vlan action.
To fix these issues, update the index in cache when creating.

Fixes: 0fd5f82aaa07 ("net/mlx5: make port ID action cache thread safe")
Fixes: 3422af2af2e4 ("net/mlx5: make push VLAN action cache thread safe")
Cc: stable@dpdk.org
Signed-off-by: Li Zhang <lizh@nvidia.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
3 years agonet/ice/base: fix memory allocation for MAC addresses
Qi Zhang [Wed, 17 Mar 2021 06:02:19 +0000 (14:02 +0800)]
net/ice/base: fix memory allocation for MAC addresses

Not enough memory be allocated for dev->data->mac_address which
cause out of bound memory access when iterate all mac addresses by
dev_info.max_mac_addrs.

Fixes: f9cf4f864150 ("net/ice: support device initialization")
Cc: stable@dpdk.org
Reported-by: Ferruh Yigit <ferruh.yigit@intel.com>
Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Qiming Yang <qiming.yang@intel.com>
3 years agodoc: update firmware/driver mapping table for i40e
Dapeng Yu [Mon, 8 Mar 2021 09:32:13 +0000 (17:32 +0800)]
doc: update firmware/driver mapping table for i40e

Update i40e PMD firmware/driver mapping table.

Signed-off-by: Dapeng Yu <dapengx.yu@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
3 years agonet/iavf: fix RSS hash update
Wenjun Wu [Mon, 15 Mar 2021 00:59:53 +0000 (08:59 +0800)]
net/iavf: fix RSS hash update

This patch change judgment statements to disable RSS for vf
when users need to disable RSS or RSS hash function configured
is not supported.

Fixes: 95f2f0e9fc2a ("net/iavf: improve default RSS")
Cc: stable@dpdk.org
Signed-off-by: Wenjun Wu <wenjun1.wu@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
3 years agonet/ice: fix RSS hash update
Wenjun Wu [Fri, 5 Mar 2021 06:03:24 +0000 (14:03 +0800)]
net/ice: fix RSS hash update

This patch change judgment statements to disable RSS for pf
when users need to disable RSS or RSS hash function configured
is not supported.

Fixes: 4717a12cfaf1 ("net/ice: initialize and update RSS based on user config")
Cc: stable@dpdk.org
Signed-off-by: Wenjun Wu <wenjun1.wu@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
3 years agonet/i40e: fix input set field mask
Alvin Zhang [Mon, 1 Mar 2021 07:06:07 +0000 (15:06 +0800)]
net/i40e: fix input set field mask

The absolute field offsets of IPv4 or IPv6 header are related to
hardware configuration. The X710 and X722 have different hardware
configurations, and users can even modify the hardware configuration.
Therefore, The default values cannot be used when calculating mask
offset.

The following flows can be created on X722 NIC, but the packet will
not enter the queue 3:
  flow create 0 ingress pattern eth / ipv4 proto is 255  / end
  actions queue index 3 / end
  pkt = Ether()/IP(ttl=63, proto=255)/Raw('X'*40)

  flow create 0 ingress pattern eth / ipv4 tos is 50 / udp / end
  actions queue index 3 / end
  pkt = Ether()/IP(tos=50)/UDP()/Raw('X'*40)

  flow create 0 ingress pattern eth / ipv6 tc is 12 / udp / end
  actions queue index 3 / end
  pkt = Ether()/IPv6(tc=12,hlim=34,fl=0x98765)/UDP()/Raw('X'*40)

  flow create 0 ingress pattern eth / ipv6 hop is 34 / end actions
  queue index 3 / end
  pkt = Ether()/IPv6(tc=12,hlim=34,fl=0x98765)/Raw('X'*40)

This patch read the field offsets from the NIC and return the mask
register value.

Fixes: 98f055707685 ("i40e: configure input fields for RSS or flow director")
Fixes: 92cf7f8ec082 ("i40e: allow filtering on more IP header fields")
Cc: stable@dpdk.org
Signed-off-by: Alvin Zhang <alvinx.zhang@intel.com>
Tested-by: Lingli Chen <linglix.chen@intel.com>
3 years agonet/qede: accept bigger RSS table
Igor Russkikh [Fri, 19 Mar 2021 09:46:56 +0000 (10:46 +0100)]
net/qede: accept bigger RSS table

Some dpdk applications blindly pass fixed side RSS hash tables,
and do not check driver/device capabilities.

Moreover, many other drivers do not do such a strong check as well.

Fix it by making qede accept any size rss_key. For larger key
tables we just crop it with notice trace message.

Cc: stable@dpdk.org
Signed-off-by: Igor Russkikh <irusskikh@marvell.com>
Acked-by: Rasesh Mody <rmody@marvell.com>
3 years agonet/qede: reduce log verbosity
Igor Russkikh [Fri, 19 Mar 2021 09:46:55 +0000 (10:46 +0100)]
net/qede: reduce log verbosity

On some hardware units it was found this trace is flooding the output,
making any dpdk interactive usage kind of problematic.

It is only informational, without any consequences handling, so reducing
it to verbose from explicit notice level.

Cc: stable@dpdk.org
Signed-off-by: Igor Russkikh <irusskikh@marvell.com>
Acked-by: Devendra Singh Rawat <dsinghrawat@marvell.com>
Acked-by: Rasesh Mody <rmody@marvell.com>
3 years agonet/octeontx2: support raw flow pattern
Satheesh Paul [Fri, 19 Mar 2021 04:43:56 +0000 (10:13 +0530)]
net/octeontx2: support raw flow pattern

Add support for rte_flow_item_raw to parse custom L2 and L3 protocols.

Signed-off-by: Satheesh Paul <psatheesh@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
3 years agonet/bnxt: fix memory allocation for command response
Kalesh AP [Sat, 20 Mar 2021 06:49:17 +0000 (12:19 +0530)]
net/bnxt: fix memory allocation for command response

Driver re-allocates memory for the command response buffer
when the installed firmware version is newer (and has a larger
max response length) than the version of HWRM that was used to
build the PMD.

This change helps to avoid the re-allocation by allocating the
memory for the command response buffer with PAGE_SIZE.

Coverity issue: 366256, 366204, 366180
Fixes: b7778e8a1c00 ("net/bnxt: refactor to properly allocate resources for PF/VF")
Cc: stable@dpdk.org
Signed-off-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Reviewed-by: Somnath Kotur <somnath.kotur@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Reviewed-by: Lance Richardson <lance.richardson@broadcom.com>
3 years agonet/bnxt: check kvargs parsing
Ajit Khaparde [Wed, 17 Mar 2021 01:08:40 +0000 (18:08 -0700)]
net/bnxt: check kvargs parsing

Check return value of rte_kvargs_process()

Coverity issue: 357765
Fixes: ba404aacc5cf ("net/bnxt: set maximum flow count")
Fixes: 02a95625fe9c ("net/bnxt: add flow stats in extended stats")
Fixes: 7b0940653720 ("net/bnxt: support host memory based TruFlow")
Cc: stable@dpdk.org
Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Reviewed-by: Lance Richardson <lance.richardson@broadcom.com>
3 years agonet/bnxt: fix handling of null flow mask
Lance Richardson [Thu, 18 Mar 2021 19:52:51 +0000 (15:52 -0400)]
net/bnxt: fix handling of null flow mask

When the mask field of an rte_flow pattern item is NULL,
the default mask for that item type should be used.

Fixes: 5ef3b79fdfe6 ("net/bnxt: support flow filter ops")
Cc: stable@dpdk.org
Signed-off-by: Lance Richardson <lance.richardson@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
3 years agonet/bnxt: fix Tx length hint threshold
Lance Richardson [Thu, 18 Mar 2021 19:52:29 +0000 (15:52 -0400)]
net/bnxt: fix Tx length hint threshold

Use correct threshold when selecting "greater than or equal to
2K" length hint.

Fixes: 6eb3cc2294fd ("net/bnxt: add initial Tx code")
Cc: stable@dpdk.org
Signed-off-by: Lance Richardson <lance.richardson@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Reviewed-by: Somnath Kotur <somnath.kotur@broadcom.com>
3 years agonet/bnxt: fix Rx buffer posting
Lance Richardson [Thu, 18 Mar 2021 19:52:13 +0000 (15:52 -0400)]
net/bnxt: fix Rx buffer posting

Remove early buffer posting logic from burst receive loop to address
several issues:
   - Posting receive descriptors without first posting completion
     entries risks overflowing the completion queue.
   - Posting receive descriptors without updating rx_raw_prod
     creates the possibility that the receive descriptor doorbell
     can be written twice with the same value.
   - Having this logic in the inner descriptor processing loop
     can impact performance.

Fixes: 637e34befd9c ("net/bnxt: optimize Rx processing")
Fixes: 04067844a3e9 ("net/bnxt: reduce CQ queue size without aggregation ring")
Cc: stable@dpdk.org
Signed-off-by: Lance Richardson <lance.richardson@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
3 years agonet/bnxt: fix timesync when PTP is not supported
Kalesh AP [Thu, 18 Mar 2021 09:35:23 +0000 (15:05 +0530)]
net/bnxt: fix timesync when PTP is not supported

Fixed to return error when PTP support is not supported on the port.
Also, removed an unnecessary check inside bnxt_get_rx_ts().

Fixes: b11cceb83a34 ("net/bnxt: support timesync")
Cc: stable@dpdk.org
Signed-off-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Reviewed-by: Somnath Kotur <somnath.kotur@broadcom.com>
3 years agonet/bnxt: fix link state operations
Kalesh AP [Thu, 18 Mar 2021 09:35:22 +0000 (15:05 +0530)]
net/bnxt: fix link state operations

VFs does not have the privilege to change link configuration.
But the driver silently returns success to these ethdev callbacks
without actually issuing the HWRM command to bring the link up/down.

Fixes: 5c206086feaa ("net/bnxt: add link state operations")
Cc: stable@dpdk.org
Signed-off-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Reviewed-by: Somnath Kotur <somnath.kotur@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
3 years agonet/bnxt: fix RSS context cleanup
Ajit Khaparde [Tue, 16 Mar 2021 05:42:40 +0000 (22:42 -0700)]
net/bnxt: fix RSS context cleanup

The PMD is allocating an extra RSS context with each port start.
But it is freeing only one RSS context during port stop. So at some point
we run out of RSS contexts when we do multiple port stop/start sequences.
bnxt_hwrm_vnic_ctx_alloc() is called by bnxt_setup_one_vnic(), but
bnxt_hwrm_vnic_ctx_free() is not called in the corresponding
bnxt_free_one_vnic().

Fix this by calling bnxt_hwrm_vnic_ctx_free() in bnxt_free_one_vnic().

Fixes: 7fe5668d2ea3 ("net/bnxt: support VLAN filter and strip")
Cc: stable@dpdk.org
Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
3 years agonet/bnxt: fix PCI write check
Kalesh AP [Tue, 16 Mar 2021 05:41:25 +0000 (11:11 +0530)]
net/bnxt: fix PCI write check

CID 363716 (#1 of 1): Unchecked return value (CHECKED_RETURN)
check_return: Calling rte_pci_write_config without checking
return value (as is done elsewhere 46 out of 49 times).

Coverity issue: 363716
Fixes: be14720def9c ("net/bnxt: support FW reset")
Cc: stable@dpdk.org
Signed-off-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Reviewed-by: Somnath Kotur <somnath.kotur@broadcom.com>
3 years agonet/bnxt: fix Tx timestamp init
Somnath Kotur [Tue, 16 Mar 2021 05:40:48 +0000 (11:10 +0530)]
net/bnxt: fix Tx timestamp init

Fix to read the sequence ID register to get Tx timestamp.
Reading the sequence ID register is necessary for the HW FIFO to
advance and thereby get the correct value of the timestamp on Tx side.
This patch fixes that.

Fixes: b11cceb83a34 ("net/bnxt: support timesync")
Cc: stable@dpdk.org
Reviewed-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Reviewed-by: Lance Richardson <lance.richardson@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Signed-off-by: Somnath Kotur <somnath.kotur@broadcom.com>
3 years agonet/sfc: allow PPPoE flow pattern items
Viacheslav Galaktionov [Tue, 16 Mar 2021 12:51:44 +0000 (15:51 +0300)]
net/sfc: allow PPPoE flow pattern items

These items allow the user to avoid having to set the EtherType field in an
ETH item to match PPPoE traffic. Using a PPPoED (PPPoE discovery) or PPPoES
(PPPoE session) item will lead to EtherType filter being set up with
a corresponding value. If an ETH item provides its own EtherType value,
it will be checked for correctness.

Matching on PPPoE fields is not supported.

Signed-off-by: Viacheslav Galaktionov <viacheslav.galaktionov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
Reviewed-by: Andy Moreton <amoreton@xilinx.com>
3 years agoapp/testpmd: fix NVGRE encap configuration
Jiawei Wang [Tue, 16 Mar 2021 04:18:27 +0000 (06:18 +0200)]
app/testpmd: fix NVGRE encap configuration

For NVGRE protocol, the default value of 'c_k_s_rsvd0_ver'
must be 0x2000, and protocol type must be 0x6558 in the NVGRE
header.

This patch updates these two configurations while parsing the nvgre
encap.

Fixes: dcd962fc6b4e ("app/testpmd: add NVGRE encap/decap")
Cc: stable@dpdk.org
Signed-off-by: Jiawei Wang <jiaweiw@nvidia.com>
Acked-by: Ori Kam <orika@nvidia.com>
3 years agonet/hns3: support Rx descriptor status query
Hongbo Zheng [Tue, 23 Mar 2021 11:21:07 +0000 (19:21 +0800)]
net/hns3: support Rx descriptor status query

Add support for query Rx descriptor status in hns3 driver. Check the
descriptor specified and provide the status information of the
corresponding descriptor.

Signed-off-by: Hongbo Zheng <zhenghongbo3@huawei.com>
Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
3 years agonet/hns3: support Tx descriptor status query
Hongbo Zheng [Tue, 23 Mar 2021 11:21:06 +0000 (19:21 +0800)]
net/hns3: support Tx descriptor status query

Add support for query Tx descriptor status in hns3 driver. Check the
descriptor specified and provide the status information of the
corresponding descriptor.

Signed-off-by: Hongbo Zheng <zhenghongbo3@huawei.com>
Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
3 years agonet/hns3: support oerrors stats in PF
Min Hu (Connor) [Tue, 23 Mar 2021 11:21:05 +0000 (19:21 +0800)]
net/hns3: support oerrors stats in PF

This patch added oerrors stats for PF in kunpeng930.

Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
3 years agonet/hns3: support imissed stats for PF/VF
Min Hu (Connor) [Tue, 23 Mar 2021 11:21:04 +0000 (19:21 +0800)]
net/hns3: support imissed stats for PF/VF

This patch added function level imissed stats for PF and VF. In
Kunpeng920, imissed is supported, only including RPU drop stats in PF.
In kunpeng930, imissed is supported,including RPU drop stats and SSU
drop stats in PF.

Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
3 years agonet/hns3: delete redundant xstats RAS statistics
Hongbo Zheng [Tue, 23 Mar 2021 11:21:03 +0000 (19:21 +0800)]
net/hns3: delete redundant xstats RAS statistics

The current RAS code stores the reported RAS statistics in xstats.
This part of statistics is of little use in practice, and because
of the change of RAS scheme on Kunpeng930, the driver can not
obtain the RAS information any more, so this patch delete these
redundant RAS statistics.

Signed-off-by: Hongbo Zheng <zhenghongbo3@huawei.com>
Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
3 years agonet/hns3: adjust format of RAS related structures
Hongbo Zheng [Tue, 23 Mar 2021 11:21:02 +0000 (19:21 +0800)]
net/hns3: adjust format of RAS related structures

Adjust the format of hns3 RAS related structures to resolve
the static check warnings.

Signed-off-by: Hongbo Zheng <zhenghongbo3@huawei.com>
Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
3 years agonet/hns3: support outer UDP checksum
Chengchang Tang [Tue, 23 Mar 2021 11:21:01 +0000 (19:21 +0800)]
net/hns3: support outer UDP checksum

Kunpeng930 support outer UDP cksum, this patch add support for it.

Signed-off-by: Chengchang Tang <tangchengchang@huawei.com>
Signed-off-by: Min Hu (Connor) <humin29@huawei.com>