dpdk.git
4 years agoethdev: allow multiple security sessions to use flow rule
Anoob Joseph [Sun, 8 Dec 2019 10:41:23 +0000 (16:11 +0530)]
ethdev: allow multiple security sessions to use flow rule

The rte_security API which enables inline protocol/crypto feature
mandates that for every security session an rte_flow is created. This
would internally translate to a rule in the hardware which would do
packet classification.

In rte_security, one SA would be one security session. And if an rte_flow
need to be created for every session, the number of SAs supported by an
inline implementation would be limited by the number of rte_flows the
PMD would be able to support.

If the fields SPI & IP addresses are allowed to be a range, then this
limitation can be overcome. Multiple flows will be able to use one rule
for SECURITY processing. In this case, the security session provided as
conf would be NULL.

Application should do an rte_flow_validate() to make sure the flow is
supported on the PMD.

Signed-off-by: Anoob Joseph <anoobj@marvell.com>
Reviewed-by: Jerin Jacob <jerinj@marvell.com>
Acked-by: Ori Kam <orika@mellanox.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
Acked-by: Vladimir Medvedkin <vladimir.medvedkin@intel.com>
4 years agoraw/octeontx2_ep: fix shared library
Thomas Monjalon [Mon, 20 Jan 2020 10:58:54 +0000 (11:58 +0100)]
raw/octeontx2_ep: fix shared library

The version of the PMD should not be overwritten with LIBABIVER.
All internal libs must have the same version.

Moreover, specifying LIBABIVER in the driver causes a symbolic link loop:
librte_rawdev_octeontx2_ep.so.1 -> librte_rawdev_octeontx2_ep.so.1

Fixes: 56d46d13f736 ("raw/octeontx2_ep: add build infra and device probe")

Reported-by: Ferruh Yigit <ferruh.yigit@intel.com>
Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Tested-by: Ferruh Yigit <ferruh.yigit@intel.com>
4 years agoexamples/ntb: fix mempool ops setting
Xiaoyun Li [Wed, 25 Dec 2019 09:09:42 +0000 (17:09 +0800)]
examples/ntb: fix mempool ops setting

Mempool ops may register in different order when compiling. The default
ops index is always zero but the wanted ops is ring_mp_mc. This patch
sets best mempool ops before generating mbuf pool to fix this issue.

Fixes: 5194299d6ef5 ("examples/ntb: support more functions")
Cc: stable@dpdk.org
Signed-off-by: Xiaoyun Li <xiaoyun.li@intel.com>
4 years agodoc: fix igb_uio parameter in ntb guide
Xiaoyun Li [Wed, 4 Dec 2019 15:19:31 +0000 (23:19 +0800)]
doc: fix igb_uio parameter in ntb guide

In prerequisites of ntb guide, the correct flag when loading igb_uio
module should be `wc_activate=1`, not `wc_active=1`.

Fixes: 11b5c7daf019 ("raw/ntb: add enqueue and dequeue functions")
Cc: stable@dpdk.org
Signed-off-by: Xiaoyun Li <xiaoyun.li@intel.com>
Acked-by: Jingjing Wu <jingjing.wu@intel.com>
4 years agoraw/ntb: fix write memory barrier
Xiaoyun Li [Wed, 4 Dec 2019 15:19:16 +0000 (23:19 +0800)]
raw/ntb: fix write memory barrier

All buffers and ring info should be written before tail register update.
This patch relocates the write memory barrier before updating tail register
to avoid potential issues.

Fixes: 11b5c7daf019 ("raw/ntb: add enqueue and dequeue functions")
Cc: stable@dpdk.org
Signed-off-by: Xiaoyun Li <xiaoyun.li@intel.com>
Reviewed-by: Gavin Hu <gavin.hu@arm.com>
Acked-by: Jingjing Wu <jingjing.wu@intel.com>
4 years agoraw/octeontx2_ep: add driver self test
Mahipal Challa [Mon, 13 Jan 2020 06:00:41 +0000 (11:30 +0530)]
raw/octeontx2_ep: add driver self test

Add rawdev's selftest feature in SDP VF driver, which
verifies the EP mode functionality test.

Signed-off-by: Mahipal Challa <mchalla@marvell.com>
Reviewed-by: Gavin Hu <gavin.hu@arm.com>
4 years agoraw/octeontx2_ep: add dequeue operation
Mahipal Challa [Mon, 13 Jan 2020 06:00:40 +0000 (11:30 +0530)]
raw/octeontx2_ep: add dequeue operation

Add rawdev dequeue operation for SDP VF devices.

Signed-off-by: Mahipal Challa <mchalla@marvell.com>
Reviewed-by: Gavin Hu <gavin.hu@arm.com>
4 years agoraw/octeontx2_ep: add enqueue operation
Mahipal Challa [Mon, 13 Jan 2020 06:00:39 +0000 (11:30 +0530)]
raw/octeontx2_ep: add enqueue operation

Add rawdev enqueue operation for SDP VF devices.

Signed-off-by: Mahipal Challa <mchalla@marvell.com>
Reviewed-by: Gavin Hu <gavin.hu@arm.com>
4 years agoraw/octeontx2_ep: add device uninitialization
Mahipal Challa [Mon, 13 Jan 2020 06:00:38 +0000 (11:30 +0530)]
raw/octeontx2_ep: add device uninitialization

Add rawdev close/uninitialize operation for SDP
VF devices.

Signed-off-by: Mahipal Challa <mchalla@marvell.com>
Reviewed-by: Gavin Hu <gavin.hu@arm.com>
4 years agoraw/octeontx2_ep: add device configuration
Mahipal Challa [Mon, 13 Jan 2020 06:00:37 +0000 (11:30 +0530)]
raw/octeontx2_ep: add device configuration

Register "dev_configure" API to configure/initialize the SDP
VF PCIe devices.

Signed-off-by: Mahipal Challa <mchalla@marvell.com>
Reviewed-by: Gavin Hu <gavin.hu@arm.com>
4 years agoraw/octeontx2_ep: add build infra and device probe
Mahipal Challa [Mon, 13 Jan 2020 06:00:36 +0000 (11:30 +0530)]
raw/octeontx2_ep: add build infra and device probe

Add the OCTEON TX2 SDP EP device probe along with the
build infrastructure for Make and meson builds.

Signed-off-by: Mahipal Challa <mchalla@marvell.com>
Reviewed-by: Gavin Hu <gavin.hu@arm.com>
4 years agotimer: add API to query ticks until the next timer
Stephen Hemminger [Tue, 17 Dec 2019 00:55:03 +0000 (16:55 -0800)]
timer: add API to query ticks until the next timer

It is useful to know when the next timer will expire when
using rte_epoll_wait (or sleep when idle). This experimental
API provides a hook to query the number of ticks remaining.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Erik Gabriel Carrillo <erik.g.carrillo@intel.com>
4 years agolatency: fix calculation for multi-thread
Reshma Pattan [Thu, 5 Dec 2019 17:18:11 +0000 (17:18 +0000)]
latency: fix calculation for multi-thread

Make latency calculation multithread safe by
using spinlock.

Fixes: 5cd3cac9ed ("latency: added new library for latency stats")
Cc: stable@dpdk.org
Signed-off-by: Reshma Pattan <reshma.pattan@intel.com>
4 years agohash: add max key id query API
Kumar Amber [Tue, 26 Nov 2019 02:39:13 +0000 (02:39 +0000)]
hash: add max key id query API

Adding new API function to query the maximum key ID
that could possibly be returned by rte_hash_add_key and
rte_hash_add_key_with_hash. When RTE_HASH_EXTRA_FLAGS_MULTI_WRITER_ADD
is set, the maximum key id is larger than the entry count specified
by the user.

Signed-off-by: Kumar Amber <kumar.amber@intel.com>
Acked-by: Yipeng Wang <yipeng1.wang@intel.com>
4 years agohash: remove unnecessary locks in lock-free
Dharmik Thakkar [Thu, 21 Nov 2019 18:17:59 +0000 (12:17 -0600)]
hash: remove unnecessary locks in lock-free

Remove __hash_rw_reader_unlock() calls from lock free hash lookup

Signed-off-by: Dharmik Thakkar <dharmik.thakkar@arm.com>
Reviewed-by: Gavin Hu <gavin.hu@arm.com>
Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
Acked-by: Yipeng Wang <yipeng1.wang@intel.com>
4 years agocfgfile: fix symbols map
Liron Himi [Tue, 17 Dec 2019 11:52:03 +0000 (13:52 +0200)]
cfgfile: fix symbols map

rte_cfgfile_section_num_entries_by_index was missing from the map file.

meson build failed when calling this function,
due to linking a binary to cfgfile built as a shared library.

Fixes: 3d2e0448ebb5 ("cfgfile: add section number of entries by index")
Cc: stable@dpdk.org
Signed-off-by: Liron Himi <lironh@marvell.com>
Acked-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
4 years agokni: rename variable with namespace prefix
Stephen Hemminger [Sat, 21 Dec 2019 01:02:14 +0000 (17:02 -0800)]
kni: rename variable with namespace prefix

All global variables in kernel should be prefixed by the same
to avoid any symbol conflics. Rename dflt_carrier to kni_default_carrier.

Fixes: 89397a01ce4a ("kni: set default carrier state of interface")
Cc: stable@dpdk.org
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Ferruh Yigit <ferruh.yigit@intel.com>
4 years agoeal/linux: fix build when VFIO is disabled
Ali Alnubani [Wed, 11 Dec 2019 18:25:59 +0000 (18:25 +0000)]
eal/linux: fix build when VFIO is disabled

The header linux/version.h isn't included when CONFIG_RTE_EAL_VFIO
is explicitly disabled. LINUX_VERSION_CODE and KERNEL_VERSION are
therefore undefined, causing the build failure:

  lib/librte_eal/linux/eal/eal.c: In function ‘rte_eal_init’:
  lib/librte_eal/linux/eal/eal.c:1076:32: error: "LINUX_VERSION_CODE" is
    not defined, evaluates to 0 [-Werror=undef]

Fixes: a0dede62a537 ("eal/linux: remove KNI restriction on IOVA")
Cc: stable@dpdk.org
Signed-off-by: Ali Alnubani <alialnu@mellanox.com>
4 years agomk: avoid combining -r and -export-dynamic linker options
Rafael Ávila de Espíndola [Thu, 12 Dec 2019 17:53:12 +0000 (09:53 -0800)]
mk: avoid combining -r and -export-dynamic linker options

Running ld with -r switches the linker to a very special mode where
some other linker options don't make sense.

In particular, -export-dynamic normally requires that all global
symbols be included in the dynamic symbol table, but a .o file doesn't
even have a dynamic symbol table.

When given both options it looks like the gnu linker just ignores
-export-dynamic.

Unfortunately some versions of lld (https://lld.llvm.org/) have a bug
that causes it to try to create a dynamic symbol table in the output
.o file and ends up corrupting it
(https://bugs.llvm.org/show_bug.cgi?id=43552). Current (git) version
of lld now issues an error.

This patch filters out -export-dynamic from $(LDFLAGS) when using
-r. With this patch I can build dpdk with lld.

Fixes: 3d781ca32874 ("mk: do post processing on objects that register a driver")
Cc: stable@dpdk.org
Signed-off-by: Rafael Ávila de Espíndola <espindola@scylladb.com>
4 years agodoc: add flow dump to mlx5 guide
Xueming Li [Fri, 17 Jan 2020 11:56:03 +0000 (13:56 +0200)]
doc: add flow dump to mlx5 guide

Guide of mlx5 is updated on how to dump HW flows.

Signed-off-by: Xueming Li <xuemingl@mellanox.com>
Signed-off-by: Xiaoyu Min <jackmin@mellanox.com>
4 years agonet/mlx5: add socket server for external tools
Xueming Li [Fri, 17 Jan 2020 11:56:02 +0000 (13:56 +0200)]
net/mlx5: add socket server for external tools

Add pmd unix socket server to enable external tool applications to
trigger flow dump.

Socket path:
/var/tmp/dpdk_mlx5_<pid>
Socket format:
io_raw: port_id of uint16
file: file descriptor of int

Signed-off-by: Xueming Li <xuemingl@mellanox.com>
Signed-off-by: Xiaoyu Min <jackmin@mellanox.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
4 years agoapp/testpmd: add flow dump command
Xueming Li [Fri, 17 Jan 2020 11:56:01 +0000 (13:56 +0200)]
app/testpmd: add flow dump command

New flow dump CLI to dump device internal representation information
of flows into screen.

Signed-off-by: Xueming Li <xuemingl@mellanox.com>
Signed-off-by: Xiaoyu Min <jackmin@mellanox.com>
Acked-by: Ori Kam <orika@mellanox.com>
4 years agonet/mlx5: support flow dump API
Xiaoyu Min [Fri, 17 Jan 2020 11:56:00 +0000 (13:56 +0200)]
net/mlx5: support flow dump API

Dump fdb/nic_rx/nic_tx raw flow data into specified file.

Signed-off-by: Xueming Li <xuemingl@mellanox.com>
Signed-off-by: Xiaoyu Min <jackmin@mellanox.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
4 years agoethdev: add API to dump device internal flow info
Xiaoyu Min [Fri, 17 Jan 2020 11:55:59 +0000 (13:55 +0200)]
ethdev: add API to dump device internal flow info

Introduce an API which dump the device's internal representation
information of rte flows in hardware.

Signed-off-by: Xiaoyu Min <jackmin@mellanox.com>
Acked-by: Ori Kam <orika@mellanox.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
4 years agoethdev: fix secondary process memory overwrite
Fang TongHao [Fri, 17 Jan 2020 02:08:04 +0000 (10:08 +0800)]
ethdev: fix secondary process memory overwrite

Avoid overwriting device flags and other information in device
data stored in shared memory when a secondary process
probes PCI device.

Fixes: 494adb7f63f2 ("ethdev: add device fields from PCI layer")
Cc: stable@dpdk.org
Signed-off-by: Fang TongHao <fangtonghao@sangfor.com.cn>
Reviewed-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
4 years agonet/mlx5: fix metadata item endianness conversion
Viacheslav Ovsiienko [Fri, 17 Jan 2020 14:59:32 +0000 (14:59 +0000)]
net/mlx5: fix metadata item endianness conversion

The mlx5 datapath does not implement any endianness conversions
for the metadata being sent and received to provide the better
performance (because these conversions would be performed for
each packet). These metadata are also involved into flow processing
(there might be some flows matching on metadata patterns or setting
the new metadata values) inside the NIC. It order to configure
hardware in correct way all necessary endianness conversions are
done by rte_flow handling code (only once on flow creation). This
patch fixes one of these conversions for the little-endian hosts
in case if META/MARK items are less than 32 bits.

Fixes: acfcd5c52f94 ("net/mlx5: update meta register matcher set")
Cc: stable@dpdk.org
Signed-off-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
Acked-by: Matan Azrad <matan@mellanox.com>
4 years agonet/mlx5: fix matcher field usage for metadata entities
Viacheslav Ovsiienko [Fri, 17 Jan 2020 11:16:06 +0000 (11:16 +0000)]
net/mlx5: fix matcher field usage for metadata entities

Matcher is flow table related structure providing the flow pattern
to be translated directly in hardware controlling data. This structure
includes the metadata register c0 field, that might be engaged to
support META and MARK related flow items and actions. Also, this
register might be used by kernel to specify the source vport index.
In this case (if kernel uses the field) the register c0 is split
into two 16-bit subfields - one for META/MARK items and another
to handle vport.

The actual configuration is queried by PMD from kernel in runtime
and depending on the mask returned by kernel the PMD can use upper
or lower half of register c0 field. This patch adds the missing
support for upper half. This missed support caused the non-operational
META/MARK items on some kernel configurations.

Fixes: e554b672aa05 ("net/mlx5: support flow tag")
Cc: stable@dpdk.org
Signed-off-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
Acked-by: Matan Azrad <matan@mellanox.com>
4 years agonet/mlx5: fix shared metadata matcher field setup
Viacheslav Ovsiienko [Fri, 17 Jan 2020 11:01:34 +0000 (11:01 +0000)]
net/mlx5: fix shared metadata matcher field setup

Matcher is flow table related structure providing the flow pattern
to be translated directly in hardware controlling data. Some fields
in this structure might be split (by software) between multiple items.

For example, the metadata register c0 field in the matcher might be
split into two independent subfields - the source vport index and
META item value. These subfields have no permanent assigned masks,
the actual configuration is queried from the kernel drivers in
runtime. To handle source vport value (the port of e-Switch which
is origin of the packet) the kernel might use the dedicated vport
field in the matcher or the part of register c0 field, depending
on configuration.

To setup the matcher structure fields the macro MLX5_SET is used.
MLX5_SET configures the specified 32-bit field as whole entity.
For metadata register c0 we should take into account the provided
mask in order to configure the specified subfield bits only,
otherwise setting vport overrides the META values and vice versa.

Fixes: acfcd5c52f94 ("net/mlx5: update meta register matcher set")
Cc: stable@dpdk.org
Signed-off-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
Acked-by: Matan Azrad <matan@mellanox.com>
4 years agoethdev: fix VLAN offloads set if no driver callback
Wei Hu (Xavier) [Fri, 17 Jan 2020 11:49:14 +0000 (19:49 +0800)]
ethdev: fix VLAN offloads set if no driver callback

Currently, there is a potential problem that changing the content of
dev->data->dev_conf.rxmode.offloads even when there is no
vlan_offload_set driver callback.

It is a good idea that prevent the side effect and make the API return
success if no change requested. This patch fixes the problem, the detail
information as below:
 - keep possibility to do dummy set even if there is no driver callback
 - do not touch Rx mode offloads in device data before checking the
   driver callback availability
 - ensure that Rx mode offloads are rolled back correctly if driver
   callback returns error

Fixes: 81f9db8ecc2c ("ethdev: add vlan offload support")
Cc: stable@dpdk.org
Signed-off-by: Wei Hu (Xavier) <xavier.huwei@huawei.com>
Signed-off-by: Chunsong Feng <fengchunsong@huawei.com>
Signed-off-by: Min Wang (Jushui) <wangmin3@huawei.com>
Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
Reviewed-by: Andrew Rybchenko <arybchenko@solarflare.com>
4 years agoapp/testpmd: support GTP message type
Dekel Peled [Thu, 16 Jan 2020 18:49:25 +0000 (20:49 +0200)]
app/testpmd: support GTP message type

This patch adds CLI option to enter the msg_type value for GTP
flow pattern item.

Signed-off-by: Dekel Peled <dekelp@mellanox.com>
Acked-by: Ori Kam <orika@mellanox.com>
4 years agoethdev: fix switching domain allocation
Viacheslav Ovsiienko [Thu, 16 Jan 2020 16:19:54 +0000 (16:19 +0000)]
ethdev: fix switching domain allocation

The maximum amount of unique swutching domain is supposed
to be equal RTE_MAX_ETHPORTS. Current implementation allows
to allocate only RTE_MAX_ETHPORTS-1 domains.

The definition of RTE_ETH_DEV_SWITCH_DOMAIN_ID_INVALID is
changed from 0 to UINT16_MAX, the rte_eth_dev_info_get is
updated to initialize dev_ibfo structure accordingly.

Fixes: ce9250406323 ("ethdev: add switch domain allocator")
Cc: stable@dpdk.org
Signed-off-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
4 years agonet/axgbe: support auto-negotiation for 1Gbps
Girish Nandibasappa [Fri, 10 Jan 2020 13:00:11 +0000 (18:30 +0530)]
net/axgbe: support auto-negotiation for 1Gbps

Added CL37 Auto-neg support for 1Gbps interface in axgbe DPDK driver

Signed-off-by: Girish Nandibasappa <girish.nandibasappa@amd.com>
Acked-by: Ravi Kumar <ravi1.kumar@amd.com>
4 years agonet/axgbe: support 1/2.5Gbps
Girish Nandibasappa [Fri, 10 Jan 2020 12:59:37 +0000 (18:29 +0530)]
net/axgbe: support 1/2.5Gbps

Added support for 1Gbps and 2.5Gbps in axgbe dpdk driver

Signed-off-by: Girish Nandibasappa <girish.nandibasappa@amd.com>
Acked-by: Ravi Kumar <ravi1.kumar@amd.com>
4 years agodoc: add release notes for Intel PMDs
Xiaolong Ye [Fri, 17 Jan 2020 06:55:42 +0000 (14:55 +0800)]
doc: add release notes for Intel PMDs

Add release notes for Intel ice/iavf/i40e PMDs.

Signed-off-by: Xiaolong Ye <xiaolong.ye@intel.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
4 years agonet/i40e: add PF MDD event handler
Tao Zhu [Fri, 17 Jan 2020 14:35:56 +0000 (14:35 +0000)]
net/i40e: add PF MDD event handler

Add warning and counter to handle the malicious driver detection (MDD)
event.
When the hardware determines that a malicious driver on VF, this VF will
become unworkable, the PF records and gives a warning message.

Signed-off-by: Tao Zhu <taox.zhu@intel.com>
Acked-by: Qiming Yang <qiming.yang@intel.com>
Acked-by: Xiaolong Ye <xiaolong.ye@intel.com>
4 years agonet/hns3: remove unnecessary branch
Lijun Ou [Thu, 16 Jan 2020 09:27:05 +0000 (17:27 +0800)]
net/hns3: remove unnecessary branch

Because the rte layer of DPDK framework has already processed the case
when the idx is zero before calling the '.mac_addr_remove' ops function,
the input parameter named idx can not be zero in the '.mac_addr_remove'
function. This patch removes unnecessary branch process to check whether
input parameter named idx is zero in the '.mac_addr_remove' ops
implementation function named hns3_remove_mac_addr.

Signed-off-by: Lijun Ou <oulijun@huawei.com>
Signed-off-by: Wei Hu (Xavier) <xavier.huwei@huawei.com>
4 years agonet/hns3: remove unnecessary input parameter check
Lijun Ou [Thu, 16 Jan 2020 09:27:04 +0000 (17:27 +0800)]
net/hns3: remove unnecessary input parameter check

Since the input parameter named dev has been guaranteed not to be NULL
in the rte layer of DPDK framework, it doesn't need to check dev whether
is null in the 'filter_ctrl' ops implementation function named
hns3_dev_filter_ctrl.

Signed-off-by: Lijun Ou <oulijun@huawei.com>
Signed-off-by: Wei Hu (Xavier) <xavier.huwei@huawei.com>
4 years agonet/hns3: replace memory barrier with data dependency order
Chengwen Feng [Thu, 16 Jan 2020 09:27:03 +0000 (17:27 +0800)]
net/hns3: replace memory barrier with data dependency order

This patch optimizes the Rx performance by using data dependency
ordering to instead of memory barrier which is rte_cio_rmb in the
'.rx_pkt_burst' ops implementation function named hns3_recv_pkts.

Signed-off-by: Chengwen Feng <fengchengwen@huawei.com>
Signed-off-by: Wei Hu (Xavier) <xavier.huwei@huawei.com>
4 years agonet/dpaa: fix Rx offload flags on jumbo MTU set
Apeksha Gupta [Thu, 16 Jan 2020 07:56:38 +0000 (13:26 +0530)]
net/dpaa: fix Rx offload flags on jumbo MTU set

The JUMBO frame handling in dpaa_dev_mtu_set api was not correct.
When frame_size is greater than RTE_ETHER_MAX_LEN, the
intention is to add JUMBO flag in rx offload while it was resetting
all other flags other than JUMBO as AND operator was used instead of OR.

Fixes: 0ebce6129bc6 ("net/dpaa2: support new ethdev offload APIs")
Cc: stable@dpdk.org
Signed-off-by: Apeksha Gupta <apeksha.gupta@nxp.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
4 years agoapp/testpmd: support mbuf dynamic flag
Ori Kam [Thu, 16 Jan 2020 12:53:10 +0000 (12:53 +0000)]
app/testpmd: support mbuf dynamic flag

DPDK now supports registration of dynamic flags (dynf) to the mbuf.
dynf can be given any name, and can be used with a supporting PMD or
supporting application.

Due to the generic concept of the dynf, it is impossible and
meaningless, to define register set/get function for each flag.
This commit introduce a generic way to register and set/clear such
flags.

The basic syntax:
port config <port id> dynf <name> <set|clear>

The first step the new flag is registered. Regardless if the action is
set or clear.
There is no way to unregister the flag, after registering it.

The second step, if the action is set then we set the requested flag.
If this is the first flag that is enabled we also register a call back
for the Tx. In this call back we set the flag.
If the action is clear the requested flag is cleared, and if there
are no more flags that are set, the call back is removed.

The reason that the set is only applied in Tx is that in case of Rx
it is assumed that the value comes from the PMD.

If log is enabled the name of the flag, and value will be printed
in the packet info.
In order for the log to work correctly the registration of the flag
must be done before setting verbose.

Signed-off-by: Ori Kam <orika@mellanox.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
4 years agonet/nfp: use macro for PCI log format
Yunjian Wang [Mon, 13 Jan 2020 13:49:35 +0000 (21:49 +0800)]
net/nfp: use macro for PCI log format

Use PCI_PRI_FMT instead of "%04d:%02d:%02d:%d" print format.

Signed-off-by: Yunjian Wang <wangyunjian@huawei.com>
Acked-by: Heinrich Kuhn <heinrich.kuhn@netronome.com>
4 years agonet/i40e: support ESP in flow director
Bernard Iremonger [Thu, 16 Jan 2020 12:44:55 +0000 (12:44 +0000)]
net/i40e: support ESP in flow director

add fill_ip6_head()
hardcode udp destination port to 4500
handle ESP and AH pctypes in ESP-AH profile
update the i40e user guide with ESP information.
update release notes for i40e changes

Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
4 years agonet/i40e: support ESP flows
Bernard Iremonger [Thu, 16 Jan 2020 12:44:54 +0000 (12:44 +0000)]
net/i40e: support ESP flows

add eth/ipv4/esp and eth/ipv6/esp patterns
add eth/ipv4/udp/esp and eth/ipv6/esp/udp patterns
update i40e_flow_parse_fdir_filter()
add i40e_flow_set_filter_spi()

Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
4 years agonet/i40e: support ESP in customized code
Bernard Iremonger [Thu, 16 Jan 2020 12:44:53 +0000 (12:44 +0000)]
net/i40e: support ESP in customized code

update customized code for ESP

Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
4 years agonet/i40e: support IPsec-AH profile
Bernard Iremonger [Thu, 16 Jan 2020 12:44:52 +0000 (12:44 +0000)]
net/i40e: support IPsec-AH profile

Add flow structures for the following patterns in i40e_ethdev files:
eth/ipv4/esp
eth/ipv6/esp
eth/ipv4/udp/esp
eth/ipv6/esp/udp

add oip_type in filter
add is_udp in filter
use tenant_id in filter for spi

Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
4 years agonet/i40e: handle ESP tunnel
Bernard Iremonger [Thu, 16 Jan 2020 12:44:51 +0000 (12:44 +0000)]
net/i40e: handle ESP tunnel

handle ESP tunnel in rte_pmd_i40e.c

Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
4 years agonet/i40e: improve RSS debug
Bernard Iremonger [Thu, 16 Jan 2020 12:44:50 +0000 (12:44 +0000)]
net/i40e: improve RSS debug

improve RSS debug in i40e_ethdev.c

Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
4 years agoapp/testpmd: improve flow command debug
Bernard Iremonger [Thu, 16 Jan 2020 12:44:49 +0000 (12:44 +0000)]
app/testpmd: improve flow command debug

print function name in port_flow_complain()

Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
4 years agoapp/testpmd: parse flow command line for ESP
Bernard Iremonger [Thu, 16 Jan 2020 12:44:48 +0000 (12:44 +0000)]
app/testpmd: parse flow command line for ESP

add ITEM_ESP
add ITEM_ESP_SPI
update release notes for testpmd changes
add sample ESP rules in testpmd guide

Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
Acked-by: Ori Kam <orika@mellanox.com>
4 years agonet/ixgbe: enable NEON in meson
Reshma Pattan [Tue, 14 Jan 2020 11:29:45 +0000 (11:29 +0000)]
net/ixgbe: enable NEON in meson

Add missing arm vector build support to meson.build.

Signed-off-by: Reshma Pattan <reshma.pattan@intel.com>
Acked-by: Xiaolong Ye <xiaolong.ye@intel.com>
4 years agonet/ixgbe: add missing stubs for PPC
Reshma Pattan [Tue, 14 Jan 2020 11:29:44 +0000 (11:29 +0000)]
net/ixgbe: add missing stubs for PPC

Add stubs for ixgbe_xmit_fixed_burst_vec,
ixgbe_rx_queue_release_mbufs_vec and
ixgbe_txq_vec_setup

Signed-off-by: Reshma Pattan <reshma.pattan@intel.com>
Acked-by: Xiaolong Ye <xiaolong.ye@intel.com>
4 years agonet/ixgbe: remove duplicate function declaration
Reshma Pattan [Tue, 14 Jan 2020 11:29:43 +0000 (11:29 +0000)]
net/ixgbe: remove duplicate function declaration

Remove duplicate declarations of ixgbe_xmit_fixed_burst_vec
from ixgbe_rxtx.c

Fixes: 646412f9ff62 ("net/ixgbe: remove limit of Tx burst size")
Cc: stable@dpdk.org
Signed-off-by: Reshma Pattan <reshma.pattan@intel.com>
Acked-by: Xiaolong Ye <xiaolong.ye@intel.com>
4 years agonet/ixgbe: remove vectorization weak symbols
Reshma Pattan [Tue, 14 Jan 2020 11:29:42 +0000 (11:29 +0000)]
net/ixgbe: remove vectorization weak symbols

Remove weak symbols from ixgbe_rxtx.c file as
it is done in i40e driver in commit "02ad704708"
(net/i40e: eliminate weak symbols in data path)

Signed-off-by: Reshma Pattan <reshma.pattan@intel.com>
Acked-by: Xiaolong Ye <xiaolong.ye@intel.com>
4 years agonet/ixgbe: remove vector config
Reshma Pattan [Tue, 14 Jan 2020 11:29:41 +0000 (11:29 +0000)]
net/ixgbe: remove vector config

CONFIG_RTE_IXGBE_INC_VECTOR is enabled by default, so remove
it and use architecture specific flags.

Signed-off-by: Reshma Pattan <reshma.pattan@intel.com>
Acked-by: Xiaolong Ye <xiaolong.ye@intel.com>
4 years agonet/ice/base: clean up compatibility layer
Haiyue Wang [Wed, 15 Jan 2020 00:50:28 +0000 (08:50 +0800)]
net/ice/base: clean up compatibility layer

Remove the unused definitions, rewrite the IO data read/write helpers,
and put the common definitions related to RTE defines under the macro
__INTEL_NET_BASE_OSDEP__, so it works like OS(RTE) dependency.

Signed-off-by: Haiyue Wang <haiyue.wang@intel.com>
Acked-by: Xiaolong Ye <xiaolong.ye@intel.com>
4 years agocommon/iavf: clean up compatibility layer
Haiyue Wang [Wed, 15 Jan 2020 00:50:27 +0000 (08:50 +0800)]
common/iavf: clean up compatibility layer

Remove the unused definitions, rewrite the IO data read/write helpers,
and put the common definitions related to RTE defines under the macro
__INTEL_NET_BASE_OSDEP__, so it works like OS(RTE) dependency.

Signed-off-by: Haiyue Wang <haiyue.wang@intel.com>
Acked-by: Xiaolong Ye <xiaolong.ye@intel.com>
4 years agonet/ice: unify bool type value
Haiyue Wang [Wed, 15 Jan 2020 00:50:26 +0000 (08:50 +0800)]
net/ice: unify bool type value

Replaces the redefined TRUE and FALSE values with standard ones to
match the 'bool' type definition.

Signed-off-by: Haiyue Wang <haiyue.wang@intel.com>
Acked-by: Qiming Yang <qiming.yang@intel.com>
Acked-by: Xiaolong Ye <xiaolong.ye@intel.com>
4 years agonet/iavf: unify bool type value
Haiyue Wang [Wed, 15 Jan 2020 00:50:25 +0000 (08:50 +0800)]
net/iavf: unify bool type value

Replaces the redefined TRUE and FALSE values with standard ones to
match the 'bool' type definition.

Signed-off-by: Haiyue Wang <haiyue.wang@intel.com>
Acked-by: Qiming Yang <qiming.yang@intel.com>
Acked-by: Xiaolong Ye <xiaolong.ye@intel.com>
4 years agonet/ice: fix Tx when TSO is enabled
Xiaoyun Li [Thu, 26 Dec 2019 06:54:28 +0000 (14:54 +0800)]
net/ice: fix Tx when TSO is enabled

Hardware limits that max buffer size per Tx descriptor should be
(16K-1)B. So when TSO enabled, the mbuf data size may exceed the
limit and cause malicious behavior to the NIC. This patch fixes
this issue by using more Tx descs for this kind of large buffer.

Fixes: 17c7d0f9d6a4 ("net/ice: support basic Rx/Tx")
Cc: stable@dpdk.org
Signed-off-by: Xiaoyun Li <xiaoyun.li@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
4 years agonet/ixgbe: fix build with gcc 4.8.5
Ferruh Yigit [Tue, 14 Jan 2020 17:52:47 +0000 (17:52 +0000)]
net/ixgbe: fix build with gcc 4.8.5

Build error:
  In function ‘ixgbe_recv_pkts_lro_bulk_alloc’:
../drivers/net/ixgbe/ixgbe_rxtx.c:2209:24:
  error: ‘next_sc_entry’ may be used uninitialized in this function
  [-Werror=maybe-uninitialized]
    next_sc_entry->fbuf = first_seg;
                        ^
http://mails.dpdk.org/archives/test-report/2020-January/113891.html

This is a compiler false positive and error not seen by newer compilers,
or clang but to fix the warning initializing the complained variable.

According git bisect, no idea how:
Fixes: ad43b7bce95b ("net/ixgbe: avoid multiple definitions of bool")

Reported-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
Tested-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Acked-by: Xiaolong Ye <xiaolong.ye@intel.com>
4 years agonet/mlx5: fix doorbell register offset type
Viacheslav Ovsiienko [Mon, 13 Jan 2020 14:22:37 +0000 (14:22 +0000)]
net/mlx5: fix doorbell register offset type

The doorbell register is mapped using mmap() and offset
must have off_t instead of unsigned int. Bug is not critical
due to only least significant bits of offset are currently
tested to determine mapping mode.

Fixes: 8409a28573d3 ("net/mlx5: control transmit doorbell register mapping")
Cc: stable@dpdk.org
Signed-off-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
Acked-by: Matan Azrad <matan@mellanox.com>
4 years agonet/virtio-user: fix packed ring server mode
Xuan Ding [Wed, 15 Jan 2020 06:13:58 +0000 (06:13 +0000)]
net/virtio-user: fix packed ring server mode

This patch fixes the situation where data path does not work properly
when vhost reconnects to virtio in server mode with packed ring.

Currently, virtio and vhost share memory of vring. For split ring, vhost
can read the status of descriptors directly from the available ring and
the used ring during reconnection. Therefore, the data path can
continue.

But for packed ring, when reconnecting to virtio, vhost cannot get the
status of descriptors via the descriptor ring. By resetting Tx
and Rx queues, the data path can restart from the beginning.

Fixes: 4c3f5822eb21 ("net/virtio: add packed virtqueue defines")
Cc: stable@dpdk.org
Signed-off-by: Xuan Ding <xuan.ding@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
4 years agovhost: fix deadlock on port deletion
Maxime Coquelin [Tue, 14 Jan 2020 18:53:57 +0000 (19:53 +0100)]
vhost: fix deadlock on port deletion

If the vhost-user application (e.g. OVS) deletes the vhost-user
port while Qemu sends a vhost-user request, a deadlock can
happen if the request handler tries to acquire vhost-user's
global mutex, which is also locked by the vhost-user port
deletion API (rte_vhost_driver_unregister).

This patch prevents the deadlock by making
rte_vhost_driver_unregister() to release the mutex and try
again if a request is being handled to give a chance to
the request handler to complete.

Fixes: 8b4b949144b8 ("vhost: fix dead lock on closing in server mode")
Fixes: 5fbb3941da9f ("vhost: introduce driver features related APIs")
Cc: stable@dpdk.org
Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Reviewed-by: Tiwei Bie <tiwei.bie@intel.com>
Acked-by: Eelco Chaudron <echaudro@redhat.com>
4 years agonet/virtio-user: check tap offload setting failure
Yunjian Wang [Mon, 13 Jan 2020 07:40:31 +0000 (15:40 +0800)]
net/virtio-user: check tap offload setting failure

The function vhost_kernel_tap_set_offload() could return errors,
the return value need to be checked. And there is no need to fail
when error is -ENOTSUP.

Fixes: 1db4d2330bc8 ("net/virtio-user: check negotiated features before set")
Cc: stable@dpdk.org
Signed-off-by: Yunjian Wang <wangyunjian@huawei.com>
Reviewed-by: Tiwei Bie <tiwei.bie@intel.com>
4 years agonet/virtio: support packed ring notification data
Cheng Jiang [Mon, 13 Jan 2020 03:31:33 +0000 (03:31 +0000)]
net/virtio: support packed ring notification data

This patch supports the feature that the driver passes extra data
(besides identifying the virtqueue) in its device notifications,
expanding the notifications to include the avail index and avail
wrap counter.

Signed-off-by: Cheng Jiang <cheng1.jiang@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
4 years agovhost: support config change slave message
Li Feng [Fri, 20 Dec 2019 08:22:55 +0000 (16:22 +0800)]
vhost: support config change slave message

This msg is used to notify qemu that should get the config of backend.

For example, vhost-user-blk uses this msg to notify guest OS the
capacity of backend has changed.

The need_reply flag is not mandatory because it will block the sender
thread and master process will send get_config message to fetch the
configuration, this need an extra thread to process the vhost message.

Signed-off-by: Li Feng <fengli@smartx.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
4 years agonet/virtio-user: do not close tap when disabling queue pairs
Tiwei Bie [Mon, 25 Nov 2019 08:14:40 +0000 (16:14 +0800)]
net/virtio-user: do not close tap when disabling queue pairs

Do not close the tap fds when disabling queue pairs, instead,
we just need to unbind the backend. Otherwise, tap port can be
destroyed unexpectedly.

Fixes: e3b434818bbb ("net/virtio-user: support kernel vhost")
Cc: stable@dpdk.org
Reported-by: Stephen Hemminger <stephen@networkplumber.org>
Signed-off-by: Tiwei Bie <tiwei.bie@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
4 years agodoc: add more supported speeds in ice guide
Xiaolong Ye [Fri, 20 Dec 2019 07:10:07 +0000 (15:10 +0800)]
doc: add more supported speeds in ice guide

The ice PMD supports 10/25/50/100 Gbps.

Signed-off-by: Xiaolong Ye <xiaolong.ye@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
4 years agodoc: update recommended versions for i40e
Zhaoyan Chen [Fri, 3 Jan 2020 03:03:39 +0000 (11:03 +0800)]
doc: update recommended versions for i40e

Update supported Intel NIC driver version and firmware version for 19.11
Update supported Intel NIC driver version to 2.8.43 for 19.08 which is
widely tested.

Fixes: cb8a35c22aa9 ("doc: update supported i40e driver and firmware version")
Cc: stable@dpdk.org
Signed-off-by: Zhaoyan Chen <zhaoyan.chen@intel.com>
Acked-by: Xiaolong Ye <xiaolong.ye@intel.com>
4 years agonet/e1000: cleanup Tx buffers
Chenxu Di [Mon, 13 Jan 2020 09:57:08 +0000 (09:57 +0000)]
net/e1000: cleanup Tx buffers

Add support to the igb vf for the API rte_eth_tx_done_cleanup to force
free consumed buffers on Tx ring.

Signed-off-by: Chenxu Di <chenxux.di@intel.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
4 years agonet/ixgbe: cleanup Tx buffers
Chenxu Di [Mon, 13 Jan 2020 09:57:07 +0000 (09:57 +0000)]
net/ixgbe: cleanup Tx buffers

Add support to the ixgbe driver for the API rte_eth_tx_done_cleanup
to force free consumed buffers on Tx ring.

Signed-off-by: Chenxu Di <chenxux.di@intel.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
4 years agonet/ice: cleanup Tx buffers
Chenxu Di [Mon, 13 Jan 2020 09:57:06 +0000 (09:57 +0000)]
net/ice: cleanup Tx buffers

Add support to the ice driver for the API rte_eth_tx_done_cleanup
to force free consumed buffers on Tx ring.

Signed-off-by: Chenxu Di <chenxux.di@intel.com>
Acked-by: Qiming Yang <qiming.yang@intel.com>
4 years agonet/i40e: cleanup Tx buffers
Chenxu Di [Mon, 13 Jan 2020 09:57:05 +0000 (09:57 +0000)]
net/i40e: cleanup Tx buffers

Add support to the i40e driver for the API rte_eth_tx_done_cleanup
to force free consumed buffers on Tx ring.

Signed-off-by: Chenxu Di <chenxux.di@intel.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
4 years agonet/octeontx2: fix PTP and HIGIG2 coexistence
Kiran Kumar K [Tue, 14 Jan 2020 09:26:22 +0000 (14:56 +0530)]
net/octeontx2: fix PTP and HIGIG2 coexistence

octeontx2 PMD does not support both PTP and HIGIG2 together.
Added a check to enforce this and updated the Rx offload capabilities when
Higig2 mode enabled.

Fixes: 602009ee2dfb ("net/octeontx2: support HIGIG2")
Cc: stable@dpdk.org
Signed-off-by: Kiran Kumar K <kirankumark@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
4 years agonet/cxgbe: announce Tx multi-segments offload
Rahul Lakkireddy [Tue, 14 Jan 2020 09:43:22 +0000 (15:13 +0530)]
net/cxgbe: announce Tx multi-segments offload

Multi-segs Tx is already supported by CXGBE PMD. So, add the missing
DEV_TX_OFFLOAD_MULTI_SEGS flag to the list of supported Tx offload
features.

Fixes: 436125e64174 ("net/cxgbe: update to Rx/Tx offload API")
Cc: stable@dpdk.org
Reported-by: Chas Williams <3chas3@gmail.com>
Signed-off-by: Rahul Lakkireddy <rahul.lakkireddy@chelsio.com>
4 years agonet/enic: move min/max macros
John Daley [Tue, 14 Jan 2020 00:24:51 +0000 (16:24 -0800)]
net/enic: move min/max macros

Move a macro from a widely included header file to a header file
used only by the one caller of the macro.

Signed-off-by: John Daley <johndale@cisco.com>
Reviewed-by: Hyong Youb Kim <hyonkim@cisco.com>
4 years agonet/enic: consolidate and remove some defines
John Daley [Tue, 14 Jan 2020 00:24:50 +0000 (16:24 -0800)]
net/enic: consolidate and remove some defines

There were defines which originally allowed sharing of some code with
the enic kernel driver. The code has long since diverged and now the
abstraction just makes the code harder to read. Mostly mechanical
replacement of defines and reformatting.

Signed-off-by: John Daley <johndale@cisco.com>
Reviewed-by: Hyong Youb Kim <hyonkim@cisco.com>
4 years agonet/enic: replace some PMD macros with standard API
John Daley [Tue, 14 Jan 2020 00:24:49 +0000 (16:24 -0800)]
net/enic: replace some PMD macros with standard API

Use the memzone namesize, Ethernet address length defines from the RTE
header files instead of locally defined versions.
Use the RTE byte swap functions instead of the x86 specific locally
defined versions.

Signed-off-by: John Daley <johndale@cisco.com>
Reviewed-by: Hyong Youb Kim <hyonkim@cisco.com>
4 years agonet/netvsc: eliminate NUMA specific allocation
Stephen Hemminger [Mon, 13 Jan 2020 19:12:39 +0000 (11:12 -0800)]
net/netvsc: eliminate NUMA specific allocation

The control messages do not need NUMA specific allocation.
Numa node is not set anyway in most kernels anyway.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
4 years agonet/netvsc: fix crash in secondary process
Stephen Hemminger [Mon, 13 Jan 2020 19:12:38 +0000 (11:12 -0800)]
net/netvsc: fix crash in secondary process

The secondary process would crash trying to get the offload
capability of the device. Since the device capabilities were
already set by the primary process this was unnecessary.

Fixes: 4e9c73e96e83 ("net/netvsc: add Hyper-V network device")
Cc: stable@dpdk.org
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
4 years agocommon/octeontx2: support C0 silicon version
Nithin Dabilpuram [Mon, 13 Jan 2020 05:03:02 +0000 (10:33 +0530)]
common/octeontx2: support C0 silicon version

Avoid using PCI subsystem device id for SoC revision
identification and just use PCI revision id to support C0 silicon.
This patch also reduces SQB threshold to 70% to have
sufficient buffer before we overflow SQ.

Signed-off-by: Nithin Dabilpuram <ndabilpuram@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
4 years agonet/octeontx: add unicast MAC filter
Sunil Kumar Kori [Mon, 13 Jan 2020 06:16:44 +0000 (11:46 +0530)]
net/octeontx: add unicast MAC filter

At BGX, DMAC filter table can be enabled to allow defined hosts.
Patch implements 'mac_addr_add' and 'mac_addr_remove' ops to
add/remove MAC filters which uses BGX DMAC filter table.

Signed-off-by: Sunil Kumar Kori <skori@marvell.com>
Acked-by: Harman Kalra <hkalra@marvell.com>
4 years agomempool/octeontx: fix error handling in initialization
Krzysztof Kanas [Thu, 19 Dec 2019 10:44:34 +0000 (11:44 +0100)]
mempool/octeontx: fix error handling in initialization

When octeontx_get_fpavf fails fpa pointer is used to get
pool_stack_base, which is then freed.

Coverity issue: 351263
Fixes: 9bc692f83baa ("mempool/octeontx: add application domain validation")
Cc: stable@dpdk.org
Signed-off-by: Krzysztof Kanas <kkanas@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
4 years agonet/octeontx2: improve vector Tx performance
Pavan Nikhilesh [Sat, 11 Jan 2020 13:57:42 +0000 (19:27 +0530)]
net/octeontx2: improve vector Tx performance

Use scalar loads instead of vector loads for fields
that don't need any vector operations.

Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
4 years agonet/qede: enhance Tx CPU utilization
Shahed Shaikh [Thu, 2 Jan 2020 17:59:03 +0000 (09:59 -0800)]
net/qede: enhance Tx CPU utilization

Use lightweight transmit handler which handles non-offloaded Tx data
path. We get CPU utilization improvement of ~8%.

Signed-off-by: Shahed Shaikh <shshaikh@marvell.com>
4 years agonet/qede: enhance Rx CPU utilization
Shahed Shaikh [Thu, 2 Jan 2020 17:59:02 +0000 (09:59 -0800)]
net/qede: enhance Rx CPU utilization

Use light weight receive packet handler for non-LRO and
non-scatter packets to improve CPU utilization in receive data path.
We achieved ~18% CPU cycles improvement using this handler.

Signed-off-by: Shahed Shaikh <shshaikh@marvell.com>
4 years agonet/bnx2x: support secondary process
Rasesh Mody [Sat, 21 Dec 2019 01:41:46 +0000 (17:41 -0800)]
net/bnx2x: support secondary process

Skip the device re-initialization for secondary process.

Cc: stable@dpdk.org
Signed-off-by: Rasesh Mody <rmody@marvell.com>
4 years agonet/qede/base: fix number of ports per engine
Rasesh Mody [Sat, 21 Dec 2019 01:34:51 +0000 (17:34 -0800)]
net/qede/base: fix number of ports per engine

Fix the way in which the number of ports per engine of an adapter is
determined by reading port mode register. Set default value to 1.

Fixes: 3b307c55f2ac ("net/qede/base: update FW to 8.40.25.0")
Cc: stable@dpdk.org
Signed-off-by: Rasesh Mody <rmody@marvell.com>
4 years agonet/octeontx2: allow vector processing packets not by 4
Vamsi Attunuru [Fri, 20 Dec 2019 13:02:52 +0000 (18:32 +0530)]
net/octeontx2: allow vector processing packets not by 4

Current vector mode implementation floor-aligns pkt count
with NIX_DESCS_PER_LOOP and process that many packets.

Patch addresses the case where pkt count modulo NIX_DESCS_PER_LOOP
is non-zero, after the vector mode processing, scalar routine is
used to process if there are any leftover packets. Scalar routine
is also used when descriptor head is about to wrap and turn out to
be unaligned.

Signed-off-by: Vamsi Attunuru <vattunuru@marvell.com>
Signed-off-by: Nithin Dabilpuram <ndabilpuram@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
4 years agocommon/octeontx2: reduce wait time for mbox messages
Sunil Kumar Kori [Mon, 16 Dec 2019 15:02:53 +0000 (20:32 +0530)]
common/octeontx2: reduce wait time for mbox messages

After each mbox send operation, context waits for minimum 1ms to get
corresponding response although response can come earlier.
So reducing wait time to lower granularity.

Signed-off-by: Sunil Kumar Kori <skori@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
4 years agonet/hns3: fix triggering reset procedure in slave process
Chengwen Feng [Thu, 9 Jan 2020 03:15:59 +0000 (11:15 +0800)]
net/hns3: fix triggering reset procedure in slave process

Currently, reset related operations can only be performed in the primary
process and are not allowed in the slave process in hns3 PMD driver.

In the internal function interface named hns3_cmd_send used for
communication between driver and firmware, if the wrong head value is
detected in the static subfunction hns3_cmd_csq_clean, driver will
trigger a function level reset to make the hardware work normally again.

This patch adds check condition to prevent triggering reset procedure in
the slave process to avoid failure.

Fixes: 2790c6464725 ("net/hns3: support device reset")
Cc: stable@dpdk.org
Signed-off-by: Chengwen Feng <fengchengwen@huawei.com>
Signed-off-by: Wei Hu (Xavier) <xavier.huwei@huawei.com>
4 years agonet/hns3: fix link status on failed query
Wei Hu (Xavier) [Thu, 9 Jan 2020 03:15:58 +0000 (11:15 +0800)]
net/hns3: fix link status on failed query

Currently, the hns3 PMD driver issues command to the firmware and gets
link status information.

When the driver fails to call internal interface function named
hns3_cmd_send to query the status from firmware for some reason, the
link status queried by the driver should be down.

Fixes: 59fad0f32135 ("net/hns3: support link update operation")
Cc: stable@dpdk.org
Signed-off-by: Hongbo Zheng <zhenghongbo3@huawei.com>
Signed-off-by: Huisong Li <lihuisong@huawei.com>
Signed-off-by: Wei Hu (Xavier) <xavier.huwei@huawei.com>
4 years agonet/hns3: fix dumping VF register information
Wei Hu (Xavier) [Thu, 9 Jan 2020 03:15:57 +0000 (11:15 +0800)]
net/hns3: fix dumping VF register information

Currently, when the API interface named rte_eth_dev_get_reg_info is
called by upper applications based on VF device, it returns error.

We can read registers directly to get ring and interrupt related
information in hns3 PF/VF PMD driver. But for some other internal table
entries and common configuration information, we can get them only
through the command interface between driver and firmware in PF driver,
and VF driver has not the related access permission.

This patch fixes it by preventing getting these information through the
command interface based on VF device in 'get_reg' ops implementation
function.

Fixes: 936eda25e8da ("net/hns3: support dump register")
Cc: stable@dpdk.org
Signed-off-by: Chengwen Feng <fengchengwen@huawei.com>
Signed-off-by: Wei Hu (Xavier) <xavier.huwei@huawei.com>
4 years agonet/hns3: fix ring vector related mailbox command format
Wei Hu (Xavier) [Thu, 9 Jan 2020 03:15:56 +0000 (11:15 +0800)]
net/hns3: fix ring vector related mailbox command format

The format of the ring vector related mailbox commands between driver
and firmware is different from those of other mailbox commands in hns3
network engine.

This patch fixes the error mailbox command format about the vector of
the rings, the related command opcode as below:
HNS3_MBX_MAP_RING_TO_VECTOR
HNS3_MBX_UNMAP_RING_TO_VECTOR
HNS3_MBX_GET_RING_VECTOR_MAP

Fixes: 463e748964f5 ("net/hns3: support mailbox")
Cc: stable@dpdk.org
Signed-off-by: Chengwen Feng <fengchengwen@huawei.com>
Signed-off-by: Wei Hu (Xavier) <xavier.huwei@huawei.com>
4 years agonet/hns3: fix crash when closing port
Hongbo Zheng [Thu, 9 Jan 2020 03:15:55 +0000 (11:15 +0800)]
net/hns3: fix crash when closing port

Currently there is a certain probability of segment error in concurrent
reset when the port is closing.
The calltrace info:

This GDB was configured as "aarch64-redhat-linux-gnu".
Reading symbols from /usr/app/testpmd...(no debugging symbols found)...
 done.
[New LWP 98204]
[New LWP 98203]
[New LWP 98206]
[New LWP 98205]
[New LWP 98207]
[New LWP 98208]
Missing separate debuginfo for /root/lib/libnuma.so.1
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib64/libthread_db.so.1".
Core was generated by `/usr/app/testpmd --log-level=6 --socket-mem 16'.
Program terminated with signal 11, Segmentation fault.
Missing separate debuginfos, use:
 debuginfo-install glibc-2.17-260.el7.aarch64
(gdb) bt
in hns3vf_service_handler ()
1  0x00000000006988b8 in eal_alarm_callback ()
2  0x00000000006969b4 in eal_intr_thread_main ()
3  0x0000ffffb08d6c48 in start_thread () from /lib64/libpthread.so.0
4  0x0000ffffb0828600 in thread_start () from /lib64/libc.so.6
(gdb)

Reset process may turn on the cancelled link state timer whether the
current port status is on or off, in order to solve this problem, this
patch add judge the current network port state before starting the
timer, only the port in the running state can start the link state
timer, so as to solve the problem that the link state timer accesses the
null pointer and causes the segment error.

Fixes: 2790c6464725 ("net/hns3: support device reset")
Cc: stable@dpdk.org
Signed-off-by: Hongbo Zheng <zhenghongbo3@huawei.com>
Signed-off-by: Wei Hu (Xavier) <xavier.huwei@huawei.com>
4 years agonet/hns3: fix Rx queue search with broadcast packet
Wei Hu (Xavier) [Thu, 9 Jan 2020 03:15:54 +0000 (11:15 +0800)]
net/hns3: fix Rx queue search with broadcast packet

Currently, there is a certain probability of a type of RAS errors when
receiving broadcast packets. This type of RAS errors are parsed as
rx_q_search_miss error by hns3 PF PMD driver, the related log as below:
0000:bd:00.0 hns3_find_highest_level(): PPP_MFP_ABNORMAL_INT_ST2
rx_q_search_miss found [error status=0x20000000]

When receiving broadcast packet, network engine select which functions
need to accept it according to the function's promisc_bcast_en bit
configuration. And then search TQP_MAP configuration to select which
hardware queues the packet should enter, if can't find the target
hardware queue, network engine will trigger rx_q_search_miss RAS error.

The root cause as below:
1. VF's promisc_bcast_en bit configuration is not cleared by FLR reset,
   and the configuration has been set in the previous application.
2. There is one bug in setting TQP_MAP configuration in the
   initialization of PF device: when tqp is allocated to VF, it is still
   marked as PF.  This issue will affect the correctness of the TQP_MAP
   configuration.

This patch fixes it with the following modification.
1. Clear all VFs promisc_bcast_en bit in the initialization of PF
   device.
2. Fix the issue to ensure the correct TQP_MAP configuration.

Fixes: d51867db65c1 ("net/hns3: add initialization")
Cc: stable@dpdk.org
Signed-off-by: Chengwen Feng <fengchengwen@huawei.com>
Signed-off-by: Wei Hu (Xavier) <xavier.huwei@huawei.com>
4 years agonet/hns3: add free threshold in Rx
Wei Hu (Xavier) [Thu, 9 Jan 2020 03:15:53 +0000 (11:15 +0800)]
net/hns3: add free threshold in Rx

This patch optimizes the Rx performance by adding the rx_free_thresh
related process in the '.rx_pkt_burst' ops implementation function named
hns3_recv_pkts. The related change as follows:
1. Adding the rx_free_thresh related process to reduce the number of
   writing the HNS3_RING_RX_HEAD_REG register.
2. Adjusting the internal macro named DEFAULT_RX_FREE_THRESH to 32 and
   adjusting HNS3_MIN_RING_DESC to 64 to make the effect of the thresh
   more obvious.

Signed-off-by: Chengwen Feng <fengchengwen@huawei.com>
Signed-off-by: Wei Hu (Xavier) <xavier.huwei@huawei.com>
4 years agonet/hns3: remove one IO barrier in Rx
Wei Hu (Xavier) [Thu, 9 Jan 2020 03:15:52 +0000 (11:15 +0800)]
net/hns3: remove one IO barrier in Rx

When receiving a packet, hns3 hardware network engine firstly writes the
packet content to the memory pointed by the 'addr' field of the Rx
Buffer Descriptor, secondly fills the result of parsing the packet
include the valid field into the Rx Buffer Descriptor in one write
operation, and thirdly writes the number of the Buffer Descriptor not
processed by the driver to the HNS3_RING_RX_FBDNUM_REG register.

This patch optimizes the Rx performance by removing one rte_io_rmb call
in the '.rx_pkt_burst' ops implementation function named hns3_recv_pkts.
The change as follows:
1. Driver no longer read HNS3_RING_RX_FBDNUM_REG register, so remove one
   rte_io_rmb call, and directly read the valid flag of Rx Buffer
   Descriptor to check whether the BD is ready.
2. Delete the non_vld_descs field from the statistic information of the
   hns3 driver because now it has become a common case that the valid
   flag of Rx Buffer Descriptor read by the driver is invalid.

Signed-off-by: Chengwen Feng <fengchengwen@huawei.com>
Signed-off-by: Wei Hu (Xavier) <xavier.huwei@huawei.com>
4 years agonet/hns3: reduce judgements of free Tx ring space
Yisen Zhuang [Thu, 9 Jan 2020 03:15:51 +0000 (11:15 +0800)]
net/hns3: reduce judgements of free Tx ring space

This patch reduces the number of the judgement of the free Tx ring space
in the 'tx_pkt_burst' ops implementation function to avoid performance
loss. According to hardware constraints, we need to reserve a Tx Buffer
Descriptor in the TX ring in hns3 network engine.

Signed-off-by: Yisen Zhuang <yisen.zhuang@huawei.com>
Signed-off-by: Wei Hu (Xavier) <xavier.huwei@huawei.com>
4 years agonet/hns3: support setting VF MAC address by PF driver
Wei Hu (Xavier) [Thu, 9 Jan 2020 03:15:50 +0000 (11:15 +0800)]
net/hns3: support setting VF MAC address by PF driver

Currently, we only support VF device is bound to vfio_pci or igb_uio and
then driven by DPDK driver when PF is driven by kernel mode hns3 ethdev
driver, VF is not supported when PF is driven by hns3 DPDK driver.

This patch adds support setting VF MAC address by hns3 PF kernel ethdev
driver on the host by "ip link set ..." command.
1) If the hns3 PF kernel ethdev driver sets the MAC address for VF
   device before the initialization of the related VF device, hns3 VF
   PMD driver should get the MAC address from PF driver through mailbox
   and configure hardware using this MAC address in the initialization.
   The hns3 VF PMD driver get the MAC address form PF driver, if
   obtaining a non-zero MAC address from mailbox, VF driver will
   configure hardware using it, otherwise using a random MAC address in
   the initialization of VF device.
2) If the hns3 PF kernel ethdev driver sets the MAC address for VF
   device after the initialization of the related VF device, the PF
   driver will notify VF driver to reset VF device to make the new MAC
   address effective immediately. The hns3 VF PMD driver should check
   whether the MAC address has been changed by the PF kernel netdevice
   driver, if changed VF driver should configure hardware using the new
   MAC address in the recovering hardware configuration stage of the
   reset process.
3) When user has configured a mac address for VF device by "ip link set
   ..." command based on the PF device, the hns3 PF kernel ethdev driver
   does not allow VF driver to request reconfiguring a different default
   mac address and return -EPREM to VF driver through mailbox.

Signed-off-by: Chengchang Tang <tangchengchang@huawei.com>
Signed-off-by: Wei Hu (Xavier) <xavier.huwei@huawei.com>
Signed-off-by: Hongbo Zheng <zhenghongbo3@huawei.com>