dpdk.git
4 years agobuildtools: add symbols map update script
Pawel Modrak [Wed, 20 Nov 2019 17:23:31 +0000 (17:23 +0000)]
buildtools: add symbols map update script

Add a script that automatically merges all stable ABI's under one
ABI section with the new version, while leaving experimental
section exactly as it is.

Signed-off-by: Pawel Modrak <pawelx.modrak@intel.com>
Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Thomas Monjalon <thomas@monjalon.net>
4 years agobuild: remove individual library versions
Anatoly Burakov [Wed, 20 Nov 2019 17:23:30 +0000 (17:23 +0000)]
build: remove individual library versions

Since the library versioning for both stable and experimental ABI's is
now managed globally, the LIBABIVER and version variables no longer
serve any useful purpose, and can be removed.

The replacement in Makefiles was done using the following regex:

^(#.*\n)?LIBABIVER\s*:=\s*\d+\n(\s*\n)?

(LIBABIVER := numbers, optionally preceded by a comment and optionally
succeeded by an empty line)

The replacement for meson files was done using the following regex:

^(#.*\n)?version\s*=\s*\d+\n(\s*\n)?

(version = numbers, optionally preceded by a comment and optionally
succeeded by an empty line)

[David]: those variables are manually removed for the files:
- drivers/common/qat/Makefile
- lib/librte_eal/meson.build
[David]: the LIBABIVER is restored for the external ethtool example
library.

Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
Signed-off-by: David Marchand <david.marchand@redhat.com>
Acked-by: Thomas Monjalon <thomas@monjalon.net>
4 years agobuild: change ABI versioning to global
Marcin Baran [Wed, 20 Nov 2019 17:23:28 +0000 (17:23 +0000)]
build: change ABI versioning to global

As per new ABI policy [1], all of the libraries are now versioned using
one global ABI version. Stable libraries use the MAJOR.MINOR ABI
version for their shared objects, while experimental libraries
use the 0.MAJORMINOR convention for their versioning.
Experimental library versioning is managed globally. Changes in this
patch implement the necessary steps to enable that.

The CONFIG_RTE_MAJOR_ABI option was introduced to permit multiple
DPDK versions installed side by side. The problem is now addressed
through the new ABI policy, and thus can be removed.

[David] For external libraries relying on Makefile, LIBABIVER is
preserved to avoid using DPDK global ABI version.

[1] https://doc.dpdk.org/guides/contributing/abi_policy.html

Signed-off-by: Marcin Baran <marcinx.baran@intel.com>
Signed-off-by: Pawel Modrak <pawelx.modrak@intel.com>
Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
Signed-off-by: David Marchand <david.marchand@redhat.com>
Acked-by: Thomas Monjalon <thomas@monjalon.net>
4 years agoexamples: hide error for missing pkg-config path flag
Bruce Richardson [Fri, 15 Nov 2019 15:17:00 +0000 (15:17 +0000)]
examples: hide error for missing pkg-config path flag

Some versions of pkg-config don't support the --path flag, which is not a
fatal error when building the apps. Without the flag, the makefile just
cannot track the .pc file of DPDK as a dependency of the build. Therefore,
we can ignore the error and suppress it by redirecting to /dev/null the
stderr from that call to pkg-config.

Fixes: 22119c4591a0 ("examples: use pkg-config in makefiles")
Cc: stable@dpdk.org
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Tested-by: Ferruh Yigit <ferruh.yigit@intel.com>
4 years agoexamples: fix build with old pkg-config
Bruce Richardson [Fri, 15 Nov 2019 15:16:59 +0000 (15:16 +0000)]
examples: fix build with old pkg-config

Not all versions of pkg-config in distros have support for the
--define-prefix flag [1], causing errors when building examples manually or
with test-meson-builds.sh script [2].

For the former case, we need to remove the hard-coded use of the flag in
the Makefiles.

For the latter case, the flag is necessary for builds to succeed, so we
skip the tests when it's not present, passing it as part of the pkg-config
command if it is supported.

[1]
CentOS Linux release 7.7.1908 (Core)
pkg-config version 0.27.1

[2]
 ## Building cmdline
Unknown option --define-prefix
gmake: Entering directory
`...ild-x86-default/install-root/usr/local/share/dpdk/examples/cmdline'
rm -f build/cmdline build/cmdline-static build/cmdline-shared
test -d build && rmdir -p build || true
Unknown option --define-prefix
Unknown option --define-prefix
gcc -O3  main.c commands.c parse_obj_list.c -o build/cmdline-shared
main.c:14:28: fatal error: cmdline_rdline.h: No such file or directory

Fixes: ca9268529d2b ("examples: support relocated DPDK install")
Fixes: 7f80a2102bbb ("devtools: test pkg-config file")
Cc: stable@dpdk.org
Reported-by: Ferruh Yigit <ferruh.yigit@intel.com>
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Tested-by: Ferruh Yigit <ferruh.yigit@intel.com>
4 years agonet/mlx5: fix Rx queue release assertions
Matan Azrad [Wed, 20 Nov 2019 09:21:16 +0000 (09:21 +0000)]
net/mlx5: fix Rx queue release assertions

In debug mode, there is assertion to validate the CQ object before the
release.

Wrongly, the assertion is done for any type of RX queue even if it
doesn't use CQ at all, for example in hairpin Rx queue.

Ignore CQ assertion when hairpin queue is released.

Fixes: e79c9be91515 ("net/mlx5: support Rx hairpin queues")

Signed-off-by: Matan Azrad <matan@mellanox.com>
Acked-by: Ori Kam <orika@mellanox.com>
4 years agonet/hinic: fix secondary process
Xiaoyun Wang [Tue, 19 Nov 2019 12:31:34 +0000 (20:31 +0800)]
net/hinic: fix secondary process

The secondary process does not need to register interrupt handle,
remove rte_intr_callback_register from secondary process branch.

Fixes: 64727024d2fd ("net/hinic: add device initialization")
Cc: stable@dpdk.org
Signed-off-by: Xiaoyun Wang <cloud.wangxiaoyun@huawei.com>
4 years agoapp/testpmd: report invalid command line parameter
David Marchand [Mon, 18 Nov 2019 15:37:14 +0000 (16:37 +0100)]
app/testpmd: report invalid command line parameter

We currently do not check that a non option string has been passed to
testpmd.

Example:
$ ./master/app/testpmd --no-huge -m 512 --vdev net_null0 \
--vdev net_null1 -- -i nb-cores=2 --total-num-mbuf 2048
[...]
testpmd> show config fwd
io packet forwarding - ports=2 - cores=1 - streams=2 - NUMA support
enabled, MP allocation mode: native
Logical Core 1 (socket 0) forwards packets on 2 streams:
  RX P=0/Q=0 (socket 0) -> TX P=1/Q=0 (socket 0) peer=02:00:00:00:00:01
  RX P=1/Q=0 (socket 0) -> TX P=0/Q=0 (socket 0) peer=02:00:00:00:00:00

Here nb-cores=2 is just ignored, while the (probably sleepy) user did not
notice this.

Validate that all strings passed to testpmd are part of a known option.

After this patch:
$ ./master/app/testpmd --no-huge -m 512 --vdev net_null0 \
--vdev net_null1 -- -i nb-cores=2 --total-num-mbuf 2048
[...]
Invalid parameter: nb-cores=2
EAL: Error - exiting with code: 1
  Cause: Command line incorrect

While at it, when passing an unknown option, print the string that gets
refused by getopt_long to help the user.

Fixes: af75078fece3 ("first public release")
Cc: stable@dpdk.org
Signed-off-by: David Marchand <david.marchand@redhat.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
4 years agonet/mlx5: fix L3 encapsulation flow validation
Matan Azrad [Tue, 19 Nov 2019 15:32:28 +0000 (15:32 +0000)]
net/mlx5: fix L3 encapsulation flow validation

In order to configure L3 encapsulation\decapsulation flow to mlx5
devices, 2 actions should be added to the flow actions list:
RTE_FLOW_ACTION_TYPE_RAW_DECAP and RTE_FLOW_ACTION_TYPE_RAW_ENCAP.

One of the validations for this scenario is to check that modify actions
is not done before the L3 decapsulation, because it doesn't make sense
to decapsulate a modified data.

Wrongly, this check was done for the case of L3 encapsulation what
causes a validation failure in modify + L3 encapsulation flow.

Ignore this check in case of L3 encapsulation.

Fixes: 4bb14c83df95 ("net/mlx5: support modify header using Direct Verbs")
Cc: stable@dpdk.org
Signed-off-by: Matan Azrad <matan@mellanox.com>
4 years agonet/bnxt: fix flow check for null spec and mask
Ajit Khaparde [Wed, 20 Nov 2019 03:00:23 +0000 (19:00 -0800)]
net/bnxt: fix flow check for null spec and mask

bnxt_validate_and_parse_flow_type already has protocol specific NULL
checks for rte_flow_item spec and mask and take actions accordingly.
A check at the top of the loop is redundant and is preventing the
protocol specific checks from being executed.

Fixes: b7e01f386059 ("net/bnxt: handle cleanup if flow creation fails")

Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Reviewed-by: Santoshkumar Karanappa Rastapur <santosh.rastapur@broadcom.com>
Reviewed-by: Somnath Kotur <somnath.kotur@broadcom.com>
4 years agonet/bnxt: fix vector Rx selection
Lance Richardson [Tue, 19 Nov 2019 22:12:15 +0000 (17:12 -0500)]
net/bnxt: fix vector Rx selection

Take DEV_RX_OFFLOAD_RSS_HASH into account when deciding whether vector
mode receive can be enabled.

Fixes: 8b945a7f7dcb ("drivers/net: update Rx RSS hash offload capabilities")

Signed-off-by: Lance Richardson <lance.richardson@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
4 years agonet/bnxt: fix jumbo frame configuration in firmware
Rahul Gupta [Fri, 15 Nov 2019 09:40:09 +0000 (15:10 +0530)]
net/bnxt: fix jumbo frame configuration in firmware

In order to prevent reconfiguration of firmware resources for every
MTU change, configure FW with max MTU value using hwrm_func_cfg
to support all frame sizes. There is no need to overwrite the driver
level MTU variable data->mtu with the FW MTU.

Fixes: 905cd45ce30e ("net/bnxt: use configured MTU during load")
Cc: stable@dpdk.org
Signed-off-by: Rahul Gupta <rahul.gupta@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Reviewed-by: Somnath Kotur <somnath.kotur@broadcom.com>
4 years agonet/bnxt: fix resource qcaps with older FW
Ajit Khaparde [Mon, 18 Nov 2019 22:23:45 +0000 (14:23 -0800)]
net/bnxt: fix resource qcaps with older FW

On some old versions of FW, bnxt_hwrm_func_resc_qcaps can return an
error. This is because the command was not implemented completely
in FW till the subsequent version. Ignore the error and continue with
the driver initialization.

Fixes: edafb57ba4a1 ("net/bnxt: fix VF resource allocation")
Cc: stable@dpdk.org
Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Reviewed-by: Somnath Kotur <somnath.kotur@broadcom.com>
4 years agonet/ice: fix flow director rule duplication check
Yahui Cao [Tue, 19 Nov 2019 16:01:00 +0000 (00:01 +0800)]
net/ice: fix flow director rule duplication check

When FDIR filter detects duplicated rule and then returns EEXIST, ice
flow will capture this error and return immediately.

Fixes: 4e27d3ed02bd ("net/ice: fix flow API framework")

Signed-off-by: Yahui Cao <yahui.cao@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
4 years agonet/mlx5: fix hairpin split detection
Ori Kam [Tue, 19 Nov 2019 12:38:33 +0000 (12:38 +0000)]
net/mlx5: fix hairpin split detection

When creating a flow, the flow is checked if it should be split into
2 flows based on the queue/rss acton.

If the RSS action with given without any queues, it will result in crash
due to the fact that the function checks the queue type.

This commit fixes this issue by checking if the rss action is not empty,
and at least one queue.

Fixes: d85c7b5ea59f ("net/mlx5: split hairpin flows")

Signed-off-by: Ori Kam <orika@mellanox.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
4 years agonet/mlx5: fix assert in Tx inline settings
Viacheslav Ovsiienko [Tue, 19 Nov 2019 13:13:09 +0000 (13:13 +0000)]
net/mlx5: fix assert in Tx inline settings

Assert condition is fixed to not alert for the case
when multi-packet write is not supported/engaged at all.

Fixes: b53cd86965a1 ("net/mlx5: adjust inline setting for large Tx queue sizes")

Signed-off-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
4 years agonet/mlx5: fix port action for LAG
Viacheslav Ovsiienko [Tue, 19 Nov 2019 09:16:04 +0000 (09:16 +0000)]
net/mlx5: fix port action for LAG

To support LAG configurations the mlx5dv_dr_action_create_dest_ib_port()
should be called instead of mlx5dv_dr_action_create_dest_vport().

Fixes: f07341e7aed3 ("net/mlx5: update source and destination vport translations")

Signed-off-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
Acked-by: Ori Kam <orika@mellanox.com>
4 years agoethdev: avoid undefined behaviour on configuration copy
Andrew Rybchenko [Tue, 19 Nov 2019 08:22:50 +0000 (08:22 +0000)]
ethdev: avoid undefined behaviour on configuration copy

memcpy() source and destination areas must not overlap and equal
pointers is the case which is really met, so handle it.

Fixes: 68b931bff287 ("ethdev: eliminate interim variable")
Cc: stable@dpdk.org
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
4 years agonet/ice: add flow mark hint
Qi Zhang [Tue, 19 Nov 2019 06:14:42 +0000 (14:14 +0800)]
net/ice: add flow mark hint

Since not all data paths support flow mark, the driver needs
a hint from application to select the correct data path if
flow mark is required. The patch introduces a devarg
"flow-mark-support" as a workaround solution, since a standard
way is still ongoing.

Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Qiming Yang <qiming.yang@intel.com>
4 years agonet/ice: fix flow director rule after device stop
Yahui Cao [Mon, 18 Nov 2019 22:23:43 +0000 (06:23 +0800)]
net/ice: fix flow director rule after device stop

By moving irq enable/disable from device start/stop to FDIR
setup/teardown, FDIR queue irq config is independent of LAN queue irq
config. So device stop will not cause FDIR rule failure.

Fixes: 84dc7a95a2d3 ("net/ice: enable flow director engine")

Signed-off-by: Yahui Cao <yahui.cao@intel.com>
Signed-off-by: Beilei Xing <beilei.xing@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
Tested-by: Qi Zhang <qi.z.zhang@intel.com>
4 years agonet/ice: fix flow director programming status check
Yahui Cao [Mon, 18 Nov 2019 22:23:42 +0000 (06:23 +0800)]
net/ice: fix flow director programming status check

To make sure if FDIR programming succeed or fail, legacy programming
status descriptor WB format is enabled and FDIR queue irq is opened.

Fixes: 84dc7a95a2d3 ("net/ice: enable flow director engine")

Signed-off-by: Yahui Cao <yahui.cao@intel.com>
Signed-off-by: Beilei Xing <beilei.xing@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
Tested-by: Qi Zhang <qi.z.zhang@intel.com>
4 years agonet/ice: fix flow type selection for flow director
Qi Zhang [Tue, 19 Nov 2019 01:07:02 +0000 (09:07 +0800)]
net/ice: fix flow type selection for flow director

The FDIR parser will select ICE_FLTR_PTYPE_NONF_IPV4_OTHER as flow type
for an IPv4 UDP flow with empty l4 matching field which is not correct.
Same issues happens on all the combination between IPv4/IPv6 and
UDP/TCP/SCTP cases.

The patch fixes all the wrong flow ptype selections.

Fixes: f5cafa961fae ("net/ice: add flow director create and destroy")

Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Beilei Xing <beilei.xing@intel.com>
4 years agonet/mlx5: fix Tx doorbell write memory barrier
Viacheslav Ovsiienko [Fri, 15 Nov 2019 11:35:06 +0000 (11:35 +0000)]
net/mlx5: fix Tx doorbell write memory barrier

As the result of testing it was found that some hosts have
the performance penalty imposed by required write memory barrier
after doorbell writing. Before 19.08 release there was some
heuristics to decide whether write memory barrier should be
performed. For the bursts of recommended size (or multiple)
it was supposed there were some extra ongoing packets in the
next burst and write memory barrier may be skipped (supposed
to be performed in the next burst, at least after descriptor
writing).

This patch restores that behaviour, the devargs tx_db_nc=2
must be specified to engage this performance tuning feature.

Fixes: 8409a28573d3 ("net/mlx5: control transmit doorbell register mapping")
Cc: stable@dpdk.org
Signed-off-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
4 years agonet/mlx5: change default flow engine to DV
Dekel Peled [Thu, 24 Oct 2019 12:52:53 +0000 (15:52 +0300)]
net/mlx5: change default flow engine to DV

The default flow engine is Verbs flow engine, for legacy reasons.
This patch changes the default to DV flow engine (dv_flow_en = 1).
Documentation is updated accordingly.

Signed-off-by: Dekel Peled <dekelp@mellanox.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
4 years agonet/af_packet: advertise Tx offload capabilities
Paul Atkins [Wed, 13 Nov 2019 12:08:00 +0000 (12:08 +0000)]
net/af_packet: advertise Tx offload capabilities

The af_packet pmd already supports MULTI_SEG tx packets, and tx
VLAN_INSERT so advertise these capabilities.

Signed-off-by: Paul Atkins <paul.atkins@intl.att.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
4 years agonet/mlx5: fix vport index in port action
Viacheslav Ovsiienko [Sun, 17 Nov 2019 08:48:26 +0000 (08:48 +0000)]
net/mlx5: fix vport index in port action

The rdma_core routine mlx5dv_dr_create_flow_action_dest_vport()
requires the vport id parameter to create port action.
The register c[0] value was used to deduce the port id value
and it fails in bonding configuration. The correct way is
to apply vport_num value queried from the rdma_core library.

Fixes: f07341e7aed3 ("net/mlx5: update source and destination vport translations")

Signed-off-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
4 years agonet/mlx5: fix flow table hash list conversion
Matan Azrad [Sun, 17 Nov 2019 12:14:54 +0000 (12:14 +0000)]
net/mlx5: fix flow table hash list conversion

For the case when DR is not supported and DV is supported:
multi-tables feature is off.
In this case, only table 0 is supported.
Table 0 structure wrongly was not created what prevented any
matcher object to be created and even caused crashes.

Create the table hash list in DV case too.
Create table zero empty structure for each domain when DR is not
supported.
Allow NULL DR internal table object to be used.

Fixes: 860897d2895a ("net/mlx5: reorganize flow tables with hash list")

Signed-off-by: Matan Azrad <matan@mellanox.com>
4 years agodoc: add matching component list for ice
Qi Zhang [Mon, 18 Nov 2019 04:03:34 +0000 (12:03 +0800)]
doc: add matching component list for ice

Add kernel driver, firmware and DDP package matching list
for ice PMD.

Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Xiaolong Ye <xiaolong.ye@intel.com>
4 years agonet/ice/base: update version
Qi Zhang [Mon, 18 Nov 2019 04:14:43 +0000 (12:14 +0800)]
net/ice/base: update version

Update base code version info in readme.

Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Xiaolong Ye <xiaolong.ye@intel.com>
4 years agonet/memif: support zero-copy slave
Jakub Grajciar [Mon, 4 Nov 2019 11:03:00 +0000 (12:03 +0100)]
net/memif: support zero-copy slave

Zero-copy slave support for memif PMD.
Slave interface exposes DPDK memory to
master interface. Only single file segments
are supported (EAL option --single-file-segments).

Signed-off-by: Jakub Grajciar <jgrajcia@cisco.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
4 years agonet: constify pointer to IPv6 header
Stephen Hemminger [Fri, 15 Nov 2019 00:02:59 +0000 (16:02 -0800)]
net: constify pointer to IPv6 header

The function rte_ipv6_get_next_ext does not modify
the header that is passed in.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
4 years agoapp/testpmd: fix cleanup of Tx metadata offload
Dekel Peled [Thu, 14 Nov 2019 13:59:13 +0000 (15:59 +0200)]
app/testpmd: fix cleanup of Tx metadata offload

Commit in fixes tag removed the match_metadata Tx offload.
This patch removes the option to select this offload from testpmd
menu, help text and documentation.

It also modifies the cmd_show_tx_metadata_parsed() function, to
display the value correctly, and the dump_pkt_burst() function to
display the relevant (Tx/Rx) metadata only.

Fixes: 9bf26e1318e3 ("ethdev: move egress metadata to dynamic field")

Signed-off-by: Dekel Peled <dekelp@mellanox.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
Acked-by: Bernard Iremonger <bernard.iremonger@intel.com>
4 years agonet/bonding: fix selection logic
Krzysztof Kanas [Wed, 13 Nov 2019 08:22:24 +0000 (09:22 +0100)]
net/bonding: fix selection logic

Arrays agg_count and agg_bandwidth should be indexed by slave_id not by
aggregator port_id.

The new_agg_id should be chosen as slave_id from slaves table in
different selection modes.

Fixes: 6d72657ce379 ("net/bonding: add other aggregator modes")
Cc: stable@dpdk.org
Signed-off-by: Krzysztof Kanas <kkanas@marvell.com>
Acked-by: Chas Williams <chas3@att.com>
Acked-by: Ferruh Yigit <ferruh.yigit@intel.com>
4 years agonet: use IPV4 VHL constant
Reshma Pattan [Fri, 8 Nov 2019 10:02:00 +0000 (10:02 +0000)]
net: use IPV4 VHL constant

Use new macro RTE_IPV4_VHL_DEF instead of IP_VHL_DEF
wherever applicable.

Signed-off-by: Reshma Pattan <reshma.pattan@intel.com>
Acked-by: Hyong Youb Kim <hyonkim@cisco.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
4 years agoethdev: improve message about not disabled offload
Andrew Rybchenko [Thu, 14 Nov 2019 16:40:52 +0000 (16:40 +0000)]
ethdev: improve message about not disabled offload

Avoid usaged of "failed" in the message about not requested but
enabled offload, since it is not a failure.

Fixes: 1daa33805824 ("ethdev: validate offloads set by PMD")

Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Acked-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Stephen Hemminger <stephen@networkplumber.org>
4 years agoethdev: decrease verbosity of not disabled offload logs
Andrew Rybchenko [Thu, 14 Nov 2019 16:40:51 +0000 (16:40 +0000)]
ethdev: decrease verbosity of not disabled offload logs

Right now a PMD decides if it is critical that an offload cannot
be disabled (i.e. not requested, but still enabled). If PMD treaks
it as OK, we should not spam logs with corresponding messages
by default. Default log level in ethdev is INFO, so change the
message level to DEBUG.

Fixes: 1daa33805824 ("ethdev: validate offloads set by PMD")

Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Acked-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Stephen Hemminger <stephen@networkplumber.org>
4 years agodrivers/net: fix RSS hash offload flag if no RSS
Andrew Rybchenko [Thu, 14 Nov 2019 16:40:50 +0000 (16:40 +0000)]
drivers/net: fix RSS hash offload flag if no RSS

By default RSS hash delivery (offload) is bound to RSS mode and
it is incorrect to advertise it as enabled if Rx multi-queue mode
has no RSS.

Fixes: 8b945a7f7dcb ("drivers/net: update Rx RSS hash offload capabilities")

Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
4 years agonet/octeontx2: support reduced set of packet types
Pavan Nikhilesh [Thu, 7 Nov 2019 02:52:54 +0000 (08:22 +0530)]
net/octeontx2: support reduced set of packet types

Add support to set supported ptypes for octeontx2 and
remove devarg scheme to disable ptype parsing support as
application can use rte_eth_dev_set_ptypes() normative API
to enable the same use case.

Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
4 years agonet/octeontx2: fix PTP configurations for VF
Harman Kalra [Mon, 11 Nov 2019 05:48:54 +0000 (05:48 +0000)]
net/octeontx2: fix PTP configurations for VF

Issue has been observed if PTP is already enabled on PF and
later VFs are configured. Since PTP requires mbuf data off
to be shifted by 8 bytes, due to this l3fwd/l2fwd was not
working with VFs.
Also some extra garbage bytes were observed in packet data
when ptp was enabled.

Fixes: b5dc3140448e ("net/octeontx2: support base PTP")
Cc: stable@dpdk.org
Signed-off-by: Harman Kalra <hkalra@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
4 years agonet/octeontx2: fix error handling after CQ init
Anoob Joseph [Mon, 11 Nov 2019 13:21:14 +0000 (18:51 +0530)]
net/octeontx2: fix error handling after CQ init

After otx2_nix_register_cq_irqs() is called and the IRQs are setup,
otx2_nix_unregister_cq_irqs() need to be called in the subsequent error
exit paths.

Fixes: d34db5ccbf30 ("net/octeontx2: fix driver reconfiguration")
Cc: stable@dpdk.org
Signed-off-by: Anoob Joseph <anoobj@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
4 years agonet/octeontx2: add Rx/Tx burst mode info
Sunil Kumar Kori [Tue, 12 Nov 2019 09:02:27 +0000 (14:32 +0530)]
net/octeontx2: add Rx/Tx burst mode info

Retrieve burst mode information according to the selected Rx/Tx mode and
offloads.

Signed-off-by: Sunil Kumar Kori <skori@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
4 years agonet/bnxt: fix IP checksum error indication
Kalesh AP [Fri, 15 Nov 2019 04:50:28 +0000 (10:20 +0530)]
net/bnxt: fix IP checksum error indication

Update "mbuf->ol_flags" correctly for 'Checksum Unknown' errors
for both tunneled and non-tunneled IP packets.

Fixes: b875339622a3 ("net/bnxt: fix L4 checksum indication in non-vector Rx")
Cc: stable@dpdk.org
Signed-off-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Reviewed-by: Somnath Kotur <somnath.kotur@broadcom.com>
4 years agoethdev: fix log line feed
Pavan Nikhilesh [Thu, 14 Nov 2019 19:31:32 +0000 (01:01 +0530)]
ethdev: fix log line feed

Fix missing new line token at the end of log.

Fixes: 5d308972954c ("ethdev: add mbuf RSS update as an offload")

Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
4 years agoraw/ifpga: introduce IRQ functions
Tianfei Zhang [Thu, 14 Nov 2019 09:03:07 +0000 (17:03 +0800)]
raw/ifpga: introduce IRQ functions

Introducing new register and unregister API for ifpga interrupt.
1. register FME and AFU interrupt
   ifpga_register_msix_irq()

2. unregister FME and AFU interrupt
   ifpga_unregister_msix_irq()

On PAC N3000 card, there is one PCIe MSIX interrupt for FME management,
like the error report, thermal management, we use this interrupt in
ifpga_rawdev device driver. on the other hand, there are about 4 PCIe
MSIX interrupts are reserved for AFU which end-user can use those
interrupts in their AFU logic design. End-user can use those APIs to
register interrupt handler in their AFU drivers.

Signed-off-by: Tianfei Zhang <tianfei.zhang@intel.com>
Signed-off-by: Andy Pei <andy.pei@intel.com>
4 years agoraw/ifpga/base: support multiple cards
Tianfei Zhang [Thu, 14 Nov 2019 09:03:06 +0000 (17:03 +0800)]
raw/ifpga/base: support multiple cards

In PAC N3000 card, there is one MAX10 chip in each card, and
all of the sensors are connected to MAX10 chip. To support multiple
cards in one server, we introducing a sensor device list under
intel_max10_device instead of a global list. On the other hand, we
using separate intel_max10_device instance for each opae_adatper.

Add mutex lock on do_transaction() function for SPI driver to avoid
race condition.

Signed-off-by: Tianfei Zhang <tianfei.zhang@intel.com>
Signed-off-by: Andy Pei <andy.pei@intel.com>
4 years agoraw/ifpga: support lightweight FPGA image
Andy Pei [Thu, 14 Nov 2019 09:03:05 +0000 (17:03 +0800)]
raw/ifpga: support lightweight FPGA image

if fpga image support lightweight feature, set afu uuid to all 0, ipn3ke
representor will not be probed.

Signed-off-by: Andy Pei <andy.pei@intel.com>
4 years agoraw/ifpga/base: get board info
Tianfei Zhang [Thu, 14 Nov 2019 09:03:04 +0000 (17:03 +0800)]
raw/ifpga/base: get board info

Add new API to get the board info.
opae_mgr_get_board_info()

Signed-off-by: Tianfei Zhang <tianfei.zhang@intel.com>
Signed-off-by: Andy Pei <andy.pei@intel.com>
4 years agoraw/ifpga/base: clean FME errors
Tianfei Zhang [Thu, 14 Nov 2019 09:03:03 +0000 (17:03 +0800)]
raw/ifpga/base: clean FME errors

Clean fme errors register when some fme errors occurred.

Signed-off-by: Tianfei Zhang <tianfei.zhang@intel.com>
Signed-off-by: Andy Pei <andy.pei@intel.com>
4 years agoraw/ifpga/base: configure FEC mode
Tianfei Zhang [Thu, 14 Nov 2019 09:03:02 +0000 (17:03 +0800)]
raw/ifpga/base: configure FEC mode

We can change the PKVL FEC mode when the A10 NIOS FW
initialization. The end-user can use this feature the
change the FEC mode, the default mode is RS FEC mode.

Signed-off-by: Tianfei Zhang <tianfei.zhang@intel.com>
Signed-off-by: Andy Pei <andy.pei@intel.com>
4 years agoraw/ifpga/base: support max10 security feature
Tianfei Zhang [Thu, 14 Nov 2019 09:03:01 +0000 (17:03 +0800)]
raw/ifpga/base: support max10 security feature

In PAC N3000 Card, MAX10 Board Management Controller (BMC) implements
the security functionality.

Security functionality adds secure Remote System Update (RSU)
authentication and integrity checks for FPGA flat image,
and FW updates to the card.

This patch adds security feature support for MAX10, in secure solution
some registers and the content of the Device Tree changes.

Signed-off-by: Tianfei Zhang <tianfei.zhang@intel.com>
Signed-off-by: Andy Pei <andy.pei@intel.com>
4 years agonet/ipn3ke: remove configuration for i40e port bonding
Rosen Xu [Thu, 14 Nov 2019 09:03:00 +0000 (17:03 +0800)]
net/ipn3ke: remove configuration for i40e port bonding

The ipn3ke board FPGA and i40e BDF scan has added in ifpga_rawdev,
so it doesn't need to provide configuration for i40e port bonding.

Signed-off-by: Rosen Xu <rosen.xu@intel.com>
Signed-off-by: Andy Pei <andy.pei@intel.com>
4 years agoraw/ifpga: scan PCIe BDF device tree
Rosen Xu [Thu, 14 Nov 2019 09:02:59 +0000 (17:02 +0800)]
raw/ifpga: scan PCIe BDF device tree

Add PCIe BDF devices tree scan for ipn3ke.

Signed-off-by: Rosen Xu <rosen.xu@intel.com>
Signed-off-by: Andy Pei <andy.pei@intel.com>
4 years agoraw/ifpga: add SEU error handler
Rosen Xu [Thu, 14 Nov 2019 09:02:58 +0000 (17:02 +0800)]
raw/ifpga: add SEU error handler

Add SEU interrupt support for FPGA.

Signed-off-by: Tianfei Zhang <tianfei.zhang@intel.com>
Signed-off-by: Rosen Xu <rosen.xu@intel.com>
Signed-off-by: Andy Pei <andy.pei@intel.com>
4 years agoraw/ifpga/base: update SEU register definition
Tianfei Zhang [Thu, 14 Nov 2019 09:02:57 +0000 (17:02 +0800)]
raw/ifpga/base: update SEU register definition

Update the SEU register definition.

Signed-off-by: Tianfei Zhang <tianfei.zhang@intel.com>
Signed-off-by: Andy Pei <andy.pei@intel.com>
4 years agoraw/ifpga/base: introduce sensor functions
Tianfei Zhang [Thu, 14 Nov 2019 09:02:56 +0000 (17:02 +0800)]
raw/ifpga/base: introduce sensor functions

Introducing sensor APIs to PMD driver for PAC N3000 card.

Those sensor APIs:
1. opae_mgr_for_each_sensor()
2. opae_mgr_get_sensor_by_name()
3. opae_mgr_get_sensor_by_id()
4. opae_mgr_get_sensor_value_by_name()
5. opae_mgr_get_sensor_value_by_id()
6. opae_mgr_get_sensor_value()

Signed-off-by: Tianfei Zhang <tianfei.zhang@intel.com>
Signed-off-by: Andy Pei <andy.pei@intel.com>
4 years agoraw/ifpga/base: support sensor
Tianfei Zhang [Thu, 14 Nov 2019 09:02:55 +0000 (17:02 +0800)]
raw/ifpga/base: support sensor

The sensor devices are connected in MAX10 FPGA. we used the
device tree to describe those sensor devices. Parse the device
tree to get the sensor devices and add them into a list.

Signed-off-by: Tianfei Zhang <tianfei.zhang@intel.com>
Signed-off-by: Andy Pei <andy.pei@intel.com>
4 years agoraw/ifpga/base: align send buffer for SPI
Tianfei Zhang [Thu, 14 Nov 2019 09:02:54 +0000 (17:02 +0800)]
raw/ifpga/base: align send buffer for SPI

The length of send buffer of SPI bus should be 4bytes align.

Signed-off-by: Tianfei Zhang <tianfei.zhang@intel.com>
Signed-off-by: Andy Pei <andy.pei@intel.com>
4 years agoraw/ifpga/base: support device tree
Tianfei Zhang [Thu, 14 Nov 2019 09:02:53 +0000 (17:02 +0800)]
raw/ifpga/base: support device tree

In PAC N3000 card, this is a BMC chip which using MAX10 FPGA
to manage the board configuration, like sensors, flash controller,
QSFP, powers. And this is a SPI bus connected between A10 FPGA and
MAX10, we can access the MAX10 registers over this SPI bus.

In BMC, there are about 19 sensors in MAX10 chip, including the FPGA
core temperature, Board temperature, board current, voltage and so on.

We use DTB (Device tree table) to describe it. This DTB file is store
in nor flash partition, which will flashed in Factory when the boards
delivery to customers. And the same time, the customers can easy to
customize the BMC configuration like change the sensors.

Add device tree support by using libfdt library in Linux distribution.
The end-user should pre-install the libfdt and libfdt-devel package
before use DPDK on PAC N3000 Card.

For Centos 7.x: sudo yum install libfdt libfdt-devel
For Ubuntu 18.04: sudo apt install libfdt-dev libfdt1

To eliminate build error, we currently do not compile raw/ifpga
and net/ipn3ke. User should install libfdt and libfdt-devel first,
modify config/common_linux, CONFIG_RTE_LIBRTE_PMD_IFPGA_RAWDEV=n
to CONFIG_RTE_LIBRTE_PMD_IFPGA_RAWDEV=y, modify config/common_base,
CONFIG_RTE_LIBRTE_IPN3KE_PMD=n to CONFIG_RTE_LIBRTE_IPN3KE_PMD=y.
Then this function can work.

Signed-off-by: Tianfei Zhang <tianfei.zhang@intel.com>
Signed-off-by: Andy Pei <andy.pei@intel.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
4 years agoraw/ifpga/base: expose SEU error
Tianfei Zhang [Thu, 14 Nov 2019 09:02:52 +0000 (17:02 +0800)]
raw/ifpga/base: expose SEU error

This patch exposes SEU error information to application then application
could compare this information (128bit) with its own SMH file to know
if this SEU is a fatal error or not.

Signed-off-by: Tianfei Zhang <tianfei.zhang@intel.com>
Signed-off-by: Andy Pei <andy.pei@intel.com>
4 years agoraw/ifpga/base: clear pending bit
Tianfei Zhang [Thu, 14 Nov 2019 09:02:51 +0000 (17:02 +0800)]
raw/ifpga/base: clear pending bit

Every defined bit in FME_ERROR0 is RW1C. Other reserved bits are always
0 when readout and it will plan to be RW1C if needed in future.
So it is safe just write the read back value to clear all the errors.

Signed-off-by: Tianfei Zhang <tianfei.zhang@intel.com>
Signed-off-by: Andy Pei <andy.pei@intel.com>
4 years agoraw/ifpga/base: support IRQ
Tianfei Zhang [Thu, 14 Nov 2019 09:02:50 +0000 (17:02 +0800)]
raw/ifpga/base: support IRQ

Add IRQ support for ifpga FME global error, port error and unit.
We implemented this feature by vfio interrupt mechanism.

To build this feature, CONFIG_RTE_EAL_VFIO should be enabled.

Signed-off-by: Tianfei Zhang <tianfei.zhang@intel.com>
Signed-off-by: Andy Pei <andy.pei@intel.com>
4 years agonet/i40e: support ipn3ke FPGA port bonding
Andy Pei [Thu, 14 Nov 2019 09:02:49 +0000 (17:02 +0800)]
net/i40e: support ipn3ke FPGA port bonding

In ipn3ke, each FPGA network side port bonding to an i40e pf,
each i40e pf link status should get data from FPGA network,
side port. This patch provide bonding relationship.

Signed-off-by: Rosen Xu <rosen.xu@intel.com>
Signed-off-by: Andy Pei <andy.pei@intel.com>
4 years agonet/mlx5: fix vport id in port id action
Viacheslav Ovsiienko [Thu, 14 Nov 2019 08:56:36 +0000 (08:56 +0000)]
net/mlx5: fix vport id in port id action

The kernel driver (starting from OFED 4.7.3.1.3) uses the upper half
of metadata register C0 to provide VHCA and vport id's. The mlx5 PMD
should check the actual mask of register C0 and shift the vport id
value for port actions appropriately.

Fixes: f07341e7aed3 ("net/mlx5: update source and destination vport translations")

Signed-off-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
Acked-by: Matan Azrad <matan@mellanox.com>
4 years agonet/mlx5: fix environment variable recovery
Viacheslav Ovsiienko [Wed, 13 Nov 2019 16:24:50 +0000 (16:24 +0000)]
net/mlx5: fix environment variable recovery

The state of environment variable MLX5_BF_SHUT_UP was not
recovered correctly if there was no tx_db_nc devarg specified.

Fixes: 8409a28573d3 ("net/mlx5: control transmit doorbell register mapping")
Cc: stable@dpdk.org
Signed-off-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
4 years agonet/ice: add SPDX tag
Yahui Cao [Thu, 14 Nov 2019 14:16:12 +0000 (22:16 +0800)]
net/ice: add SPDX tag

Fixes: 84dc7a95a2d3 ("net/ice: enable flow director engine")

Signed-off-by: Yahui Cao <yahui.cao@intel.com>
Acked-by: Xiaolong Ye <xiaolong.ye@intel.com>
4 years agonet/ice: ignore error when removing RSS rule
Qi Zhang [Thu, 14 Nov 2019 05:02:01 +0000 (13:02 +0800)]
net/ice: ignore error when removing RSS rule

Currently, multiple rte_flow RSS rules may map to the same
hardware rule if a later rule is just for input set change or
symm turn on/off. So after one of the rules be destroyed, we will
get error ICE_ERR_DOES_NOT_EXIST when destroying any other rules.
The patch simply fixes this by ignoring this error. A more
sophisticated fix that remember the sequence and replay properly
will be provided in the future.

Fixes: 5ad3db8d4bdd ("net/ice: enable advanced RSS")

Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
4 years agonet/ice: fix RSS flow destroy
Simei Su [Wed, 13 Nov 2019 02:03:29 +0000 (10:03 +0800)]
net/ice: fix RSS flow destroy

In ice_hash_create(), whatever the hash_function is, the
filter_ptr->symm is always 0 and when we destroy the flow, the
ice_rem_rss_cfg() is never carried out. So the destroy function never
works well. The patch fixes this issue and at the same time
distinguishes between simple_xor and symmetric_toeplitz.

To fix this issue, the patch adds a new structure to include a flag to
indicate if it is a simple_xor flow so that it's easier to remove the
config when destroying the flow. The patch also simplifies code
implementation logic in ice_hash_create().

Fixes: 5ad3db8d4bdd ("net/ice: enable advanced RSS")

Signed-off-by: Simei Su <simei.su@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
4 years agonet/bnxt: fix null dereference in Rx stop
Ajit Khaparde [Wed, 13 Nov 2019 08:29:45 +0000 (13:59 +0530)]
net/bnxt: fix null dereference in Rx stop

Null-checking "rxq" suggests that it may be null, but it has already
been dereferenced on all paths leading to the check.
Refactored the code to address this issue.

Coverity issue: 350594
Fixes: fc4bfea59696 ("net/bnxt: fix Rx queue start/stop for Thor based NICs")
Cc: stable@dpdk.org
Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Reviewed-by: Somnath Kotur <somnath.kotur@broadcom.com>
4 years agonet/bnxt: fix log message level
Venkat Duvvuru [Wed, 13 Nov 2019 08:29:44 +0000 (13:59 +0530)]
net/bnxt: fix log message level

When an existing mac_addr is tried to get programmed again, a
message is displayed that the mac_addr already exists.
However the message is of type ERR. This patch changes the message
to type DEBUG

Fixes: 938a87db4324 ("net/bnxt: fix redundant MAC address check")
Cc: stable@dpdk.org
Signed-off-by: Venkat Duvvuru <venkatkumar.duvvuru@broadcom.com>
Reviewed-by: Somnath Kotur <somnath.kotur@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
4 years agonet/bnxt: fix crash in xstats get
Ajit Khaparde [Wed, 13 Nov 2019 08:29:43 +0000 (13:59 +0530)]
net/bnxt: fix crash in xstats get

We would hit a segfault in bnxt_dev_xstats_get_op() if xstats argument
is NULL, Check if the argument is NULL and return appropriately.

Fixes: bfb9c2260be2 ("net/bnxt: support xstats get/reset")
Cc: stable@dpdk.org
Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Reviewed-by: Andy Gospodarek <gospo@broadcom.com>
4 years agonet/bnxt: fix flow creation with non-consecutive group ids
Rahul Gupta [Wed, 13 Nov 2019 08:29:42 +0000 (13:59 +0530)]
net/bnxt: fix flow creation with non-consecutive group ids

In non-RSS mode, vnics map 1:1 with Rx queues during init. This can
create problems if non-consecutive group IDs are given as part of
subsequent flow create cmds as they can end up pointing to Rx queues
(mapped during init) that are different than the intended destination
queue as specified in the flow create cmd.
To fix this, now that we have the ability to dynamically create
vnics, do not create any additional vnics other than the default vnic
during init. Allocate them only during flow/filter creation time.

When RSS is disabled we need to use the COS queue count queried
from firmware.

Fixes: 36024b2e7fe5 ("net/bnxt: allow dynamic creation of VNIC")

Signed-off-by: Rahul Gupta <rahul.gupta@broadcom.com>
Reviewed-by: Somnath Kotur <somnath.kotur@broadcom.com>
4 years agonet/bnxt: limit queue count for NS3/Stingray devices
Somnath Kotur [Wed, 13 Nov 2019 08:29:41 +0000 (13:59 +0530)]
net/bnxt: limit queue count for NS3/Stingray devices

Cap max queue count to 128 for NS3 devices and ensure that same count
is reported as part of dev_info_get_op as well

Signed-off-by: Somnath Kotur <somnath.kotur@broadcom.com>
Reviewed-by: Rahul Gupta <rahul.gupta@broadcom.com>
4 years agonet/bnxt: add checks for firmware reset
Kalesh AP [Wed, 13 Nov 2019 08:29:40 +0000 (13:59 +0530)]
net/bnxt: add checks for firmware reset

Driver should fail the eth_dev_ops callbacks and accessing
Tx and Rx queues when device is in reset or in error state.
Added missing checks for fw reset in few routines.

Fixes: be14720def9c ("net/bnxt: support FW reset")

Reviewed-by: Santoshkumar Karanappa Rastapur <santosh.rastapur@broadcom.com>
Signed-off-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
4 years agonet/mlx5: fix layer bits to be unique
Xiaoyu Min [Wed, 13 Nov 2019 09:29:59 +0000 (11:29 +0200)]
net/mlx5: fix layer bits to be unique

The layer bits should be unique otherwise layer info will be
interpreted wrongly.

Fixes: 70d84dc797b7 ("net/mlx5: add internal tag item and action")
Fixes: 55deee1715f0 ("net/mlx5: extend flow mark support")

Signed-off-by: Xiaoyu Min <jackmin@mellanox.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
4 years agonet/mlx5: fix verbs flow counter query
Dekel Peled [Tue, 12 Nov 2019 14:19:20 +0000 (16:19 +0200)]
net/mlx5: fix verbs flow counter query

Function flow_verbs_counter_query() was recently modified.
The new 'if' condition uses a pointer to flow counter-set.
This pointer is valid only if flow contains a count action.

This patch adds check to verify the pointer is valid.

Fixes: d85c7b5ea59f ("net/mlx5: split hairpin flows")

Signed-off-by: Dekel Peled <dekelp@mellanox.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
4 years agonet/mlx5: fix getting Rx queue type
Dekel Peled [Mon, 11 Nov 2019 14:32:46 +0000 (16:32 +0200)]
net/mlx5: fix getting Rx queue type

Function mlx5_rxq_get_type() uses the input queue index, without
checking it, as index to the Rx queues array.
If this value is too high, it will result in pointer to memory out
of Rx queues array bounds.

This patch adds check of the input queue index, to verify it is valid.

Fixes: d85c7b5ea59f ("net/mlx5: split hairpin flows")

Signed-off-by: Dekel Peled <dekelp@mellanox.com>
Acked-by: Matan Azrad <matan@mellanox.com>
4 years agonet/mlx5: fix suffix flow creation in metadata split
Viacheslav Ovsiienko [Wed, 13 Nov 2019 08:27:45 +0000 (08:27 +0000)]
net/mlx5: fix suffix flow creation in metadata split

The variable cleanup was erroneously done before pointer usage.
The cleanup is moved to appropriate place, comment is clarified.

Fixes: 8d72fa668964 ("net/mlx5: share tag between meter and metadata")

Reported-by: Eli Britstein <elibr@mellanox.com>
Signed-off-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
Acked-by: Matan Azrad <matan@mellanox.com>
4 years agonet/mlx5: revert default rules amount optimization
Matan Azrad [Tue, 12 Nov 2019 22:00:10 +0000 (22:00 +0000)]
net/mlx5: revert default rules amount optimization

This reverts commit 304ffe576f239e5405228c0feec04b6138d525b7.

It tried to optimize the amount of the default flow
rules and created it only once on top of the PF representor.

For each FDB rule, the default port ID to match on is like of the port
that triggers the flow.

Hence, the single default rule will not be matched on the VF traffic.

As a result, all the traffic of the VFs will not match to the jump flow
in the root table and will always be forwarded to the representor port.

Revert the commit.

Fixes: 304ffe576f23 ("net/mlx5: fix condition to create default rule")

Signed-off-by: Matan Azrad <matan@mellanox.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
4 years agonet/ice: fix wild pointer
Shougang Wang [Wed, 13 Nov 2019 01:37:58 +0000 (01:37 +0000)]
net/ice: fix wild pointer

To avoid wild pointer, pointers should be set to NULL after free them.

Fixes: 1a2fc1799f09 ("net/ice: reject duplicated flow for flow director")
Fixes: 84dc7a95a2d3 ("net/ice: enable flow director engine")
Fixes: 0f880c3df192 ("net/ice: add flow director counter resource init/release")

Signed-off-by: Shougang Wang <shougangx.wang@intel.com>
Acked-by: Qiming Yang <qiming.yang@intel.com>
Acked-by: Xiaolong Ye <xiaolong.ye@intel.com>
4 years agonet/ice: fix flow director counter resource release
Shougang Wang [Wed, 13 Nov 2019 01:37:57 +0000 (01:37 +0000)]
net/ice: fix flow director counter resource release

All the counter resources should be cleaned up when teardown.

Fixes: 0f880c3df192 ("net/ice: add flow director counter resource init/release")

Signed-off-by: Shougang Wang <shougangx.wang@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Xiaolong Ye <xiaolong.ye@intel.com>
4 years agonet/ice: fix flow director profile removal
Shougang Wang [Wed, 13 Nov 2019 01:37:56 +0000 (01:37 +0000)]
net/ice: fix flow director profile removal

The removal of FDIR profile should start from the next
of ICE_FLTR_PTYPE_NONF_NONE.

Fixes: 109e8e06249e ("net/ice: configure HW flow director rule")

Signed-off-by: Shougang Wang <shougangx.wang@intel.com>
Acked-by: Qiming Yang <qiming.yang@intel.com>
Acked-by: Xiaolong Ye <xiaolong.ye@intel.com>
4 years agonet/ice: fix memzone reserve and release in flow director
Shougang Wang [Wed, 13 Nov 2019 01:37:55 +0000 (01:37 +0000)]
net/ice: fix memzone reserve and release in flow director

To avoid memzone reserve failure and memory leak, following
resources management should be added.
- Check if the FDIR Memzone already exists before reserving.
- Free FDIR memzone when teardown and other failure scenarios.

Fixes: 84dc7a95a2d3 ("net/ice: enable flow director engine")

Signed-off-by: Shougang Wang <shougangx.wang@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Xiaolong Ye <xiaolong.ye@intel.com>
4 years agonet/ice/base: fix switch programming for IPv6
Wei Zhao [Tue, 12 Nov 2019 03:21:55 +0000 (11:21 +0800)]
net/ice/base: fix switch programming for IPv6

Correct an error in the IPV6 header bitmask used for programming switch
rules.

Also, change other programming switch headers to use big endian
fields in order to make setting these easier.

Fixes: 04b8ec1ea807 ("net/ice/base: add protocol structures and defines")
Cc: stable@dpdk.org
Signed-off-by: Dan Nowlin <dan.nowlin@intel.com>
Signed-off-by: Wei Zhao <wei.zhao1@intel.com>
Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Xiaolong Ye <xiaolong.ye@intel.com>
4 years agonet/i40e: fix clang build with 16B descriptors
Bruce Richardson [Tue, 12 Nov 2019 13:40:23 +0000 (13:40 +0000)]
net/i40e: fix clang build with 16B descriptors

When compiling with 16B descriptor support enabled, clang compiles gave
an error, complaining that the final parameter of _mm256_blend_epi32()
had to be an immediate value (i.e. compile-time constant):

 i40e_rxtx_vec_avx2.c:561:21: error: argument to
'__builtin_ia32_pblendd256' must be a constant integer
   __m256i tmp0_1 = _mm256_blend_epi32(fdir_zero_mask,
                    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

While it appears that GCC was able to convert the constant variable
value "fdir_blend_mask" into the blend call, clang was not doing so. To
guarantee the use of an immediate we convert the variable value to a
"#define".

Fixes: 7d087a0a8b8e ("net/i40e: support flow director on AVX Rx")

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Xiaolong Ye <xiaolong.ye@intel.com>
4 years agonet/iavf: fix Tx checksum offload in AVX path
Leyi Rong [Tue, 12 Nov 2019 02:42:06 +0000 (10:42 +0800)]
net/iavf: fix Tx checksum offload in AVX path

Fix iavf vf_checksum_sw case fail in X710/XXV710, set bit2 to 1
of CMD field in Tx descriptor of AVX Tx path according to Spec.

Fixes: af0c246a3800 ("net/iavf: enable AVX2 for iavf")

Signed-off-by: Leyi Rong <leyi.rong@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
4 years agonet/ice/base: fix TCAM entry management
Qi Zhang [Tue, 12 Nov 2019 13:45:57 +0000 (21:45 +0800)]
net/ice/base: fix TCAM entry management

Order intermediate VSIG list correct in order to correctly match
existing VSIG lists.

When overriding pre-existing TCAM entries, properly delete the existing
entry and remove it from the change/update list.

Fixes: 51d04e4933e3 ("net/ice/base: add flexible pipeline module")

Signed-off-by: Dan Nowlin <dan.nowlin@intel.com>
Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Tested-by: Zhirun Yan <zhirun.yan@intel.com>
4 years agonet/i40e: fix hotplug remove
Chenxu Di [Tue, 12 Nov 2019 05:56:06 +0000 (05:56 +0000)]
net/i40e: fix hotplug remove

testpmd will occur infinite loops when device hotplug remove.
We can fix the issue by using the pci generic remove function

Fixes: ac89d46096d5 ("net/i40e: release port upon close")

Signed-off-by: Chenxu Di <chenxux.di@intel.com>
Acked-by: Xiaolong Ye <xiaolong.ye@intel.com>
4 years agonet/ixgbe: fix hotplug remove
Chenxu Di [Tue, 12 Nov 2019 06:00:14 +0000 (06:00 +0000)]
net/ixgbe: fix hotplug remove

testpmd will occur infinite loops when device hotplug remove.
We can fix the issue by using the pci generic remove function

Fixes: f2f4990eff94 ("net/ixgbe: release port upon close")

Signed-off-by: Chenxu Di <chenxux.di@intel.com>
Acked-by: Xiaolong Ye <xiaolong.ye@intel.com>
4 years agonet/ice: fix crash with wrong package
Simei Su [Thu, 7 Nov 2019 05:47:03 +0000 (13:47 +0800)]
net/ice: fix crash with wrong package

This patch fixes core dump issue when entering safe mode with a
wrong ice.pkg. In safe mode, rte_flow is not supported and it
won't initialize any flow engine.

Fixes: 7615a6895009 ("net/ice: rework for generic flow enabling")

Signed-off-by: Simei Su <simei.su@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
4 years agonet/ice: fix link status recovery
Qiming Yang [Mon, 11 Nov 2019 03:24:24 +0000 (11:24 +0800)]
net/ice: fix link status recovery

This patch fixes a kernel driver link status issue by recovering
link status when device stops.

Fixes: e6161345d8a9 ("net/ice: support link status change")
Cc: stable@dpdk.org
Signed-off-by: Qiming Yang <qiming.yang@intel.com>
Acked-by: Xiaolong Ye <xiaolong.ye@intel.com>
4 years agonet/ice: fix RSS rule destroy
Simei Su [Mon, 11 Nov 2019 07:55:27 +0000 (15:55 +0800)]
net/ice: fix RSS rule destroy

This patch changes RSS rule destroy interface from ice_rem_vsi_rss_cfg()
to ice_rem_rss_cfg(). To coordinate with input set change, it should
destroy a specific flow rule but not all vsi cfg.

Fixes: 5ad3db8d4bdd ("net/ice: enable advanced RSS")

Signed-off-by: Simei Su <simei.su@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
4 years agonet/mlx5: fix check of RSS queue index
Dekel Peled [Mon, 11 Nov 2019 14:32:31 +0000 (16:32 +0200)]
net/mlx5: fix check of RSS queue index

RSS action validation function checks the queues included in RSS
to make sure they are valid.
A Queue is considered valid if the pointer to the queue (item at
location queue-index of RxQ array) is not a null value.
The queue indices are not checked. If a large value is entered as
queue index, using it as an index in RxQ array will result in a
pointer to memory out of array bounds. If this memory contains a
value which is not null, this queue will be wrongly considered valid.

This patch updates function mlx5_flow_validate_action_rss() with
check of the input queue indices, as done in function
mlx5_flow_validate_action_queue().

Fixes: 23c1d42c7138 ("net/mlx5: split flow validation to dedicated function")
Cc: stable@dpdk.org
Signed-off-by: Dekel Peled <dekelp@mellanox.com>
Acked-by: Matan Azrad <matan@mellanox.com>
4 years agonet/mlx5: fix query host adapter attributes
Viacheslav Ovsiienko [Tue, 12 Nov 2019 08:53:58 +0000 (08:53 +0000)]
net/mlx5: fix query host adapter attributes

Host adapter attributes are queried from kernel via multiple
DevX calls. The retrieved data were erroneously overwritten,
the order of querying is fixed.

Fixes: 6bc327b94fe8 ("net/mlx5: fill meter capabilities using DevX")

Signed-off-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
Acked-by: Matan Azrad <matan@mellanox.com>
4 years agocrypto/openssl: support in-place scatter gather
Akhil Goyal [Wed, 20 Nov 2019 05:58:45 +0000 (11:28 +0530)]
crypto/openssl: support in-place scatter gather

As per current support, Scatter Gather is only supported
for out of place input and output buffers.
This patch add support for Scatter Gather for in-place buffers.

Signed-off-by: Akhil Goyal <akhil.goyal@nxp.com>
Acked-by: Anoob Joseph <anoobj@marvell.com>
4 years agoexamples/fips_validation: fix auth verify
Fan Zhang [Wed, 6 Nov 2019 10:54:25 +0000 (10:54 +0000)]
examples/fips_validation: fix auth verify

Fixes: f64adb6714e0 ("examples/fips_validation: support HMAC parsing")
Cc: stable@dpdk.org
This patch fixes the incorrect mbuf write and digest memory leak in
fips_validation authentication verify.

Signed-off-by: Fan Zhang <roy.fan.zhang@intel.com>
Acked-by: Marko Kovacevic <marko.kovacevic@intel.com>
4 years agoapp/crypto-perf: support PDCP
Akhil Goyal [Fri, 8 Nov 2019 10:46:10 +0000 (16:16 +0530)]
app/crypto-perf: support PDCP

test-crypto-perf app is updated to calculate PDCP
throughput numbers.

2 new params are added for PDCP
--pdcp-sn-sz <5/7/12/15/18>
--pdcp-domain <control/user>

./dpdk-test-crypto-perf --master-lcore 0 -l 0,1 --log-level=8 --
--devtype crypto_dpaa2_sec --optype pdcp --cipher-algo aes-ctr
--cipher-op encrypt --auth-algo null --auth-op generate  --auth-key-sz
16 --ptest throughput --total-ops 100000 --burst-sz 64 --buffer-sz
64,390,1512  --pool-sz 4096 --silent --pdcp-sn-sz 12 --pdcp-domain
control

Signed-off-by: Manish Tomar <manish.tomar@nxp.com>
Signed-off-by: Akhil Goyal <akhil.goyal@nxp.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
4 years agodoc: update release notes for AESNI PMDs
Pablo de Lara [Thu, 14 Nov 2019 12:21:04 +0000 (12:21 +0000)]
doc: update release notes for AESNI PMDs

AESNI MB and AESNI GCM PMDs were updated to support
latest IPSec Multi buffer library (v0.53), and the user guide
of hose drivers were updated but not release notes.

Fixes: 4b701523742e ("crypto/aesni_gcm: support in-place chained mbufs")
Fixes: d91dc5835656 ("doc: support IPsec Multi-buffer lib v0.53")

Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
4 years agoexamples/ipsec-segw: add SPDX license tag
Stephen Hemminger [Fri, 8 Nov 2019 17:06:14 +0000 (09:06 -0800)]
examples/ipsec-segw: add SPDX license tag

Add missing BSD license tag to IPsec examples.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
4 years agoexamples/ipsec-secgw: fix default configuration
Lukasz Bartosik [Wed, 6 Nov 2019 15:48:14 +0000 (16:48 +0100)]
examples/ipsec-secgw: fix default configuration

Update default configuration of ipsec-secgw:
1.In ep0.cfg change SPI value used by two inbound IPv6 security
policies from 15 to 115 and 16 to 116 to point to existing inbound
SAs. There are no inbound SAs with SPI value 15, 16.
- In ep1.cfg change SPI value used by two outbound IPv6 security
policies from 15 to 115 and 16 to 116 to point to existing outbound
SAs. There are no outbound SAs with SPI value 15, 16. Add missing
priority parameter in two inbound IPv4 security policies.

Fixes: 60a94afefc84 ("examples/ipsec-secgw: add sample configuration files")
Cc: stable@dpdk.org
Signed-off-by: Lukasz Bartosik <lbartosik@marvell.com>
Acked-by: Anoob Joseph <anoobj@marvell.com>
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
4 years agomalloc: fix realloc padded element size
Xueming Li [Tue, 12 Nov 2019 14:50:28 +0000 (14:50 +0000)]
malloc: fix realloc padded element size

When resize a memory with next element, the original element size grows.
If the orginal element has padding, the real inner element size didn't
grow as well and this causes trailer verification failure when malloc
debug enabled.

Fixes: af75078fece3 ("first public release")
Cc: stable@dpdk.org
Signed-off-by: Xueming Li <xuemingl@mellanox.com>
Reviewed-by: Anatoly Burakov <anatoly.burakov@intel.com>