dpdk.git
4 years agoapp/testpmd: fix CPU cycles per packet stats on Tx modes
Phil Yang [Mon, 22 Jun 2020 09:04:42 +0000 (17:04 +0800)]
app/testpmd: fix CPU cycles per packet stats on Tx modes

In txonly and flowgen forwarding mode, calculating CPU per packets with
total received packets is not accurate. Use total transmitted packets
for these cases.

The error output under txonly mode:
testpmd> show fwd stats all

---------------------- Forward statistics for port 0  -------------------
RX-packets: 0              RX-dropped: 0             RX-total: 0
TX-packets: 3582891927     TX-dropped: 401965824     TX-total: 3984857751
TX-bursts : 86381636 [0% of 0 pkts + 85% of 64 pkts + 15% of 32 pkts]
-------------------------------------------------------------------------

---------------------- Forward statistics for port 1  -------------------
RX-packets: 1              RX-dropped: 394351696     RX-total: 394351697
TX-packets: 3582890632     TX-dropped: 401965568     TX-total: 3984856200
TX-bursts : 86381679 [0% of 0 pkts + 85% of 64 pkts + 15% of 32 pkts]
-------------------------------------------------------------------------

+++++++++++++++ Accumulated forward statistics for all ports+++++++++++++
RX-packets: 1              RX-dropped: 394351696     RX-total: 394351697
TX-packets: 7165782559     TX-dropped: 803931392     TX-total: 7969713951
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

CPU cycles/packet=54984156291.00 \
(total cycles=54984156291 / total RX packets=1) at 200 MHz Clock

Fixes: 53324971a14e ("app/testpmd: display/clear forwarding stats on demand")
Cc: stable@dpdk.org
Signed-off-by: Phil Yang <phil.yang@arm.com>
Reviewed-by: Ruifeng Wang <ruifeng.wang@arm.com>
Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
Tested-by: Ferruh Yigit <ferruh.yigit@intel.com>
4 years agoapp/testpmd: remove softnic forward mode
Jasvinder Singh [Tue, 23 Jun 2020 09:32:59 +0000 (10:32 +0100)]
app/testpmd: remove softnic forward mode

Softnic can be used like other virtual devices without
needing any special mode. Therefore, remove softnic mode
from testpmd app. Documentation is updated as well.

Signed-off-by: Jasvinder Singh <jasvinder.singh@intel.com>
Acked-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
4 years agodoc: announce marking ethdev internal symbol
Ferruh Yigit [Tue, 23 Jun 2020 13:49:51 +0000 (14:49 +0100)]
doc: announce marking ethdev internal symbol

The APIs are marked in the doxygen comment but better to mark the
symbols too. This is planned for v20.11 release.

Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Andrew Rybchenko <arybchenko@solarflare.com>
Acked-by: Ray Kinsella <mdr@ashroe.eu>
Acked-by: Thomas Monjalon <thomas@monjalon.net>
4 years agonet/enic: support burst mode info
Hyong Youb Kim [Thu, 2 Jul 2020 03:14:51 +0000 (20:14 -0700)]
net/enic: support burst mode info

Add Rx/Tx burst mode getter handlers.

Signed-off-by: Hyong Youb Kim <hyonkim@cisco.com>
Reviewed-by: John Daley <johndale@cisco.com>
4 years agonet/ice: support RSS for IPv6 prefix
Junfeng Guo [Thu, 9 Jul 2020 02:06:43 +0000 (10:06 +0800)]
net/ice: support RSS for IPv6 prefix

RSS for IPv6 prefix fields are supported in this patch, so that we
can use prefixes instead of full IPv6 address for RSS. These prefixes
include the first 32, 48, 64 bits of both SRC and DST IPv6 address.

Signed-off-by: Junfeng Guo <junfeng.guo@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
4 years agoapp/testpmd: support extended RSS offload types
Junfeng Guo [Thu, 9 Jul 2020 02:06:42 +0000 (10:06 +0800)]
app/testpmd: support extended RSS offload types

This patch adds testpmd cmdline support for IPv6 prefix.

Signed-off-by: Junfeng Guo <junfeng.guo@intel.com>
Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
4 years agoethdev: add RSS types for IPv6 prefix
Junfeng Guo [Thu, 9 Jul 2020 02:06:41 +0000 (10:06 +0800)]
ethdev: add RSS types for IPv6 prefix

This patch defines new RSS offload types for IPv6 prefix with 32, 40,
48, 56, 64, 96 bits of both SRC and DST IPv6 address.
Ref https://tools.ietf.org/html/rfc6052.

Signed-off-by: Junfeng Guo <junfeng.guo@intel.com>
Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
4 years agonet/hinic/base: convert error value to ETIMEDOUT
Xiaoyun Wang [Thu, 9 Jul 2020 13:43:02 +0000 (21:43 +0800)]
net/hinic/base: convert error value to ETIMEDOUT

Following commit updated the error codes:
commit 2ae8e130cf21 ("net/hinic/base: modify returned error values")

In that commit 'ETIME' errors are not used because it is not supported
by FreeBSD, instead in this patch converting relevant error codes to
'ETIMEDOUT'.

Signed-off-by: Xiaoyun Wang <cloud.wangxiaoyun@huawei.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
4 years agoethdev: fix VLAN offloads set if no relative capabilities
Wei Hu (Xavier) [Thu, 9 Jul 2020 10:43:14 +0000 (18:43 +0800)]
ethdev: fix VLAN offloads set if no relative capabilities

Currently, there is a potential problem that calling the API function
rte_eth_dev_set_vlan_offload to start VLAN hardware offloads which the
driver does not support. If the PMD driver does not support certain VLAN
hardware offloads and does not check for it, the hardware setting will
not change, but the VLAN offloads in dev->data->dev_conf.rxmode.offloads
will be turned on.

It is supposed to check the hardware capabilities to decide whether the
relative callback needs to be called just like the behavior in the API
function named rte_eth_dev_configure. And it is also needed to cleanup
duplicated checks which are done in some PMDs. Also, note that it is
behaviour change for some PMDs which simply ignore (with error/warning
log message) unsupported VLAN offloads, but now it will fail.

Fixes: a4996bd89c42 ("ethdev: new Rx/Tx offloads API")
Fixes: 0ebce6129bc6 ("net/dpaa2: support new ethdev offload APIs")
Fixes: f9416bbafd98 ("net/enic: remove VLAN filter handler")
Fixes: 4f7d9e383e5c ("fm10k: update vlan offload features")
Fixes: fdba3bf15c7b ("net/hinic: add VLAN filter and offload")
Fixes: b96fb2f0d22b ("net/i40e: handle QinQ strip")
Fixes: d4a27a3b092a ("nfp: add basic features")
Fixes: 56139e85abec ("net/octeontx: support VLAN filter offload")
Fixes: ba1b3b081edf ("net/octeontx2: support VLAN offloads")
Fixes: d87246a43759 ("net/qede: enable and disable VLAN filtering")
Cc: stable@dpdk.org
Signed-off-by: Chengchang Tang <tangchengchang@huawei.com>
Signed-off-by: Wei Hu (Xavier) <xavier.huwei@huawei.com>
Acked-by: Andrew Rybchenko <arybchenko@solarflare.com>
Acked-by: Hyong Youb Kim <hyonkim@cisco.com>
Acked-by: Sachin Saxena <sachin.saxena@nxp.com>
Acked-by: Xiaoyun Wang <cloud.wangxiaoyun@huawei.com>
Acked-by: Harman Kalra <hkalra@marvell.com>
Acked-by: Jeff Guo <jia.guo@intel.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
4 years agoethdev: fix data room size verification in Rx queue setup
Wei Hu (Xavier) [Thu, 9 Jul 2020 10:43:13 +0000 (18:43 +0800)]
ethdev: fix data room size verification in Rx queue setup

In the rte_eth_rx_queue_setup API function, the local variable named
mbp_buf_size, which is the data room size of the input parameter mp,
is checked to guarantee that each memory chunk used for net device
in the mbuf is bigger than the min_rx_bufsize. But if mbp_buf_size is
less than RTE_PKTMBUF_HEADROOM, the value of the following  statement
will be a large number since the mbp_buf_size is a unsigned value.
    mbp_buf_size - RTE_PKTMBUF_HEADROOM
As a result, it will cause a segment fault in this situation.

This patch fixes it by modify the check condition to guarantee that the
local variable named mbp_buf_size is bigger than RTE_PKTMBUF_HEADROOM.

Fixes: af75078fece3 ("first public release")
Cc: stable@dpdk.org
Signed-off-by: Chengchang Tang <tangchengchang@huawei.com>
Signed-off-by: Wei Hu (Xavier) <xavier.huwei@huawei.com>
Reviewed-by: Andrew Rybchenko <arybchenko@solarflare.com>
Acked-by: Sachin Saxena <sachin.saxena@nxp.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
4 years agonet/dpaa2: avoid multiple IOVA conversions
Roman Kapl [Mon, 29 Jun 2020 11:17:58 +0000 (13:17 +0200)]
net/dpaa2: avoid multiple IOVA conversions

Avoids recalculation of DPAA2_IOVA_TO_VADDR, since this is somewhat
costly function on no-IOMMU setups.

Brings about 0.5 Gbps improvement at 19 Gbps speeds on LX2160 with 512b
packets.

Signed-off-by: Roman Kapl <rka@sysgo.com>
Reviewed-by: Hemant Agrawal <hemant.agrawal@nxp.com>
4 years agonet/enic: add more flow manager actions to dump
Hyong Youb Kim [Fri, 3 Jul 2020 02:23:51 +0000 (19:23 -0700)]
net/enic: add more flow manager actions to dump

The following commit introduced several new actions. Make the dump
function to print those actions.

commit 6faf81f1d2c3 ("net/enic: update flow manager API")

Signed-off-by: Hyong Youb Kim <hyonkim@cisco.com>
Reviewed-by: John Daley <johndale@cisco.com>
4 years agonet/enic: support VLAN push and pop flow actions
Hyong Youb Kim [Fri, 3 Jul 2020 02:23:50 +0000 (19:23 -0700)]
net/enic: support VLAN push and pop flow actions

Flow manager API includes push/pop actions, so support corresponding
DPDK flow actions.

Signed-off-by: Hyong Youb Kim <hyonkim@cisco.com>
Reviewed-by: John Daley <johndale@cisco.com>
4 years agocommon/mlx5: fix physical port name pattern recognition
Viacheslav Ovsiienko [Wed, 8 Jul 2020 20:52:16 +0000 (20:52 +0000)]
common/mlx5: fix physical port name pattern recognition

This patch makes the Infiniband device physical port name
recognition more strict. Currently mlx5 PMD might recognize
the names like "pf0sf0" erroneously as "pf0" and the wrong
device type (host PF representor) is reported.

The names like "pf0sf0" belong to PCI subfunctions which
is currently not supported by mlx5 PMD and this false
recognition must be eliminated.

Fixes: 420bbdae89f2 ("net/mlx5: fix host physical function representor naming")
Cc: stable@dpdk.org
Signed-off-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
4 years agonet/mlx5: add ConnectX-6 Lx device ID
Ali Alnubani [Wed, 8 Jul 2020 09:14:04 +0000 (12:14 +0300)]
net/mlx5: add ConnectX-6 Lx device ID

This adds the ConnectX-6 Lx device id to the list of supported
Mellanox devices that run the MLX5 PMD.
The device is still in development stage.

Signed-off-by: Ali Alnubani <alialnu@mellanox.com>
Acked-by: Raslan Darawsheh <rasland@mellanox.com>
4 years agodoc: fix a typo in mlx5 guide
Ali Alnubani [Wed, 8 Jul 2020 09:13:20 +0000 (12:13 +0300)]
doc: fix a typo in mlx5 guide

Fixes: ecb160456aed ("net/mlx5: add device parameter for MPRQ stride size")
Cc: stable@dpdk.org
Signed-off-by: Ali Alnubani <alialnu@mellanox.com>
Acked-by: Raslan Darawsheh <rasland@mellanox.com>
4 years agonet/iavf: support RSS for IPv4 IPv6 mix of GTP
Junfeng Guo [Wed, 8 Jul 2020 03:27:39 +0000 (11:27 +0800)]
net/iavf: support RSS for IPv4 IPv6 mix of GTP

RSS for GTP with outer & inner ipv4 & ipv6 combination are supported
in this patch, so that we can process RSS based on inner 5 tuples or
3 tuples of all the cases below of GTP packets:
        1. ipv4 (outer) + ipv4 (inner)
        2. ipv4 (outer) + ipv6 (inner)
        3. ipv6 (outer) + ipv4 (inner)
        4. ipv6 (outer) + ipv6 (inner)

Signed-off-by: Junfeng Guo <junfeng.guo@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
4 years agonet/ice: support RSS for IPv4 IPv6 mix of GTP
Junfeng Guo [Wed, 8 Jul 2020 03:27:38 +0000 (11:27 +0800)]
net/ice: support RSS for IPv4 IPv6 mix of GTP

RSS for GTP with outer & inner ipv4 & ipv6 combination are supported
in this patch, so that we can process RSS based on inner 5 tuples or
3 tuples of all the cases below of GTP packets:
        1. ipv4 (outer) + ipv4 (inner)
        2. ipv4 (outer) + ipv6 (inner)
        3. ipv6 (outer) + ipv4 (inner)
        4. ipv6 (outer) + ipv6 (inner)

Signed-off-by: Junfeng Guo <junfeng.guo@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
4 years agonet/ice: fix protocol header for PPPoE
Simei Su [Thu, 9 Jul 2020 06:21:28 +0000 (14:21 +0800)]
net/ice: fix protocol header for PPPoE

When adding a RSS rule with pattern MAC_PPPOE_IPV4_UDP and input
set SRC/DST IPV4, because of incomplete protocol header fields,
the rule can't do hash with inner src/dst ipv4. PPPOE_IPV4_TCP/SCTP
and PPPOE_IPV6_UDP/TCP/SCTP also have similar issues. This patch
complements protocol header fields for PPPOE data packets.

Fixes: 0b952714e9c1 ("net/ice: refactor PF hash flow")

Signed-off-by: Simei Su <simei.su@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
4 years agonet/ixgbe/base: update version
Guinan Sun [Thu, 9 Jul 2020 08:00:46 +0000 (08:00 +0000)]
net/ixgbe/base: update version

Update base code version in readme.

Signed-off-by: Guinan Sun <guinanx.sun@intel.com>
Reviewed-by: Wei Zhao <wei.zhao1@intel.com>
4 years agonet/ixgbe/base: check host interface return status
Guinan Sun [Thu, 9 Jul 2020 08:00:44 +0000 (08:00 +0000)]
net/ixgbe/base: check host interface return status

Writing to read-only fields returns a non-OK Return Status
for shadow RAM write command for X550.
This information was previously discarded.

Signed-off-by: Stanislaw Grzeszczak <stanislaw.a.grzeszczak@intel.com>
Signed-off-by: Guinan Sun <guinanx.sun@intel.com>
Reviewed-by: Wei Zhao <wei.zhao1@intel.com>
4 years agonet/ixgbe/base: cleanup pre-processor tags
Guinan Sun [Thu, 9 Jul 2020 08:00:45 +0000 (08:00 +0000)]
net/ixgbe/base: cleanup pre-processor tags

The codes has been exposed correctly, so remove pre-processor tags.

Signed-off-by: Guinan Sun <guinanx.sun@intel.com>
Reviewed-by: Wei Zhao <wei.zhao1@intel.com>
4 years agonet/ixgbe/base: remove default advertising for x550 2.5G/5G
Guinan Sun [Thu, 9 Jul 2020 08:00:43 +0000 (08:00 +0000)]
net/ixgbe/base: remove default advertising for x550 2.5G/5G

We are seeing interoperability issues with switches when 2.5G and 5G
in x550 are advertised by default, so default to off.

Signed-off-by: Todd Fujinaka <todd.fujinaka@intel.com>
Signed-off-by: Guinan Sun <guinanx.sun@intel.com>
Reviewed-by: Wei Zhao <wei.zhao1@intel.com>
4 years agonet/ixgbe/base: add IPv6 mask for flow director
Guinan Sun [Thu, 9 Jul 2020 08:00:42 +0000 (08:00 +0000)]
net/ixgbe/base: add IPv6 mask for flow director

Write FDIRIP6M register to allow flow director filter
to set ipv6 rules without setting ipv6 source/destination address.

Signed-off-by: Piotr Skajewski <piotrx.skajewski@intel.com>
Signed-off-by: Guinan Sun <guinanx.sun@intel.com>
Reviewed-by: Wei Zhao <wei.zhao1@intel.com>
4 years agonet/ixgbe/base: improve log about autoneg being disabled
Guinan Sun [Thu, 9 Jul 2020 08:00:41 +0000 (08:00 +0000)]
net/ixgbe/base: improve log about autoneg being disabled

On ESXi OS, when user disables auto negotiation, the following log
appears: "(unsupported) Flow control autoneg is disabled".
It is true that auto negotiation is disabled but it is
not necessarily true that it is not supported.

Signed-off-by: Jakub Chylkowski <jakubx.chylkowski@intel.com>
Signed-off-by: Guinan Sun <guinanx.sun@intel.com>
Reviewed-by: Wei Zhao <wei.zhao1@intel.com>
4 years agonet/ixgbe/base: initialize data field in struct buffer
Guinan Sun [Thu, 9 Jul 2020 08:00:40 +0000 (08:00 +0000)]
net/ixgbe/base: initialize data field in struct buffer

While sending request using ixgbe_hic_unlocked() the data field in
buffer struct is not used. It is set when the struct is overwritten by
FW to deliver the response. To not pass random data to FW the whole
structure should be zeroed before use.

Signed-off-by: Krzysztof Galazka <krzysztof.galazka@intel.com>
Signed-off-by: Piotr Pietruszewski <piotr.pietruszewski@intel.com>
Signed-off-by: Guinan Sun <guinanx.sun@intel.com>
Reviewed-by: Wei Zhao <wei.zhao1@intel.com>
4 years agonet/ixgbe/base: remove log message FC autoneg
Guinan Sun [Thu, 9 Jul 2020 08:00:39 +0000 (08:00 +0000)]
net/ixgbe/base: remove log message FC autoneg

The function ixgbe_device_supports_autoneg_fc is checking whether
a particular device and medium configuration is supporting
Flow Control Autonegotiation. In case of non-support, the message
is always logged which is confusing.
The fix is removing unnecessary log entry.

Signed-off-by: Zalfresso-Jundzillo <marekx.zalfresso-jundzillo@intel.com>
Signed-off-by: Guinan Sun <guinanx.sun@intel.com>
Reviewed-by: Wei Zhao <wei.zhao1@intel.com>
4 years agonet/ixgbe/base: remove unnecessary return value check
Guinan Sun [Thu, 9 Jul 2020 08:00:38 +0000 (08:00 +0000)]
net/ixgbe/base: remove unnecessary return value check

Remove unnecessary return value check.

Signed-off-by: Jakub Chylkowski <jakubx.chylkowski@intel.com>
Signed-off-by: Guinan Sun <guinanx.sun@intel.com>
Reviewed-by: Wei Zhao <wei.zhao1@intel.com>
4 years agonet/ixgbe/base: add typecast for type mismatch
Guinan Sun [Thu, 9 Jul 2020 08:00:37 +0000 (08:00 +0000)]
net/ixgbe/base: add typecast for type mismatch

Add typecast for type mismatch.

Signed-off-by: Jakub Chylkowski <jakubx.chylkowski@intel.com>
Signed-off-by: Guinan Sun <guinanx.sun@intel.com>
Reviewed-by: Wei Zhao <wei.zhao1@intel.com>
4 years agonet/ixgbe/base: create function to restart autoneg
Guinan Sun [Thu, 9 Jul 2020 08:00:36 +0000 (08:00 +0000)]
net/ixgbe/base: create function to restart autoneg

This patch is for restarting auto negotiation on PHY.

Signed-off-by: Jakub Chylkowski <jakubx.chylkowski@intel.com>
Signed-off-by: Guinan Sun <guinanx.sun@intel.com>
Reviewed-by: Wei Zhao <wei.zhao1@intel.com>
4 years agonet/ixgbe/base: move increments after evaluations
Guinan Sun [Thu, 9 Jul 2020 08:00:35 +0000 (08:00 +0000)]
net/ixgbe/base: move increments after evaluations

The retry variable was being incremented before it was evaluated by the
subsequent conditional against the maximum retries to figure out which
message to print.  So we'll move the increment op to the end.

Signed-off-by: Jeb Cramer <jeb.j.cramer@intel.com>
Signed-off-by: Guinan Sun <guinanx.sun@intel.com>
Reviewed-by: Wei Zhao <wei.zhao1@intel.com>
4 years agonet/ixgbe/base: remove whitespace in function comments
Guinan Sun [Thu, 9 Jul 2020 08:00:34 +0000 (08:00 +0000)]
net/ixgbe/base: remove whitespace in function comments

Remove unnecessary extra whitespace on all function comments, replacing
' *  ' with ' * '.

This was done automatically via sed using the following transformation:

  sed 's/^ \*  / * /'

Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
Signed-off-by: Guinan Sun <guinanx.sun@intel.com>
Reviewed-by: Wei Zhao <wei.zhao1@intel.com>
4 years agonet/ixgbe/base: cleanup spelling mistakes in comments
Guinan Sun [Thu, 9 Jul 2020 08:00:33 +0000 (08:00 +0000)]
net/ixgbe/base: cleanup spelling mistakes in comments

Several functions in the driver code have a weird function comment
formatting which uses two spaces instead of only one space for the main
function body.

This formatting will be mechanically fixed by sed in a future patch, but
doing so leads to some spelling warnings on that patch. Cleanup the
spelling mistakes that will be detected first. This way, it is easier to
verify the mechanical transformation done by sed in the following patch.

Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
Signed-off-by: Guinan Sun <guinanx.sun@intel.com>
Reviewed-by: Wei Zhao <wei.zhao1@intel.com>
4 years agonet/ixgbe/base: add register definitions for NVM update
Guinan Sun [Thu, 9 Jul 2020 08:00:32 +0000 (08:00 +0000)]
net/ixgbe/base: add register definitions for NVM update

Added additional register for X550 and above device family.

Signed-off-by: Piotr Skajewski <piotrx.skajewski@intel.com>
Signed-off-by: Guinan Sun <guinanx.sun@intel.com>
Reviewed-by: Wei Zhao <wei.zhao1@intel.com>
4 years agonet/ixgbe/base: fix infinite recursion on PCIe link down
Guinan Sun [Thu, 9 Jul 2020 08:00:31 +0000 (08:00 +0000)]
net/ixgbe/base: fix infinite recursion on PCIe link down

In some corner cases the functions ixgbe_clear_rar_generic and
ixgbe_clear_vmdq_generic may call one another leading to infinite
recursion.

When ixgbe_clear_vmdq_generic is called with IXGBE_CLEAR_VMDQ_ALL
flag, it's going to clear MPSAR registers, and proceed to call
ixgbe_clear_rar_generic, which in turn will clear the RAR registers,
and recursively call back ixgbe_clear_vmdq_generic. Normally, the
latter would detect that MPSAR registers have already been cleared
and terminate the recursion.

However, when PCIe link is down, and before the driver has had the
opportunity to shut itself down, all register reads return 0xFFFFFFFF,
and all register writes fail silently. In such case, because
ixgbe_clear_vmdq_generic blindly assumes that clearing MPSAR registers
succeeded, it's going to always call ixgbe_clear_rar_generic, which
in turn will always call back ixgbe_clear_vmdq_generic, creating
infinite recursion.

This patch re-reads MPSAR register values after they had been cleared.
In case of PCIe link failure, the values read will be non-zero, which
will terminate the recursion. On the other hand, under normal
circumstances the value read from MPSAR registers is going to be equal
to the value previously written, so this patch is expected not to cause
any regressions.

Fixes: af75078fece3 ("first public release")
Cc: stable@dpdk.org
Signed-off-by: Robert Konklewski <robertx.konklewski@intel.com>
Signed-off-by: Guinan Sun <guinanx.sun@intel.com>
Reviewed-by: Wei Zhao <wei.zhao1@intel.com>
4 years agonet/ixgbe/base: fix x550em 10G NIC link status
Guinan Sun [Thu, 9 Jul 2020 08:00:30 +0000 (08:00 +0000)]
net/ixgbe/base: fix x550em 10G NIC link status

With the NVM image for x550em XFI will not report
the auto-negotiation feature correctly. The auto-negotiation
should be "No" for supports and advertised items.
At the same time update speed makes it support 1G and 10G.

Fixes: 833df43399e7 ("net/ixgbe/base: add SGMII link for X550")
Cc: stable@dpdk.org
Signed-off-by: Piotr Skajewski <piotrx.skajewski@intel.com>
Signed-off-by: Guinan Sun <guinanx.sun@intel.com>
Reviewed-by: Wei Zhao <wei.zhao1@intel.com>
4 years agonet/ixgbe/base: fix response to apply-update command
Guinan Sun [Thu, 9 Jul 2020 08:00:29 +0000 (08:00 +0000)]
net/ixgbe/base: fix response to apply-update command

For the "Apply Update" command the firmware does not
given an response. For this command, success should
be return.

Signed-off-by: Mateusz Kowalski <mateusz.kowalski@intel.com>
Signed-off-by: Guinan Sun <guinanx.sun@intel.com>
Reviewed-by: Wei Zhao <wei.zhao1@intel.com>
4 years agonet/ixgbe/base: fix host interface shadow RAM read
Guinan Sun [Thu, 9 Jul 2020 08:00:28 +0000 (08:00 +0000)]
net/ixgbe/base: fix host interface shadow RAM read

Host interface Shadow RAM Read (0x31) command response
buffer length should be stored in two bytes, instead of one byte.
This patch fixes it.

Fixes: e6102361b1d4 ("net/ixgbe/base: use 2 bytes for flash read command")
Cc: stable@dpdk.org
Signed-off-by: Mateusz Kowalski <mateusz.kowalski@intel.com>
Signed-off-by: Guinan Sun <guinanx.sun@intel.com>
Reviewed-by: Wei Zhao <wei.zhao1@intel.com>
4 years agonet/qede: support registers dump
Rasesh Mody [Wed, 8 Jul 2020 22:50:54 +0000 (15:50 -0700)]
net/qede: support registers dump

Add support for .get_reg eth_dev ops which will be used to collect the
firmware debug data.

PMD on detecting on some HW errors will collect the FW/HW Dump to a
buffer and then it will save it to a file implemented in
qede_save_fw_dump().

Dump file location and name:
Location: <RTE_SDK> or DPDK root
Name: qede_pmd_dump_mm-dd-yy_hh-mm-ss.bin

DPDK applications can initiate a debug data collection by invoking DPDK
library’s rte_eth_dev_get_reg_info() API. This API invokes .get_reg()
interface in the PMD.

PMD implementation of .get_reg() collects the FW/HW Dump, saves it to
data field of rte_dev_reg_info and passes it to the application. It’s
the responsibility of the application to save the FW/HW Dump to a file.
We recommendation using the file name format used by qede_save_fw_dump().

Signed-off-by: Rasesh Mody <rmody@marvell.com>
Signed-off-by: Igor Russkikh <irusskikh@marvell.com>
4 years agonet/qede: add infrastructure for debug data collection
Rasesh Mody [Wed, 8 Jul 2020 22:50:53 +0000 (15:50 -0700)]
net/qede: add infrastructure for debug data collection

The patch adds QEDE PMD ops and APIs to calculate the size and collect
the debug dump for various firmware components. The patch adds new files
qede_debug.[ch] that has all the firmware debug data collection
infrastructure changes.

Signed-off-by: Rasesh Mody <rmody@marvell.com>
Signed-off-by: Igor Russkikh <irusskikh@marvell.com>
4 years agonet/qede/base: add changes for debug data collection
Rasesh Mody [Wed, 8 Jul 2020 22:50:52 +0000 (15:50 -0700)]
net/qede/base: add changes for debug data collection

This patch adds base driver APIs required for debug data collection.
It adds support for dumping internal lookup tables(ilt), reading nvram
image, register definitions.

Signed-off-by: Rasesh Mody <rmody@marvell.com>
Signed-off-by: Igor Russkikh <irusskikh@marvell.com>
4 years agonet/qede/base: re-arrange few structures for DDC
Rasesh Mody [Wed, 8 Jul 2020 22:50:51 +0000 (15:50 -0700)]
net/qede/base: re-arrange few structures for DDC

This patch rearranges some of the base driver structures which will be
also used by debug data collection (DDC) implementation. It adds a new
file ecore_hsi_func_common.h with Physical, Virtual memory descriptors.

Signed-off-by: Rasesh Mody <rmody@marvell.com>
Signed-off-by: Igor Russkikh <irusskikh@marvell.com>
4 years agonet/netvsc: detach external buffer on failure
Long Li [Wed, 24 Jun 2020 01:11:46 +0000 (18:11 -0700)]
net/netvsc: detach external buffer on failure

When external buffer is used, driver should detach it if it doesn't make
it successfully to the queue.

Signed-off-by: Long Li <longli@microsoft.com>
Acked-by: Stephen Hemminger <stephen@networkplumber.org>
4 years agonet/netvsc: fix underflow when Rx external mbuf
Long Li [Wed, 24 Jun 2020 01:11:45 +0000 (18:11 -0700)]
net/netvsc: fix underflow when Rx external mbuf

When rte_pktmbuf_attach_extbuf() is used, the driver should not decrease
the reference count in its callback function hn_rx_buf_free_cb, because
the reference count is already decreased by rte_pktmbuf. Doing it twice
may result in underflow and driver may never send an ack packet over
vmbus to host.

Also declares rxbuf_outstanding as atomic, because this value is shared
among all receive queues.

Fixes: 4e9c73e96e83 ("net/netvsc: add Hyper-V network device")
Cc: stable@dpdk.org
Signed-off-by: Long Li <longli@microsoft.com>
Acked-by: Stephen Hemminger <stephen@networkplumber.org>
4 years agonet/bonding: fix socket ID check
David Marchand [Tue, 16 Jun 2020 09:46:37 +0000 (11:46 +0200)]
net/bonding: fix socket ID check

Caught by code review, rte_eth_dev_socket_id() returns -1 on error.
The code should behave the same, but still, do not use LCORE_ID_ANY for
something that is not a lcore id.

Fixes: c15c5897340d ("net/bonding: avoid allocating mempool on unknown socket")
Cc: stable@dpdk.org
Signed-off-by: David Marchand <david.marchand@redhat.com>
Acked-by: Chas Williams <chas3@att.com>
4 years agonet/bnxt: avoid hard coded values when reading counters
Somnath Kotur [Mon, 6 Jul 2020 08:25:02 +0000 (13:55 +0530)]
net/bnxt: avoid hard coded values when reading counters

Instead of using hardcoded values for the byte/pkt value shifts/masks
to read from the HW counters, use the shift/mask values from the device
template params

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 filter ctrl ops for port representor
Somnath Kotur [Mon, 6 Jul 2020 08:25:01 +0000 (13:55 +0530)]
net/bnxt: enable filter ctrl ops for port representor

Inorder to offload flows on the vfrep device, it must be
populated with rte_flow_ops.

This patch enables the same.

Signed-off-by: Somnath Kotur <somnath.kotur@broadcom.com>
Signed-off-by: Venkat Duvvuru <venkatkumar.duvvuru@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
4 years agonet/bnxt: use VF VNIC if port action is for VF rep
Kishore Padmanabha [Mon, 6 Jul 2020 08:25:00 +0000 (13:55 +0530)]
net/bnxt: use VF VNIC if port action is for VF rep

Fix to use the vf's vnic port for ingress flows whose
port action is a vf rep port.

Signed-off-by: Kishore Padmanabha <kishore.padmanabha@broadcom.com>
Signed-off-by: Somnath Kotur <somnath.kotur@broadcom.com>
Signed-off-by: Venkat Duvvuru <venkatkumar.duvvuru@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
4 years agonet/bnxt: support src and dst port actions
Kishore Padmanabha [Mon, 6 Jul 2020 08:24:59 +0000 (13:54 +0530)]
net/bnxt: support src and dst port actions

Added support for set transport port source and destination
rewrite action items. This allows changing the tcp or udp
source/destination ports for a given flow.

Signed-off-by: Kishore Padmanabha <kishore.padmanabha@broadcom.com>
Signed-off-by: Somnath Kotur <somnath.kotur@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 agonet/bnxt: support NAT action items
Kishore Padmanabha [Mon, 6 Jul 2020 08:24:58 +0000 (13:54 +0530)]
net/bnxt: support NAT action items

Added support for set ipv4 address action items. It allows the source
or destination ip address to be changed for a given flow.

Signed-off-by: Kishore Padmanabha <kishore.padmanabha@broadcom.com>
Signed-off-by: Somnath Kotur <somnath.kotur@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 agonet/bnxt: add conditional opcodes for mapper result table
Kishore Padmanabha [Mon, 6 Jul 2020 08:24:57 +0000 (13:54 +0530)]
net/bnxt: add conditional opcodes for mapper result table

Added support for conditional mapper result opcodes. The conditional
opcodes allows to set the action details in hardware based on the
actions configured for the flow. This allows aggregation of multiple
templates.

Signed-off-by: Kishore Padmanabha <kishore.padmanabha@broadcom.com>
Signed-off-by: Somnath Kotur <somnath.kotur@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 agonet/bnxt: change port config for full offload
Kishore Padmanabha [Mon, 6 Jul 2020 08:24:56 +0000 (13:54 +0530)]
net/bnxt: change port config for full offload

Added port configuration changes to support full offload
rules when VF representor ports are used. The direction of
the flow is determined using the configured direction and the
configured match and action ports of the flow create.

Signed-off-by: Kishore Padmanabha <kishore.padmanabha@broadcom.com>
Signed-off-by: Somnath Kotur <somnath.kotur@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 agonet/bnxt: enable PF and VF port action items
Kishore Padmanabha [Mon, 6 Jul 2020 08:24:55 +0000 (13:54 +0530)]
net/bnxt: enable PF and VF port action items

Added support for the PF and VF port action items in the flow
create. During flow create the output port action can now be specified
as PF or VF port and those ports are parsed accordingly and converted
to vnic or vport as per the flow direction.

Signed-off-by: Kishore Padmanabha <kishore.padmanabha@broadcom.com>
Signed-off-by: Somnath Kotur <somnath.kotur@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 agonet/bnxt: add VLAN tag count in computed field list
Kishore Padmanabha [Mon, 6 Jul 2020 08:24:54 +0000 (13:54 +0530)]
net/bnxt: add VLAN tag count in computed field list

Added number of vlan tags in the computed field list so conditional
table execution could be done based on number of vlan tags in the
flow create.

Signed-off-by: Kishore Padmanabha <kishore.padmanabha@broadcom.com>
Signed-off-by: Somnath Kotur <somnath.kotur@broadcom.com>
Signed-off-by: Venkat Duvvuru <venkatkumar.duvvuru@broadcom.com>
Reviewed-by: Somnath Kotur <somnath.kotur@broadcom.com>
Reviewed-by: Mike Baucom <michael.baucom@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
4 years agonet/bnxt: move VXLAN outer IP protocol ID in encap
Kishore Padmanabha [Mon, 6 Jul 2020 08:24:53 +0000 (13:54 +0530)]
net/bnxt: move VXLAN outer IP protocol ID in encap

The outer ip protocol was not encapsulated in the right location
when ip header is sent by the application. The order of encapsulation
has to be reversed.

Signed-off-by: Kishore Padmanabha <kishore.padmanabha@broadcom.com>
Signed-off-by: Somnath Kotur <somnath.kotur@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 agonet/bnxt: remove VNIC and vport bits from template match
Kishore Padmanabha [Mon, 6 Jul 2020 08:24:52 +0000 (13:54 +0530)]
net/bnxt: remove VNIC and vport bits from template match

Removed the vnic and vport bitmaps from template matching. It
is assumed that these will be populated implicitly and based
on the direction the appropriate action property shall be used.

Signed-off-by: Kishore Padmanabha <kishore.padmanabha@broadcom.com>
Signed-off-by: Somnath Kotur <somnath.kotur@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 agonet/bnxt: support VLAN push and pop actions
Kishore Padmanabha [Mon, 6 Jul 2020 08:24:51 +0000 (13:54 +0530)]
net/bnxt: support VLAN push and pop actions

Add support for the vlan push and vlan pop actions

Signed-off-by: Kishore Padmanabha <kishore.padmanabha@broadcom.com>
Signed-off-by: Somnath Kotur <somnath.kotur@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 agonet/bnxt: cleanup and refactor session management
Kishore Padmanabha [Mon, 6 Jul 2020 08:24:50 +0000 (13:54 +0530)]
net/bnxt: cleanup and refactor session management

The return value of some functions is explicitly ignored
in cases where scope id may not be valid for internal EM
entries.
Additional minor refactoring and cleanups
- Change log level for some log messages to DEBUG instead of ERR.
- Check data size conformity and log appropriate message.

Signed-off-by: Michael Wildt <michael.wildt@broadcom.com>
Signed-off-by: Kishore Padmanabha <kishore.padmanabha@broadcom.com>
Signed-off-by: Somnath Kotur <somnath.kotur@broadcom.com>
Reviewed-by: Randy Schacher <stuart.schacher@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
4 years agonet/bnxt: add HWRM for global config
Jay Ding [Mon, 6 Jul 2020 08:24:49 +0000 (13:54 +0530)]
net/bnxt: add HWRM for global config

Change global cfg from tunneled to non-tunneled
HWRM cmds.

Signed-off-by: Jay Ding <jay.ding@broadcom.com>
Signed-off-by: Somnath Kotur <somnath.kotur@broadcom.com>
Signed-off-by: Venkat Duvvuru <venkatkumar.duvvuru@broadcom.com>
Reviewed-by: Peter Spreadborough <peter.spreadborough@broadcom.com>
Reviewed-by: Randy Schacher <stuart.schacher@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
4 years agonet/bnxt: update HWRM structures
Jay Ding [Mon, 6 Jul 2020 08:24:48 +0000 (13:54 +0530)]
net/bnxt: update HWRM structures

Brought in the latest hsi_struct_def_dpdk.h in order to get
the TF global cfg set/get HWRM cmds.
HWRM API is now updated to version 1.10.1.48

Signed-off-by: Jay Ding <jay.ding@broadcom.com>
Signed-off-by: Somnath Kotur <somnath.kotur@broadcom.com>
Signed-off-by: Venkat Duvvuru <venkatkumar.duvvuru@broadcom.com>
Reviewed-by: Randy Schacher <stuart.schacher@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
4 years agonet/bnxt: support index opcode constant
Kishore Padmanabha [Mon, 6 Jul 2020 08:24:47 +0000 (13:54 +0530)]
net/bnxt: support index opcode constant

Add support for index opcode constant so that
parif configuration could be constant value.

Signed-off-by: Kishore Padmanabha <kishore.padmanabha@broadcom.com>
Signed-off-by: Somnath Kotur <somnath.kotur@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 agonet/bnxt: validate port ID and PHY port parsing
Kishore Padmanabha [Mon, 6 Jul 2020 08:24:46 +0000 (13:54 +0530)]
net/bnxt: validate port ID and PHY port parsing

Added validations to the ulp parser to validate the dpdk port id
and phy port index during the flow creation.

Signed-off-by: Kishore Padmanabha <kishore.padmanabha@broadcom.com>
Signed-off-by: Somnath Kotur <somnath.kotur@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 agonet/bnxt: support negative conditional opcodes
Kishore Padmanabha [Mon, 6 Jul 2020 08:24:45 +0000 (13:54 +0530)]
net/bnxt: support negative conditional opcodes

Added support for negative conditional opcodes in the
mapper processing.

Signed-off-by: Kishore Padmanabha <kishore.padmanabha@broadcom.com>
Signed-off-by: Somnath Kotur <somnath.kotur@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 agonet/bnxt: support VLAN header bitmap
Kishore Padmanabha [Mon, 6 Jul 2020 08:24:44 +0000 (13:54 +0530)]
net/bnxt: support VLAN header bitmap

Add support for the vlan headers in the matching of the flow
patterns.

Signed-off-by: Kishore Padmanabha <kishore.padmanabha@broadcom.com>
Signed-off-by: Somnath Kotur <somnath.kotur@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 agonet/bnxt: use source property for VXLAN encap/decap
Kishore Padmanabha [Mon, 6 Jul 2020 08:24:43 +0000 (13:54 +0530)]
net/bnxt: use source property for VXLAN encap/decap

The vxlan encap and decap flows need to allocate the source
record property and populate the action fields during the
flow parsing.

Signed-off-by: Kishore Padmanabha <kishore.padmanabha@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Signed-off-by: Somnath Kotur <somnath.kotur@broadcom.com>
Signed-off-by: Venkat Duvvuru <venkatkumar.duvvuru@broadcom.com>
4 years agonet/bnxt: support NEON
Lance Richardson [Tue, 7 Jul 2020 22:22:25 +0000 (15:22 -0700)]
net/bnxt: support NEON

Add bnxt vector PMD support using NEON SIMD instructions.
Also update the 20.08 release notes with this information.

Signed-off-by: Lance Richardson <lance.richardson@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Reviewed-by: Ruifeng Wang <ruifeng.wang@arm.com>
4 years agonet/bnxt: support Rx/Tx burst mode info
Lance Richardson [Tue, 7 Jul 2020 22:22:24 +0000 (15:22 -0700)]
net/bnxt: support Rx/Tx burst mode info

Retrieve burst mode options according to the selected Rx/Tx burst
function name.
Update 20.08 release notes with this information.

Signed-off-by: Lance Richardson <lance.richardson@broadcom.com>
Reviewed-by: Somnath Kotur <somnath.kotur@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
4 years agonet/bnxt: disable vector Rx for mark action
Lance Richardson [Tue, 7 Jul 2020 22:22:23 +0000 (15:22 -0700)]
net/bnxt: disable vector Rx for mark action

The bnxt vector mode receive handler does not support the rte_flow
'mark' action. Since we cannot know in advance whether this action
will be required, add support for dynamically switching from vector
to non-vector receive when the first flow create request with a
mark action is processed.

Fixes: 94eb699bc82e ("net/bnxt: support flow mark action")
Cc: stable@dpdk.org
Suggested-by: Thomas Monjalon <thomas@monjalon.net>
Signed-off-by: Lance Richardson <lance.richardson@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
4 years agonet/dpaa2: support raw flow classification
Nipun Gupta [Tue, 7 Jul 2020 09:22:44 +0000 (14:52 +0530)]
net/dpaa2: support raw flow classification

Add support for raw flow, which can be used for any
protocol rules.

Signed-off-by: Nipun Gupta <nipun.gupta@nxp.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
4 years agonet/dpaa2: configure per-class distribution size
Jun Yang [Tue, 7 Jul 2020 09:22:43 +0000 (14:52 +0530)]
net/dpaa2: configure per-class distribution size

TC distribution size is set with dist_queues or

nb_rx_queues % dist_queues in order of TC priority.

Signed-off-by: Jun Yang <jun.yang@nxp.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
4 years agonet/dpaa2: support flow API FS miss action configuration
Jun Yang [Tue, 7 Jul 2020 09:22:42 +0000 (14:52 +0530)]
net/dpaa2: support flow API FS miss action configuration

1) dpni_set_rx_hash_dist and dpni_set_rx_fs_dist used for TC
   configuration instead of dpni_set_rx_tc_dist. Otherwise,
   re-configuration of default TC of QoS fails.

2) Default miss action is to drop.  "export
   DPAA2_FLOW_CONTROL_MISS_FLOW=flow_id" is used receive the missed
   packets from flow with flow ID specified.

Signed-off-by: Jun Yang <jun.yang@nxp.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
4 years agonet/dpaa2: modify flow API QoS setup to follow FS setup
Jun Yang [Tue, 7 Jul 2020 09:22:41 +0000 (14:52 +0530)]
net/dpaa2: modify flow API QoS setup to follow FS setup

In HW/MC logical, QoS setup should follow FS setup.
In addition, Skip QoS setup if MAX TC number of DPNI is set 1.

Signed-off-by: Jun Yang <jun.yang@nxp.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
4 years agonet/dpaa2: add flow data sanity check
Jun Yang [Tue, 7 Jul 2020 09:22:40 +0000 (14:52 +0530)]
net/dpaa2: add flow data sanity check

Check flow attributions and actions before creating flow.
Otherwise, the QoS table and FS table need to re-build
if checking fails.

Signed-off-by: Jun Yang <jun.yang@nxp.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
4 years agonet/dpaa2: support index of queue action for flow
Jun Yang [Tue, 7 Jul 2020 09:22:39 +0000 (14:52 +0530)]
net/dpaa2: support index of queue action for flow

Make more sense to use RXQ index for queue distribution

instead of flow ID.

Signed-off-by: Jun Yang <jun.yang@nxp.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
4 years agonet/dpaa2: support distribution size set on multiple TCs
Jun Yang [Tue, 7 Jul 2020 09:22:38 +0000 (14:52 +0530)]
net/dpaa2: support distribution size set on multiple TCs

Default distribution size of TC is 1, which is limited by MC. We have to
set the distribution size for each TC to support multiple RXQs per TC.

Signed-off-by: Jun Yang <jun.yang@nxp.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
4 years agonet/dpaa2: differentiate IPv4/IPv6 in IP flow setup
Jun Yang [Tue, 7 Jul 2020 09:22:37 +0000 (14:52 +0530)]
net/dpaa2: differentiate IPv4/IPv6 in IP flow setup

Discriminate between IPv4 and IPv6 in generic IP flow setup.

Signed-off-by: Jun Yang <jun.yang@nxp.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
4 years agonet/dpaa2: add logging of flow extracts and rules
Jun Yang [Tue, 7 Jul 2020 09:22:36 +0000 (14:52 +0530)]
net/dpaa2: add logging of flow extracts and rules

This patch add support for logging the flow rules.

Signed-off-by: Jun Yang <jun.yang@nxp.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
4 years agonet/dpaa2: define size of table entry
Jun Yang [Tue, 7 Jul 2020 09:22:35 +0000 (14:52 +0530)]
net/dpaa2: define size of table entry

If entry size is not bigger than 27, MC alloc one TCAM entry,
otherwise, alloc 2 TCAM entries.
Extracts size by HW must be not bigger than TCAM entry size(27 or 54).
So define the flow entry size as 54.

Signed-off-by: Jun Yang <jun.yang@nxp.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
4 years agonet/dpaa2: support QoS or FS table entry indexing
Jun Yang [Tue, 7 Jul 2020 09:22:34 +0000 (14:52 +0530)]
net/dpaa2: support QoS or FS table entry indexing

Calculate QoS/FS entry index by group and priority of flow.

1)The less index of entry, the higher priority of flow.
2)Verify if the flow with same group and priority has been added before
  creating flow.

Signed-off-by: Jun Yang <jun.yang@nxp.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
4 years agonet/dpaa2: free flow rule memory
Jun Yang [Tue, 7 Jul 2020 09:22:33 +0000 (14:52 +0530)]
net/dpaa2: free flow rule memory

Free rule memory when the flow is destroyed.

Signed-off-by: Jun Yang <jun.yang@nxp.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
4 years agonet/dpaa2: add sanity check for flow extracts
Jun Yang [Tue, 7 Jul 2020 09:22:32 +0000 (14:52 +0530)]
net/dpaa2: add sanity check for flow extracts

Define extracts support for each protocol and check the fields of each
pattern before building extracts of QoS/FS table.

Signed-off-by: Jun Yang <jun.yang@nxp.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
4 years agonet/dpaa2: support key extracts of flow API
Jun Yang [Tue, 7 Jul 2020 09:22:31 +0000 (14:52 +0530)]
net/dpaa2: support key extracts of flow API

1) Support QoS extracts and TC extracts for multiple TCs.

2) Protocol type of L2 extract is used to parse L3.
   Next protocol of L3 extract is used to parse L4.

3) generic IP key extracts instead of IPv4 and IPv6 respectively.

4) Special for IP address extracts:
   Put IP(v4/v6) address extract(s)/rule(s) at the end of extracts array
   to make rest fields at fixed position.

Signed-off-by: Jun Yang <jun.yang@nxp.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
4 years agonet/dpaa2: support dynamic flow control
Jun Yang [Tue, 7 Jul 2020 09:22:30 +0000 (14:52 +0530)]
net/dpaa2: support dynamic flow control

Dynamic flow used instead of layout defined.

The actual key/mask size depends on protocols and(or) fields
of patterns specified.
Also, the key and mask should start from the beginning of IOVA.

Signed-off-by: Jun Yang <jun.yang@nxp.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
4 years agobus/dpaa: enable set link status
Rohit Raj [Tue, 7 Jul 2020 09:22:29 +0000 (14:52 +0530)]
bus/dpaa: enable set link status

Enabled set link status API to start/stop phy
device from application.

Signed-off-by: Rohit Raj <rohit.raj@nxp.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
4 years agobus/dpaa: enable link state interrupt
Rohit Raj [Tue, 7 Jul 2020 09:22:28 +0000 (14:52 +0530)]
bus/dpaa: enable link state interrupt

Enable/disable link state interrupt and get link state api is
defined using IOCTL calls from kernel driver

Signed-off-by: Rohit Raj <rohit.raj@nxp.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
4 years agodrivers/dpaa: optimize thread local storage
Rohit Raj [Tue, 7 Jul 2020 09:22:27 +0000 (14:52 +0530)]
drivers/dpaa: optimize thread local storage

Minimize the number of different thread variables

Add all the thread specific variables in dpaa_portal
structure to optimize TLS Usage.

Signed-off-by: Rohit Raj <rohit.raj@nxp.com>
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
4 years agonet/dpaa: update process specific device info
Nipun Gupta [Tue, 7 Jul 2020 09:22:26 +0000 (14:52 +0530)]
net/dpaa: update process specific device info

For DPAA devices the memory maps stored in the FMAN interface
information is per process. Store them in the device process specific
area.
This is required to support multi-process apps.

Signed-off-by: Nipun Gupta <nipun.gupta@nxp.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
4 years agonet/dpaa: support 2.5G
Sachin Saxena [Tue, 7 Jul 2020 09:22:25 +0000 (14:52 +0530)]
net/dpaa: support 2.5G

Handle 2.5Gbps ethernet ports as well.

Signed-off-by: Sachin Saxena <sachin.saxena@nxp.com>
Signed-off-by: Gagandeep Singh <g.singh@nxp.com>
4 years agonet/dpaa: enable Tx queue taildrop
Gagandeep Singh [Tue, 7 Jul 2020 09:22:24 +0000 (14:52 +0530)]
net/dpaa: enable Tx queue taildrop

Enable congestion handling/tail drop for TX queues.

Signed-off-by: Gagandeep Singh <g.singh@nxp.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
4 years agobus/fslmc: rename cinh read functions used for ls1088
Nipun Gupta [Tue, 7 Jul 2020 09:22:23 +0000 (14:52 +0530)]
bus/fslmc: rename cinh read functions used for ls1088

This patch changes the qbman I/O function names as they are
only reading from cinh register, but writing to cena registers.

This gives way to add functions which purely work in cinh mode

Signed-off-by: Nipun Gupta <nipun.gupta@nxp.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
4 years agobus/fslmc: support portal migration
Nipun Gupta [Tue, 7 Jul 2020 09:22:22 +0000 (14:52 +0530)]
bus/fslmc: support portal migration

The patch adds support for portal migration by disabling stashing
for the portals which is used in the non-affined threads, or on
threads affined to multiple cores

Signed-off-by: Nipun Gupta <nipun.gupta@nxp.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
4 years agobus/fslmc: handle portal allocation failure
Hemant Agrawal [Tue, 7 Jul 2020 09:22:21 +0000 (14:52 +0530)]
bus/fslmc: handle portal allocation failure

Add the error handling on failure.

Signed-off-by: Nipun Gupta <nipun.gupta@nxp.com>
Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
4 years agobus/fslmc: rework portal allocation to per-thread basis
Nipun Gupta [Tue, 7 Jul 2020 09:22:20 +0000 (14:52 +0530)]
bus/fslmc: rework portal allocation to per-thread basis

The patch reworks the portal allocation which was previously
being done on per lcore basis to a per thread basis.
Now user can also create its own threads and use DPAA2 portals
for packet I/O.

Signed-off-by: Nipun Gupta <nipun.gupta@nxp.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
4 years agobus/fslmc: combine thread-specific variables
Gagandeep Singh [Tue, 7 Jul 2020 09:22:19 +0000 (14:52 +0530)]
bus/fslmc: combine thread-specific variables

This is to reduce the thread local storage

Signed-off-by: Gagandeep Singh <g.singh@nxp.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
4 years agonet/dpaa2: enable timestamp for Rx offload case
Gagandeep Singh [Tue, 7 Jul 2020 09:22:18 +0000 (14:52 +0530)]
net/dpaa2: enable timestamp for Rx offload case

This patch enables the packet timestamping
conditionally when Rx offload is enabled for timestamp.

Signed-off-by: Gagandeep Singh <g.singh@nxp.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
4 years agonet/dpaa: fix FD offset data type
Nipun Gupta [Tue, 7 Jul 2020 09:22:17 +0000 (14:52 +0530)]
net/dpaa: fix FD offset data type

On DPAA fd offset is 9 bits, but we are using uint8_t in the
SG case. This patch fixes the same.

Fixes: 8cffdcbe85aa ("net/dpaa: support scattered Rx")
Cc: stable@dpdk.org
Signed-off-by: Nipun Gupta <nipun.gupta@nxp.com>
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
4 years agobus/fslmc: fix getting FD error
Nipun Gupta [Tue, 7 Jul 2020 09:22:16 +0000 (14:52 +0530)]
bus/fslmc: fix getting FD error

Fix the incorrect register for getting error

Fixes: 03e36408b9fb ("bus/fslmc: add macros required by QDMA for FLE and FD")
Cc: stable@dpdk.org
Signed-off-by: Nipun Gupta <nipun.gupta@nxp.com>
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
4 years agoethdev: verify reserved HW ring
Ferruh Yigit [Wed, 24 Jun 2020 09:35:20 +0000 (10:35 +0100)]
ethdev: verify reserved HW ring

Function 'rte_eth_dma_zone_reserve()' returns an existing memzone based
on name match, but other requested attributes are discarded.
This may cause driver using a memzone with wrong size or alignment.

Verify size, alignment and socket_id for matched memzone, and do not use
memzone if any one of the attributes are not justified.

It is possible to free the existing memzone and allocate again with the
requested attributes but it is better caller do the explicit free.

Reported-by: Renata Saiakhova <renata.saiakhova@ekinops.com>
Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
Reviewed-by: Andrew Rybchenko <arybchenko@solarflare.com>
4 years agoapp/testpmd: support RSS config in flow query
Chenxu Di [Wed, 8 Jul 2020 01:18:41 +0000 (01:18 +0000)]
app/testpmd: support RSS config in flow query

This patch support RSS action in flow query.
It can display the RSS configuration of the specified rule.

For example:
we can create an RSS rule by command "flow create 0 ingress
pattern eth / ipv4 / tcp / end actions rss types ipv4-tcp
l3-src-only l4-dst-only end queues end func symmetric_toeplitz
 / end" and then query it "flow query 0 0 rss"
the log will be follow
RSS:
 queues: none
 function: symmetric_toeplitz
 types:
  ipv4-tcp
  l3-src-only
  l4-dst-only

Signed-off-by: Chenxu Di <chenxux.di@intel.com>
Acked-by: Qiming Yang <qiming.yang@intel.com>
4 years agonet/i40e: enable flow query RSS
Chenxu Di [Wed, 8 Jul 2020 01:18:40 +0000 (01:18 +0000)]
net/i40e: enable flow query RSS

This patch enables flow query function to get the
configuration of the specified rule.

Signed-off-by: Chenxu Di <chenxux.di@intel.com>
Acked-by: Jeff Guo <jia.guo@intel.com>