dpdk.git
4 years agonet/bnxt: support two table scopes
Farah Smith [Wed, 15 Jul 2020 13:50:32 +0000 (19:20 +0530)]
net/bnxt: support two table scopes

Need to remap the table scope ids allocated from HCAPI RM from high
to low value because for legacy devices a table scope is a set of base
addresses.  The PCIe addresses must map to a PCIe PF which exists in
the hardware.

Signed-off-by: Farah Smith <farah.smith@broadcom.com>
Signed-off-by: Somnath Kotur <somnath.kotur@broadcom.com>
Reviewed-by: Randy Schacher <stuart.schacher@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
4 years agonet/bnxt: check index range in bulk get
Jay Ding [Wed, 15 Jul 2020 13:50:31 +0000 (19:20 +0530)]
net/bnxt: check index range in bulk get

In tf_tbl_bulk_get, check if the indexes are in the range
of reserved tbl id instead of checking the allocation of each id.

Signed-off-by: Jay Ding <jay.ding@broadcom.com>
Reviewed-by: Randy Schacher <stuart.schacher@broadcom.com>
Reviewed-by: Somnath Kotur <somnath.kotur@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
4 years agonet/bnxt: implement TF Identifier search
Jay Ding [Wed, 15 Jul 2020 13:50:30 +0000 (19:20 +0530)]
net/bnxt: implement TF Identifier search

Implement shadow copy DB to hold reference count for
each ID in each identifier type. Implement identifier
search functionality.

Signed-off-by: Jay Ding <jay.ding@broadcom.com>
Signed-off-by: Somnath Kotur <somnath.kotur@broadcom.com>
Reviewed-by: Randy Schacher <stuart.schacher@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
4 years agonet/bnxt: delay EEM sysmem mapping
Peter Spreadborough [Wed, 15 Jul 2020 13:50:29 +0000 (19:20 +0530)]
net/bnxt: delay EEM sysmem mapping

- The mapping of kernel pages for EEM sysmem operation takes
  a significant amount of time. This change give the build option
  to delay the sysmem mapping until the first write to EEM

Signed-off-by: Peter Spreadborough <peter.spreadborough@broadcom.com>
Signed-off-by: Somnath Kotur <somnath.kotur@broadcom.com>
Reviewed-by: Randy Schacher <stuart.schacher@broadcom.com>
4 years agoadd python2 deprecation notice
Louise Kilheeney [Fri, 10 Jul 2020 10:10:47 +0000 (11:10 +0100)]
add python2 deprecation notice

Prepare for python2 removal in 20.11.

Signed-off-by: Louise Kilheeney <louise.kilheeney@intel.com>
Acked-by: Neil Horman <nhorman@tuxdriver.com>
Acked-by: Nicolas Chautru <nicolas.chautru@intel.com>
4 years agoapp/bbdev: support python3
Louise Kilheeney [Fri, 10 Jul 2020 10:10:54 +0000 (11:10 +0100)]
app/bbdev: support python3

Use of the print function required for python3 compatibility.

Signed-off-by: Louise Kilheeney <louise.kilheeney@intel.com>
Acked-by: Nicolas Chautru <nicolas.chautru@intel.com>
4 years agotest/eal: check invalid CPU value
Kevin Traynor [Mon, 20 Jul 2020 10:19:08 +0000 (11:19 +0100)]
test/eal: check invalid CPU value

When using --lcores option, there is a limit of CPU_SETSIZE.
Currently that allows 0..1023 on Linux.

Check it is caught when this limit is exceeded.

Signed-off-by: Kevin Traynor <ktraynor@redhat.com>
Acked-by: Lukasz Wojciechowski <l.wojciechow@partner.samsung.com>
4 years agobus/fslmc: fix memory leak in secondary process
Yunjian Wang [Fri, 17 Jul 2020 10:50:17 +0000 (18:50 +0800)]
bus/fslmc: fix memory leak in secondary process

In fslmc_process_mcp(), we allocate memory for 'dev_name' but not
released before return in secondary process. And it is not used
since commit a69f79300262 ("bus/fslmc: support multi VFIO group"),
so it can be removed.

Fixes: e55d0494ab98 ("bus/fslmc: support secondary process")
Cc: stable@dpdk.org
Signed-off-by: Yunjian Wang <wangyunjian@huawei.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
4 years agolpm: report error when defer queue overflows
Ruifeng Wang [Thu, 16 Jul 2020 15:49:19 +0000 (23:49 +0800)]
lpm: report error when defer queue overflows

Coverity complains about unchecked return value of rte_rcu_qsbr_dq_enqueue.
By default, defer queue size is big enough to hold all tbl8 groups. When
enqueue fails, return error to the user to indicate system issue.

Coverity issue: 360832
Fixes: 8a9f8564e9f9 ("lpm: implement RCU rule reclamation")

Signed-off-by: Ruifeng Wang <ruifeng.wang@arm.com>
Acked-by: Vladimir Medvedkin <vladimir.medvedkin@intel.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
4 years agomempool/ring: support RTS and HTS ring modes
Konstantin Ananyev [Wed, 15 Jul 2020 14:58:15 +0000 (15:58 +0100)]
mempool/ring: support RTS and HTS ring modes

Two new sync modes were introduced into rte_ring:
relaxed tail sync (RTS) and head/tail sync (HTS).
This change provides user with ability to select these
modes for ring based mempool via mempool ops API.

Signed-off-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
Acked-by: Gage Eads <gage.eads@intel.com>
4 years agodoc: add ring based mempool guide
Konstantin Ananyev [Wed, 15 Jul 2020 14:58:14 +0000 (15:58 +0100)]
doc: add ring based mempool guide

Add documentation for rte_ring mempool driver.

Signed-off-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
4 years agoregex/mlx5: add empty start/stop/close
Ori Kam [Mon, 20 Jul 2020 06:26:17 +0000 (06:26 +0000)]
regex/mlx5: add empty start/stop/close

Add the start, stop and close functions.
In current implementation they are empty functions
and are only exists in order that when called
from rte level, the function will return with success code.

Signed-off-by: Ori Kam <orika@mellanox.com>
4 years agoregex/mlx5: support dequeue
Yuval Avnery [Mon, 20 Jul 2020 06:26:16 +0000 (06:26 +0000)]
regex/mlx5: support dequeue

Implement dequeue function for the regex API.

Signed-off-by: Yuval Avnery <yuvalav@mellanox.com>
Acked-by: Ori Kam <orika@mellanox.com>
4 years agoregex/mlx5: support enqueue
Yuval Avnery [Mon, 20 Jul 2020 06:26:15 +0000 (06:26 +0000)]
regex/mlx5: support enqueue

Will look for a free SQ to send the job on.
doorbell will be given when sq is full, or no more jobs on the burst.

Signed-off-by: Yuval Avnery <yuvalav@mellanox.com>
Acked-by: Ori Kam <orika@mellanox.com>
4 years agoregex/mlx5: setup fast path
Yuval Avnery [Mon, 20 Jul 2020 06:26:14 +0000 (06:26 +0000)]
regex/mlx5: setup fast path

Allocated and register input/output buffers and metadata.

Signed-off-by: Yuval Avnery <yuvalav@mellanox.com>
Acked-by: Ori Kam <orika@mellanox.com>
4 years agoregex/mlx5: add send queue
Ori Kam [Mon, 20 Jul 2020 06:26:13 +0000 (06:26 +0000)]
regex/mlx5: add send queue

This commit introduce the SQ creation.
The SQ is used for enqueuing a job.

In order to support out of order matches, we create number
os SQ per one application QP.

Signed-off-by: Ori Kam <orika@mellanox.com>
4 years agoregex/mlx5: add completion queue creation
Ori Kam [Mon, 20 Jul 2020 06:26:12 +0000 (06:26 +0000)]
regex/mlx5: add completion queue creation

This commit adds the creation of CQ

Signed-off-by: Ori Kam <orika@mellanox.com>
4 years agoregex/mlx5: support rules import
Francis Kelly [Mon, 20 Jul 2020 06:26:11 +0000 (06:26 +0000)]
regex/mlx5: support rules import

This commit introduce the ability to program rules to the
RegEx engine.

Signed-off-by: Francis Kelly <fkelly@mellanox.com>
Acked-by: Ori Kam <orika@mellanox.com>
4 years agoregex/mlx5: support configuration
Ori Kam [Mon, 20 Jul 2020 06:26:10 +0000 (06:26 +0000)]
regex/mlx5: support configuration

This commit implements the configure function.
This function is responsible to configure the RegEx engine.

Signed-off-by: Ori Kam <orika@mellanox.com>
4 years agoregex/mlx5: add engine status check
Ori Kam [Mon, 20 Jul 2020 06:26:09 +0000 (06:26 +0000)]
regex/mlx5: add engine status check

This commit checks the engine status.

Signed-off-by: Ori Kam <orika@mellanox.com>
4 years agoregex/mlx5: support info query
Ori Kam [Mon, 20 Jul 2020 06:26:08 +0000 (06:26 +0000)]
regex/mlx5: support info query

This commit adds the get info function.

Signed-off-by: Ori Kam <orika@mellanox.com>
4 years agoregex/mlx5: support probing
Ori Kam [Mon, 20 Jul 2020 06:26:07 +0000 (06:26 +0000)]
regex/mlx5: support probing

This commit adds the probe function to the RegEx PMD.

Signed-off-by: Parav Pandit <parav@mellanox.com>
Signed-off-by: Ori Kam <orika@mellanox.com>
4 years agoregex/mlx5: add log macros
Yuval Avnery [Mon, 20 Jul 2020 06:26:06 +0000 (06:26 +0000)]
regex/mlx5: add log macros

Add the MLX5_REGEX_LOG macro which should be used for error prints.

Signed-off-by: Yuval Avnery <yuvalav@mellanox.com>
Acked-by: Ori Kam <orika@mellanox.com>
4 years agoregex/mlx5: introduce driver for BlueField 2
Yuval Avnery [Mon, 20 Jul 2020 06:26:05 +0000 (06:26 +0000)]
regex/mlx5: introduce driver for BlueField 2

This commit introduce the RegEx poll mode drivers class, and
adds Mellanox RegEx PMD.

Signed-off-by: Yuval Avnery <yuvalav@mellanox.com>
Signed-off-by: Ori Kam <orika@mellanox.com>
4 years agodoc: announce removal of mbuf legacy refcnt field
Phil Yang [Fri, 17 Jul 2020 04:36:51 +0000 (12:36 +0800)]
doc: announce removal of mbuf legacy refcnt field

refcnt_atomic member in structures rte_mbuf and rte_mbuf_ext_shared_info
will be removed in 20.11 release.

Suggested-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
Signed-off-by: Phil Yang <phil.yang@arm.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
Acked-by: David Marchand <david.marchand@redhat.com>
4 years agombuf: use C11 atomic builtins for refcnt
Phil Yang [Fri, 17 Jul 2020 04:36:50 +0000 (12:36 +0800)]
mbuf: use C11 atomic builtins for refcnt

Use C11 atomic builtins with explicit ordering instead of rte_atomic
ops which enforce unnecessary barriers on aarch64.

Suggested-by: Olivier Matz <olivier.matz@6wind.com>
Suggested-by: Dodji Seketeli <dodji@redhat.com>
Signed-off-by: Phil Yang <phil.yang@arm.com>
Reviewed-by: Ruifeng Wang <ruifeng.wang@arm.com>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
4 years agotest/crypto: skip unsupported cases
Akhil Goyal [Thu, 16 Jul 2020 19:07:13 +0000 (00:37 +0530)]
test/crypto: skip unsupported cases

blockcipher cases are either returning TEST_SUCCESS
or TEST_FAILED as status, but the test may not be
supported by the PMD which is also a success case
for the PMD. Hence checking for status == TEST_FAILED
for setting the overall status as failed.

Signed-off-by: Akhil Goyal <akhil.goyal@nxp.com>
Reviewed-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Ankur Dwivedi <adwivedi@marvell.com>
4 years agoexamples/ipsec-secgw: enable flow based distribution
Anoob Joseph [Fri, 17 Jul 2020 12:31:10 +0000 (18:01 +0530)]
examples/ipsec-secgw: enable flow based distribution

RTE_FLOW API allows hardware parsing and steering of packets to specific
queues which helps in distributing ingress traffic across various cores.
Adding 'flow' rules allows user to specify the distribution required.

Signed-off-by: Anoob Joseph <anoobj@marvell.com>
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
4 years agoapp/testpmd: fix typos
Viacheslav Ovsiienko [Wed, 15 Jul 2020 10:30:35 +0000 (10:30 +0000)]
app/testpmd: fix typos

Fix minor typos.

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

Signed-off-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
4 years agonet/virtio-user: fix uninitialized reply-ack variable
Chenbo Xia [Tue, 14 Jul 2020 11:03:05 +0000 (11:03 +0000)]
net/virtio-user: fix uninitialized reply-ack variable

This patch fixes an issue that uninitialized has_reply_ack
is used for setting message flags.

Coverity issue: 360834
Fixes: c60208dd6384 ("net/virtio-user: support reply-ack")

Signed-off-by: Chenbo Xia <chenbo.xia@intel.com>
Acked-by: Adrian Moreno <amorenoz@redhat.com>
4 years agonet/ice: fix IPv6 NAT-T ESP
Jeff Guo [Thu, 16 Jul 2020 07:29:00 +0000 (15:29 +0800)]
net/ice: fix IPv6 NAT-T ESP

The hash for ipv6 nat-t esp should be enable as ipv4 nat-t esp.

Fixes: dadf70e5c30a ("net/ice: enable additional input set for RSS hash")

Signed-off-by: Jeff Guo <jia.guo@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
4 years agonet/i40e: fix queue pairs configuration in VF
Alvin Zhang [Thu, 16 Jul 2020 06:33:36 +0000 (14:33 +0800)]
net/i40e: fix queue pairs configuration in VF

If a VF request PF to allocate more number of queue pairs, the PF will
free the queue pairs which have been allocated and reset the VF. So,
VF should stop to work until all the process is done. This patch modify
the process of the request queue pairs. To improve efficiency and
eliminate code redundancy, the promiscuous ops were also updated.

Fixes: c48eb308ed13 ("net/i40e: support VF request more queues")
Cc: stable@dpdk.org
Signed-off-by: Alvin Zhang <alvinx.zhang@intel.com>
Acked-by: Jeff Guo <jia.guo@intel.com>
4 years agonet/ice/base: fix GTPU IP hash
Jeff Guo [Thu, 16 Jul 2020 07:30:41 +0000 (15:30 +0800)]
net/ice/base: fix GTPU IP hash

Enable GTPU SESSION flag usage to fix GTPU IP hash issue.

Fixes: 8fb908838516 ("net/ice/base: improve GTPU extend header handle")
Cc: stable@dpdk.org
Signed-off-by: Jeff Guo <jia.guo@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
4 years agonet/ice: fix RSS type
Simei Su [Thu, 16 Jul 2020 03:24:54 +0000 (11:24 +0800)]
net/ice: fix RSS type

When a RSS rule with only SRC/DST_ONLY or IPV6 prefix RSS type,
it should return failure. Besides, when a RSS rule with symmetric
hash function, the RSS type shouldn't carry with SRC/DST_ONLY.
This patch adds invalid RSS type check for the two cases.

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

Signed-off-by: Simei Su <simei.su@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
4 years agonet/ice: fix tunnel type get
Wei Zhao [Thu, 16 Jul 2020 01:42:12 +0000 (09:42 +0800)]
net/ice: fix tunnel type get

When function ice_get_tun_type_for_recipe() get tunnel type,
for ICE_NON_TUN we need to include gtp-c and some gtp-u ptype
with no payload, as they do not have tunnel packet as paylod.

Fixes: 418d2563d10b ("net/ice/base: get tunnel type for recipe")

Signed-off-by: Wei Zhao <wei.zhao1@intel.com>
Tested-by: Nannan Lu <nannan.lu@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
4 years agonet/bonding: fix MAC address when one port resets
Wei Hu (Xavier) [Fri, 17 Apr 2020 08:19:18 +0000 (16:19 +0800)]
net/bonding: fix MAC address when one port resets

The current bonding PMD driver call mac_address_slaves_update function
to modify the MAC address of all slaves devices. In
mac_address_slaves_update function, the rte_eth_dev_default_mac_addr_set
API function is called to set the MAC address of the slave devices in
turn in the for loop statement.

When one port reset, calling rte_eth_dev_default_mac_addr_set API fails
because the firmware will not respond to the commands from the driver,
and exit the loop, so other slave devices cannot continue to update the
MAC address.

This patch fixes the issue by avoid exiting the loop when calling
rte_eth_dev_default_mac_addr_set fails.

Fixes: 2efb58cbab6e ("bond: new link bonding library")
Cc: stable@dpdk.org
Signed-off-by: Hongbo Zheng <zhenghongbo3@huawei.com>
Signed-off-by: Wei Hu (Xavier) <xavier.huwei@huawei.com>
Signed-off-by: Chunsong Feng <fengchunsong@huawei.com>
Signed-off-by: Xuan Li <lixuan47@hisilicon.com>
4 years agonet/bonding: fix MAC address when switching active port
Wei Hu (Xavier) [Fri, 17 Apr 2020 08:19:17 +0000 (16:19 +0800)]
net/bonding: fix MAC address when switching active port

Currently, based on a active-backup bond device, when the link status of
the primary port changes from up to down, one slave port changes to the
primary port, but the new primary port's MAC address cannot change to
the bond device's MAC address. And we can't continue receive packets
whose destination MAC addresses are the same as the bond devices's MAC
address.

The current bonding PMD driver call mac_address_slaves_update function
to modify the MAC address of all slaves devices: the primary port using
bond device's MAC address, and other slaves devices using the respective
MAC address. We found that one error using primary_port instead of
current_primary_port in mac_address_slaves_update function.

On the other hand, The current bonding PMD driver sets slave devices's
MAC address according to the variable named current_primary_port. The
variable named current_primary_port changes in the following scenario:
1. Add the slave devices to bond, the first slave port will be regarded
   as the current_primary_port. If changing the order of adding the
   slave devices, the value of the variable named current_primary_port
   will be different.
2. The upper application specifies primary_port via calling the
   rte_eth_bond_primary_set API function.
3. Delete the primary slave device.
4. The link status of the primary port changes from up to down.

We have tested the above 4 cases and found that there are problems that
the new primary port's MAC address didn't change to the bond device's
MAC address when running case 3 and 4. When current_primary_port
changes, the new primary port's MAC address should change at the same
time. We also need to call mac_address_slaves_update function to update
MAC addresses in case
3 and 4.

Bugzilla ID: 256
Fixes: 2efb58cbab6e ("bond: new link bonding library")
Cc: stable@dpdk.org
Signed-off-by: Chunsong Feng <fengchunsong@huawei.com>
Signed-off-by: Wei Hu (Xavier) <xavier.huwei@huawei.com>
4 years agonet/bnxt: fix crash during Tx
Ajit Khaparde [Mon, 13 Jul 2020 05:17:59 +0000 (10:47 +0530)]
net/bnxt: fix crash during Tx

When TRUFLOW is not enabled ulp_ctx is not allocated.
In non-vector Tx datapath we are accessing this invalid pointer
resulting in a segfault. Check if TRUFLOW is enabled before
accessing ulp_ctx to avoid this.

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

Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Signed-off-by: Somnath Kotur <somnath.kotur@broadcom.com>
Reviewed-by: Venkat Duvvuru <venkatkumar.duvvuru@broadcom.com>
4 years agonet/af_packet: fix munmap on init failure
Yunjian Wang [Mon, 6 Jul 2020 12:28:02 +0000 (20:28 +0800)]
net/af_packet: fix munmap on init failure

Add a missing available check and fix the wrong address passed
to munmap on init failure.

Fixes: dd6590fe2fd7 ("af_packet: fix possible memory leak")
Cc: stable@dpdk.org
Signed-off-by: Yunjian Wang <wangyunjian@huawei.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
4 years agonet/af_packet: fix memory leak on init failure
Yunjian Wang [Mon, 6 Jul 2020 12:27:51 +0000 (20:27 +0800)]
net/af_packet: fix memory leak on init failure

Add missing code to free memory when the device initialization fails.

Fixes: ccd37d341e8d ("net/af_packet: remove queue number limitation")
Fixes: 5f19dee604ed ("drivers/net: do not use private ethdev data")
Cc: stable@dpdk.org
Signed-off-by: Yunjian Wang <wangyunjian@huawei.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
4 years agonet/af_packet: fix check of file descriptors
Yunjian Wang [Mon, 6 Jul 2020 12:27:32 +0000 (20:27 +0800)]
net/af_packet: fix check of file descriptors

Zero is a valid fd. It will fail to check the fd if the fd is zero.

Fixes: 527740ccfaec ("af_packet: fix some leaks")
Cc: stable@dpdk.org
Signed-off-by: Yunjian Wang <wangyunjian@huawei.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
4 years agonet/bonding: fix error code on device creation
Wei Hu (Xavier) [Tue, 14 Jul 2020 08:19:43 +0000 (16:19 +0800)]
net/bonding: fix error code on device creation

Because the return value of rte_vdev_init() has multiple non-zero
values, when rte_vdev_init() return non-zero in the
rte_eth_bond_create() function, it should return the actual error code
rather than -ENOMEM.

Fixes: 68451eb6698c ("net/bonding: call through EAL on create/free")
Cc: stable@dpdk.org
Signed-off-by: Wei Hu (Xavier) <xavier.huwei@huawei.com>
4 years agoapp/testpmd: fix output format in flow query
Chenxu Di [Tue, 14 Jul 2020 01:37:21 +0000 (01:37 +0000)]
app/testpmd: fix output format in flow query

This patch fix the error line break in the output format of flow query

Fixes: bdb1d61690f7 ("app/testpmd: support RSS config in flow query")

Signed-off-by: Chenxu Di <chenxux.di@intel.com>
Tested-by: Phil Yang <phil.yang@arm.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
4 years agonet/hns3: fix RSS configuration on empty RSS type
Lijun Ou [Tue, 14 Jul 2020 06:16:09 +0000 (14:16 +0800)]
net/hns3: fix RSS configuration on empty RSS type

According to the definition of RSS types of action attributes from
testpmd, the driver will not disable RSS but instead requests the
unspecified "best-effort" settings when upper application call
rte_flow_create API function to create flow using empty RSS types.

As a result, here use the default RSS types when RSS types is empty.

Fixes: c37ca66f2b27 ("net/hns3: support RSS")
Cc: stable@dpdk.org
Signed-off-by: Lijun Ou <oulijun@huawei.com>
Signed-off-by: Wei Hu (Xavier) <xavier.huwei@huawei.com>
4 years agonet/hns3: support keeping CRC
Min Hu (Connor) [Tue, 14 Jul 2020 06:16:08 +0000 (14:16 +0800)]
net/hns3: support keeping CRC

CRC is the end of frame, which occupies 4 bytes. Keeping CRC is a
feature of MAC, which will not strip CRC field when receiving frames.
The feature can be enabled using DEV_RX_OFFLOAD_KEEP_CRC offload by
upper level application. And the feature is only supported for hns3 PF
PMD driver, not supported for hns3 VF PMD driver

Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
Signed-off-by: Wei Hu (Xavier) <xavier.huwei@huawei.com>
4 years agonet/hns3: support 200G speed rate
Wei Hu (Xavier) [Tue, 14 Jul 2020 06:16:07 +0000 (14:16 +0800)]
net/hns3: support 200G speed rate

The 200G device has a new device id 0xA228, so adds this device id
to pci table for pci driver can probe it. Similar to the network port
with other speed, the hns3 PMD driver gets 200G speed information
from firmware, and passes them to DPDK framework.

Signed-off-by: Wei Hu (Xavier) <xavier.huwei@huawei.com>
4 years agonet/hns3: support copper media type
Wei Hu (Xavier) [Tue, 14 Jul 2020 06:16:06 +0000 (14:16 +0800)]
net/hns3: support copper media type

The hns3 network engine is built-in multiple SoCs, such as kunpeng 920,
kunpeng 930, etc. The PCI revision id is 0x21 in kunpeng 920, and the
PCI revision id is 0x30 in kunpeng 930.

Copper media type is supported for hns3 PF device in kunpeng 930 and
later SoCs. The configuration operation for PHY is implemented by
firmware.

Signed-off-by: Wei Hu (Xavier) <xavier.huwei@huawei.com>
4 years agonet/ice/base: fix RSS removal for GTP-U
Junfeng Guo [Mon, 13 Jul 2020 11:05:40 +0000 (19:05 +0800)]
net/ice/base: fix RSS removal for GTP-U

Previous logic in removing RSS for GTPU was added in incorrect lines.
The adjustment in this patch will correct the code order so that RSS
for GTPU can be removed successfully.

We also delete the redundant print statement and cleanup the coding
style in this patch.

Fixes: bed9bb3139ef ("net/ice/base: fix GTP-U inner RSS IPv4 IPv6 co-exist")
Cc: stable@dpdk.org
Signed-off-by: Junfeng Guo <junfeng.guo@intel.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
4 years agodoc: update QAT driver version for D15xx
Adam Dybkowski [Thu, 16 Jul 2020 11:40:44 +0000 (13:40 +0200)]
doc: update QAT driver version for D15xx

This patch updates the minimum driver version that supports
Intel QuickAssist device D15xx.

Signed-off-by: Adam Dybkowski <adamx.dybkowski@intel.com>
Acked-by: Fiona Trahe <fiona.trahe@intel.com>
4 years agocrypto/qat: fix ambiguous variable names for CRC
David Coyle [Thu, 16 Jul 2020 15:34:36 +0000 (16:34 +0100)]
crypto/qat: fix ambiguous variable names for CRC

The variable names crc_length and crc_offset have been changed to
crc_data_len and crc_data_ofs respectively, to make it clearer as to
their use i.e. the length and offset of the data over which the CRC is
calculated.

Fixes: 6f0ef237404b ("crypto/qat: support DOCSIS protocol")

Signed-off-by: David Coyle <david.coyle@intel.com>
Acked-by: Fiona Trahe <fiona.trahe@intel.com>
4 years agocrypto/qat: check multi-segment buffers for DOCSIS
David Coyle [Thu, 16 Jul 2020 15:33:31 +0000 (16:33 +0100)]
crypto/qat: check multi-segment buffers for DOCSIS

Multi-segment mbufs are not supported for DOCSIS security protocol.
This patch adds an explicit check for this and returns an op error if
this case is found. This limitation is also added to the QAT cryptodev
documentation.

Fixes: 6f0ef237404b ("crypto/qat: support DOCSIS protocol")

Signed-off-by: David Coyle <david.coyle@intel.com>
Acked-by: Fiona Trahe <fiona.trahe@intel.com>
4 years agocrypto/aesni_mb: fix memory leak in DOCSIS session
David Coyle [Thu, 16 Jul 2020 15:32:18 +0000 (16:32 +0100)]
crypto/aesni_mb: fix memory leak in DOCSIS session

This patch improves the DOCSIS session creation as follows:
- it validates the security action type as well as the protocol before
  creating a session and now does this validation before allocating the
  session from the mempool

Fixes: fda5216fba55 ("crypto/aesni_mb: support DOCSIS protocol")

Signed-off-by: David Coyle <david.coyle@intel.com>
Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
4 years agocrypto/qat: improve DOCSIS session creation
David Coyle [Thu, 16 Jul 2020 15:32:17 +0000 (16:32 +0100)]
crypto/qat: improve DOCSIS session creation

This patch improves the DOCSIS session creation as follows:
- it validates the security action type as well as the protocol before
  creating a session and now does this validation before allocating the
  session from the mempool
- it clears the entire private session struct before populating it with
  DOCSIS session info, in case any data was left over from the last time
  it was used
- it simplifies the DOCSIS parameter setting, which was overly
  complicated

Fixes: 6f0ef237404b ("crypto/qat: support DOCSIS protocol")

Signed-off-by: David Coyle <david.coyle@intel.com>
Acked-by: Fiona Trahe <fiona.trahe@intel.com>
4 years agoapp/crypto-perf: enable feature flag for security
David Coyle [Thu, 16 Jul 2020 15:29:52 +0000 (16:29 +0100)]
app/crypto-perf: enable feature flag for security

The RTE_CRYPTODEV_FF_SECURITY feature was disabled through the
ff_disable device configuration option for all crypto performance tests,
including security related tests. This patch updates the crypto
performance tool to not disable RTE_CRYPTODEV_FF_SECURITY for DOCSIS and
PDCP security tests.

Fixes: d4a131a9498d ("test/crypto-perf: support DOCSIS protocol")

Signed-off-by: David Coyle <david.coyle@intel.com>
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
4 years agotest/crypto: enable feature flag for security
David Coyle [Thu, 16 Jul 2020 15:29:51 +0000 (16:29 +0100)]
test/crypto: enable feature flag for security

The RTE_CRYPTODEV_FF_SECURITY feature was disabled through the
ff_disable device configuration option for all cryptodev tests,
including security related tests. This patch updates the cryptodev unit
tests to not disable RTE_CRYPTODEV_FF_SECURITY for DOCSIS and PDCP
security tests.

Fixes: ea31f2b4f547 ("test/crypto: add DOCSIS security cases")

Signed-off-by: David Coyle <david.coyle@intel.com>
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
4 years agotest/crypto: fix AESNI-MB CPU tests
David Coyle [Thu, 16 Jul 2020 15:28:31 +0000 (16:28 +0100)]
test/crypto: fix AESNI-MB CPU tests

The AESNI-MB CPU test cases, which are executed via the
cryptodev_cpu_aesni_mb_autotest command, aborted when it tried to run
the DOCSIS security tests as these are not CPU type tests. The abort
happened at the following line in process_crypto_request():

RTE_VERIFY(gbl_action_type != RTE_SECURITY_ACTION_TYPE_CPU_CRYPTO);

The tests have been updated not to run the DOCSIS (or PDCP) security
tests during cryptodev_cpu_aesni_mb_autotest, with the decision based on
improved PMD security capability checks.

Fixes: ea31f2b4f547 ("test/crypto: add DOCSIS security cases")

Signed-off-by: David Coyle <david.coyle@intel.com>
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
4 years agocrypto/octeontx2: support security session data path
Vamsi Attunuru [Thu, 16 Jul 2020 08:39:31 +0000 (14:09 +0530)]
crypto/octeontx2: support security session data path

This patch adds lookaside IPsec enqueue and dequeue routines.

Signed-off-by: Vamsi Attunuru <vattunuru@marvell.com>
Signed-off-by: Tejasree Kondoj <ktejasree@marvell.com>
Acked-by: Anoob Joseph <anoobj@marvell.com>
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
4 years agocrypto/octeontx2: support security session create
Vamsi Attunuru [Thu, 16 Jul 2020 08:39:30 +0000 (14:09 +0530)]
crypto/octeontx2: support security session create

This patch creates session for lookaside IPsec.

Signed-off-by: Vamsi Attunuru <vattunuru@marvell.com>
Signed-off-by: Tejasree Kondoj <ktejasree@marvell.com>
Acked-by: Anoob Joseph <anoobj@marvell.com>
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
4 years agocrypto/octeontx2: add security misc callbacks
Vamsi Attunuru [Thu, 16 Jul 2020 08:39:29 +0000 (14:09 +0530)]
crypto/octeontx2: add security misc callbacks

This patch adds lookaside IPsec callback functions.

Signed-off-by: Vamsi Attunuru <vattunuru@marvell.com>
Signed-off-by: Tejasree Kondoj <ktejasree@marvell.com>
Acked-by: Anoob Joseph <anoobj@marvell.com>
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
4 years agocrypto/octeontx2: add security capabilities
Tejasree Kondoj [Thu, 16 Jul 2020 08:39:28 +0000 (14:09 +0530)]
crypto/octeontx2: add security capabilities

This patch adds lookaside IPsec capabilities for
rte_security

Signed-off-by: Vamsi Attunuru <vattunuru@marvell.com>
Signed-off-by: Tejasree Kondoj <ktejasree@marvell.com>
Acked-by: Anoob Joseph <anoobj@marvell.com>
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
4 years agocrypto/octeontx2: register security operations
Tejasree Kondoj [Thu, 16 Jul 2020 08:39:27 +0000 (14:09 +0530)]
crypto/octeontx2: register security operations

This patch registers security operations with cryptodev.

Signed-off-by: Vamsi Attunuru <vattunuru@marvell.com>
Signed-off-by: Tejasree Kondoj <ktejasree@marvell.com>
Acked-by: Anoob Joseph <anoobj@marvell.com>
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
4 years agocrypto/octeontx2: add lookaside SA context definitions
Tejasree Kondoj [Thu, 16 Jul 2020 08:39:26 +0000 (14:09 +0530)]
crypto/octeontx2: add lookaside SA context definitions

This patch adds lookaside IPsec SA context definitions.

Signed-off-by: Vamsi Attunuru <vattunuru@marvell.com>
Signed-off-by: Tejasree Kondoj <ktejasree@marvell.com>
Acked-by: Anoob Joseph <anoobj@marvell.com>
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
4 years agonet/octeontx2: move security session struct to crypto PMD
Tejasree Kondoj [Thu, 16 Jul 2020 08:39:25 +0000 (14:09 +0530)]
net/octeontx2: move security session struct to crypto PMD

This patch moves otx2_sec_session structure to otx2_security.h
to make it common for inline and lookaside protocol modes of
rte_security

Signed-off-by: Tejasree Kondoj <ktejasree@marvell.com>
Acked-by: Anoob Joseph <anoobj@marvell.com>
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
4 years agocrypto/octeontx2: move capabilities init into probe
Tejasree Kondoj [Thu, 16 Jul 2020 08:39:24 +0000 (14:09 +0530)]
crypto/octeontx2: move capabilities init into probe

This patch moves capabilities initialization into probe.

Signed-off-by: Tejasree Kondoj <ktejasree@marvell.com>
Acked-by: Anoob Joseph <anoobj@marvell.com>
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
4 years agocompress/qat: revert change in GEN3 marketing name
Adam Dybkowski [Mon, 13 Jul 2020 11:25:17 +0000 (13:25 +0200)]
compress/qat: revert change in GEN3 marketing name

The patch reverts the commit that updated Intel QuickAssist GEN3
marketing name. The change was not backported and has to be withdrawn.

This reverts commit 9cd9d3e702fba4700539c1a2eddac13dd14ecf70

Signed-off-by: Adam Dybkowski <adamx.dybkowski@intel.com>
Acked-by: Fiona Trahe <fiona.trahe@intel.com>
4 years agocompress/qat: fix lacking memzone lookup
Arek Kusztal [Wed, 8 Jul 2020 09:44:01 +0000 (11:44 +0200)]
compress/qat: fix lacking memzone lookup

Because capability memzone of compression does not have lookup
call, second and subsequent devices cannot be created.

Fixes: 7788dceccb80 ("common/qat: add multi-process handling of capabilities")

Signed-off-by: Arek Kusztal <arkadiuszx.kusztal@intel.com>
Acked-by: Adam Dybkowski <adamx.dybkowski@intel.com>
Tested-by: Yu Jiang <yux.jiang@intel.com>
4 years agoexamples/fips_validation: fix count overwrite for TDES
Archana Muniganti [Thu, 11 Jun 2020 13:44:17 +0000 (19:14 +0530)]
examples/fips_validation: fix count overwrite for TDES

Application updates first line of each test vector with
COUNT = i(where i = 1,2,3..) assuming first line contains
COUNT string. But few of the TDES input test vectors don't
contain COUNT string and thus COUNT is getting overwritten on
other data.

Fixes: 527cbf3d5ee3 ("examples/fips_validation: support TDES parsing")
Cc: stable@dpdk.org
Signed-off-by: Archana Muniganti <marchana@marvell.com>
Signed-off-by: Kanaka Durga Kotamarthy <kkotamarthy@marvell.com>
4 years agoexamples/fips_validation: fix parsing of TDES vectors
Ayuj Verma [Thu, 11 Jun 2020 13:44:16 +0000 (19:14 +0530)]
examples/fips_validation: fix parsing of TDES vectors

Processing of test vector for COUNT = 0 is getting skipped, as
some of the NIST TDES files doesn't have an empty line after
[ENCRYPT]/[DECRYPT] and thus treated as an interim block.

Parse function now identifies such blocks, separates out interim
and test vector data, and then parses each with their respective
callbacks.

Fixes: 3d0fad56b74a ("examples/fips_validation: add crypto FIPS application")
Cc: stable@dpdk.org
Signed-off-by: Archana Muniganti <marchana@marvell.com>
Signed-off-by: Ayuj Verma <ayverma@marvell.com>
4 years agoexamples/fips_validation: fix TDES interim callback
Archana Muniganti [Thu, 11 Jun 2020 13:44:15 +0000 (19:14 +0530)]
examples/fips_validation: fix TDES interim callback

Fix missing callback registration and the incorrect
callback definition for interim NK_STR. The callback
should compare input key against the interim.

Fixes: 527cbf3d5ee3 ("examples/fips_validation: support TDES parsing")
Cc: stable@dpdk.org
Signed-off-by: Archana Muniganti <marchana@marvell.com>
4 years agotest/crypto: change cipher offset for ESN vector
Ankur Dwivedi [Fri, 5 Jun 2020 08:30:33 +0000 (14:00 +0530)]
test/crypto: change cipher offset for ESN vector

In the IPSEC ESN test vector the cipher offset for encryption
should be 8 bytes which is the size of esp header.
This patch also changes the ciphertext and the digest reference
data against which the operation result is validated.

Fixes: 699741912d71 ("test/crypto: add case for auth only trailer")
Cc: stable@dpdk.org
Signed-off-by: Ankur Dwivedi <adwivedi@marvell.com>
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
4 years agocrypto/scheduler: use ring peek API
Konstantin Ananyev [Fri, 22 May 2020 11:57:36 +0000 (12:57 +0100)]
crypto/scheduler: use ring peek API

scheduler PMD uses its own hand-made peek functions
that directly access rte_ring internals.
As now rte_ring has an API for that type of functionality -
change scheduler PMD to use API provided by rte_ring.

Signed-off-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
Acked-by: Fan Zhang <roy.fan.zhang@intel.com>
4 years agotelemetry: add upper limit on connections
Ciara Power [Wed, 15 Jul 2020 15:03:00 +0000 (16:03 +0100)]
telemetry: add upper limit on connections

This patch limits the number of client connections to the new telemetry
socket. The limit is set to 10.

Signed-off-by: Ciara Power <ciara.power@intel.com>
4 years agoapp/flow-perf: fix typo in usage help
Wisam Jaddo [Mon, 6 Jul 2020 07:58:45 +0000 (07:58 +0000)]
app/flow-perf: fix typo in usage help

From hairping-rss into hairpin-rss.

Fixes: bf3688f1e816 ("app/flow-perf: add insertion rate calculation")

Signed-off-by: Wisam Jaddo <wisamm@mellanox.com>
4 years agoapp/flow-perf: fix hairpin queues setup
Wisam Jaddo [Thu, 16 Jul 2020 14:16:56 +0000 (14:16 +0000)]
app/flow-perf: fix hairpin queues setup

The hairpin queue is the one that start from normal rxq,
and will be less than nr_queues where nr_queues is the
sum of normal and hairpin.

Fixes: bf3688f1e816 ("app/flow-perf: add insertion rate calculation")

Signed-off-by: Wisam Jaddo <wisamm@mellanox.com>
Reviewed-by: Asaf Penso <asafp@mellanox.com>
4 years agodevtools: prevent use of legacy atomic API
Phil Yang [Fri, 17 Jul 2020 10:14:37 +0000 (18:14 +0800)]
devtools: prevent use of legacy atomic API

In order to deprecate the rte_atomic and rte_smp barrier APIs [1], prevent
the patches from using these APIs and __sync builtins in new code.
Please use __atomic builtins instead of __sync builtins, rte_atomicNN_xxx
and rte_smp_[r/w]mb APIs.

On x86 the __atomic_thread_fence(__ATOMIC_SEQ_CST) is quite expensive for
SMP case. Flag the new code which use __atomic_thread_fence API.
Please use rte_thread_fence API instead of __atomic_thread_fence builtins.

1: Refer to the locks-and-atomic-operations section in
https://doc.dpdk.org/guides/prog_guide/writing_efficient_code.html

Signed-off-by: Phil Yang <phil.yang@arm.com>
Reviewed-by: Ruifeng Wang <ruifeng.wang@arm.com>
4 years agoeal: add wrapper for C11 atomic thread fence
Phil Yang [Fri, 17 Jul 2020 10:14:36 +0000 (18:14 +0800)]
eal: add wrapper for C11 atomic thread fence

Provide a wrapper for __atomic_thread_fence builtins to support
optimized code for __ATOMIC_SEQ_CST memory order for x86 platforms.

Suggested-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
Signed-off-by: Phil Yang <phil.yang@arm.com>
Reviewed-by: Ola Liljedahl <ola.liljedahl@arm.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
4 years agodoc: describe optimizations using C11 atomic builtins
Phil Yang [Fri, 17 Jul 2020 10:14:35 +0000 (18:14 +0800)]
doc: describe optimizations using C11 atomic builtins

Add information about possible optimizations using C11 atomic builtins.

Signed-off-by: Phil Yang <phil.yang@arm.com>
Signed-off-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
4 years agometrics: fix header installation with meson
Ciara Power [Tue, 14 Jul 2020 12:39:12 +0000 (13:39 +0100)]
metrics: fix header installation with meson

If Jansson was found, the headers list is overwritten when including
rte_metrics_telemetry.h, which prevents rte_metrics.h from being
installed. This is now fixed to add to headers, rather than overwrite,
to allow both headers be installed when Jansson is present.

Fixes: c5b7197f662e ("telemetry: move some functions to metrics library")
Cc: stable@dpdk.org
Signed-off-by: Ciara Power <ciara.power@intel.com>
Acked-by: David Marchand <david.marchand@redhat.com>
4 years agoexamples/vm_power: allow managing idle cores
Rory Sexton [Tue, 14 Jul 2020 16:01:59 +0000 (17:01 +0100)]
examples/vm_power: allow managing idle cores

This change is required to allow the branch ratio algorithm to
power manage cores with no workload running on them. This is
useful both when idle cores don't use C-states and for a number of
hyperthreading scenarios.

Signed-off-by: Rory Sexton <rory.sexton@intel.com>
Reviewed-by: David Hunt <david.hunt@intel.com>
Acked-by: Reshma Pattan <reshma.pattan@intel.com>
4 years agoexamples/vm_power: make branch ratio threshold per core
Rory Sexton [Tue, 14 Jul 2020 16:01:58 +0000 (17:01 +0100)]
examples/vm_power: make branch ratio threshold per core

This modification allows for the branch ratio threshold to be set
per core rather than system wide. This gives greater flexibility to
the branch ratio monitoring allowing it to manage different
workloads with different characteristics on the same system.

Signed-off-by: Rory Sexton <rory.sexton@intel.com>
Reviewed-by: David Hunt <david.hunt@intel.com>
Acked-by: Reshma Pattan <reshma.pattan@intel.com>
4 years agoeal: change the log level for test asserts
Honnappa Nagarahalli [Thu, 16 Jul 2020 18:39:27 +0000 (13:39 -0500)]
eal: change the log level for test asserts

Change the log level for RTE_TEST_ASSERT macro to error to help
log errors while running test cases.

Suggested-by: David Marchand <david.marchand@redhat.com>
Signed-off-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
Acked-by: Aaron Conole <aconole@redhat.com>
Acked-by: Lukasz Wojciechowski <l.wojciechow@partner.samsung.com>
4 years agodevtools: give some hints for ABI errors
David Marchand [Wed, 8 Jul 2020 09:40:46 +0000 (11:40 +0200)]
devtools: give some hints for ABI errors

abidiff can provide some more information about the ABI difference it
detected.
In all cases, a discussion on the mailing must happen but we can give
some hints to know if this is a problem with the script calling abidiff,
a potential ABI breakage or an unambiguous ABI breakage.

Signed-off-by: David Marchand <david.marchand@redhat.com>
Acked-by: Ray Kinsella <mdr@ashroe.eu>
Acked-by: Neil Horman <nhorman@tuxdriver.com>
Acked-by: Aaron Conole <aconole@redhat.com>
4 years agolpm: fix build dependency on RCU library
Ferruh Yigit [Mon, 13 Jul 2020 13:51:20 +0000 (14:51 +0100)]
lpm: fix build dependency on RCU library

'librte_rcu' is now dependency to 'librte_lpm' library, this dependency
should be reflected to build system.

Fixes: 8a9f8564e9f9 ("lpm: implement RCU rule reclamation")

Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
Reviewed-by: Ruifeng Wang <ruifeng.wang@arm.com>
Acked-by: Ray Kinsella <mdr@ashroe.eu>
4 years agoversion: 20.08-rc1
Thomas Monjalon [Mon, 13 Jul 2020 00:50:06 +0000 (02:50 +0200)]
version: 20.08-rc1

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
4 years agoapp/testpmd: add eCPRI in flow creation patterns
Bing Zhao [Sun, 12 Jul 2020 13:35:03 +0000 (21:35 +0800)]
app/testpmd: add eCPRI in flow creation patterns

In order to verify offloading of eCPRI protocol via flow rules, the
command line of flow creation should support the parsing of the eCPRI
pattern.

Based on the specification, one eCPRI message will have the common
header and payload. Payload format is various based on the type field
of the common header. Fixed strings will be used instead of integer
to make the CLI easy for auto-completion.

The testpmd command line examples of flow to match eCPRI item are
listed below:
  1. flow create 0 ... pattern eth / ecpri / end actions ...
    This is to match all eCPRI messages.
  2. flow create 0 ... pattern eth / ecpri common type rtc_ctrl / end actions ...
    This is to match all eCPRI messages with the type #2 - "Real-Time
    Control Data".
  3. flow create 0 ... pattern eth / ecpri common type iq_data pc_id is [U16Int] / end actions ...
    This is to match eCPRI messages with the type #0 - "IQ Data", and
    the physical channel ID 'pc_id' of the messages is a specific
    value. Since the sequence ID is changeable, there is no need to
    match that field in the flow.
Currently, only type #0, #2 and #5 will be supported.

Since eCPRI could be over Ethernet layer (or after .1Q) and UDP
layer, it is the PMD driver's responsibility to check whether eCPRI
is supported and which protocol stack is supported. Network byte
order should be used for eCPRI header, the same as other headers.

Signed-off-by: Bing Zhao <bingz@mellanox.com>
Acked-by: Ori Kam <orika@mellanox.com>
4 years agoethdev: add eCPRI key fields to flow API
Bing Zhao [Sun, 12 Jul 2020 13:35:02 +0000 (21:35 +0800)]
ethdev: add eCPRI key fields to flow API

Add a new item "rte_flow_item_ecpri" in order to match eCRPI header.

eCPRI is a packet based protocol used in the fronthaul interface of
5G networks. Header format definition could be found in the
specification via the link below:
https://www.gigalight.com/downloads/standards/ecpri-specification.pdf

eCPRI message can be over Ethernet layer (.1Q supported also) or over
UDP layer. Message header formats are the same in these two variants.

Signed-off-by: Bing Zhao <bingz@mellanox.com>
Acked-by: Ori Kam <orika@mellanox.com>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
4 years agonet/bnxt: fix freeing filters on flow creation failure
Kalesh AP [Thu, 9 Jul 2020 09:38:32 +0000 (15:08 +0530)]
net/bnxt: fix freeing filters on flow creation failure

This patch does following things:
1. Added a wrapper function bnxt_clear_one_vnic_filter()
   for destroying the filters in hw. This will avoid duplicate
   code in many places.
2. When flow create fails due to an already existing mark id
   for the new flow id created, fixed to destroy the hw
   filter created.
3. Re-arranged code to move a log and list update to right place.

Fixes: 9db66782bd06 ("net/bnxt: fix supporting zero mark ID with RSS action")
Fixes: 5ef3b79fdfe6 ("net/bnxt: support flow filter ops")
Cc: stable@dpdk.org
Signed-off-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Reviewed-by: Somnath Kotur <somnath.kotur@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
4 years agonet/bnxt: fix flow error on filter creation
Kalesh AP [Thu, 9 Jul 2020 09:38:31 +0000 (15:08 +0530)]
net/bnxt: fix flow error on filter creation

If set_em_filter/set_ntuple_filter cmds fails for some reason,
driver is not filling the "rte_flow_error" string buffer.
Same is the case when flow create fails due to an already
existing mark id for the new flow id created.
This leads to a crash in testpmd while trying to print the
error message.

Fixes: 5c1171c97216 ("net/bnxt: refactor filter/flow")
Fixes: 9db66782bd06 ("net/bnxt: fix supporting zero mark ID with RSS action")
Cc: stable@dpdk.org
Signed-off-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
4 years agonet/bnxt: fix unnecessary HWRM command
Kalesh AP [Thu, 9 Jul 2020 09:38:30 +0000 (15:08 +0530)]
net/bnxt: fix unnecessary HWRM command

During probe, driver issues HWRM_CFA_ADV_FLOW_MGNT_QCAPS command.
But it is not using the command response anywhere which makes the
fw call redundant.

Remove the unnecessary HWRM_CFA_ADV_FLOW_MGNT_QCAPS call to fw.
Remove the redundant flow_flags in bnxt struct.

Fixes: afef822b2e1b ("net/bnxt: support creating SMAC and inner DMAC filters")
Cc: stable@dpdk.org
Signed-off-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Reviewed-by: Somnath Kotur <somnath.kotur@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
4 years agonet/bnxt: remove unused enum declaration
Kalesh AP [Thu, 9 Jul 2020 09:38:29 +0000 (15:08 +0530)]
net/bnxt: remove unused enum declaration

"enum bnxt_hw_context" is defined in the header file, but is not
used anywhere.

Fixes: 9738793f28ec ("net/bnxt: add VNIC functions and structs")
Cc: stable@dpdk.org
Signed-off-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
4 years agonet/bnxt: fix unnecessary memory allocation
Kalesh AP [Thu, 9 Jul 2020 09:38:28 +0000 (15:08 +0530)]
net/bnxt: fix unnecessary memory allocation

VFs are not privileged to issue HWRM_PORT_LED_QCFG/CFG.
There is no need to allocate "bp->leds" memory.

Fixes: 205b74295282 ("net/bnxt: fix allocation of LED config info")
Cc: stable@dpdk.org
Signed-off-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Reviewed-by: Somnath Kotur <somnath.kotur@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
4 years agonet/bonding: fix LACP negotiation
Yicai Lu [Fri, 10 Jul 2020 03:29:35 +0000 (11:29 +0800)]
net/bonding: fix LACP negotiation

When two host is connected directly without any devices like switch,
rx_machine_update would receiving partner LACP negotiation packets,
and partner's port mac is filled with zeros in this packet, which is
different with internal's mode4 mac. So in this situation, it would
never go rx_machine branch and then execute mac swap for negotiation!
Thus bond mode 4 will negotiation failed.

Fixes: 56cbc0817399 ("net/bonding: fix LACP negotiation")
Cc: stable@dpdk.org
Signed-off-by: Yicai Lu <luyicai@huawei.com>
Reviewed-by: Wei Hu (Xavier) <xavier.huwei@huawei.com>
4 years agoapp/testpmd: add 5-tuple swap forwarding engine
Shiri Kuzin [Thu, 2 Jul 2020 15:16:14 +0000 (18:16 +0300)]
app/testpmd: add 5-tuple swap forwarding engine

The new 5-tuple swap engine swaps:
source and destination mac address,
source and destination address in ipv4/ipv6,
source and destination port in UDP/TCP.

The forwarding engine will parse each layer
and swap it, and will stop when the next
layer doesn't match.

The mentioned headers of ICMP/ARP/Multicast
packets will be swapped as well according to
matching layers.

usage: --forward-mode=5tswap

Signed-off-by: Shiri Kuzin <shirik@mellanox.com>
Acked-by: Matan Azrad <matan@mellanox.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
4 years agodrivers/net: delete HW rings while freeing queues
Renata Saiakhova [Fri, 10 Jul 2020 21:43:43 +0000 (22:43 +0100)]
drivers/net: delete HW rings while freeing queues

Delete memzones for HW rings in igb and ixgbe while freeing queues

Updated igb, ixgbe, i40e, ice & em drivers.

Signed-off-by: Renata Saiakhova <renata.saiakhova@ekinops.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
4 years agoethdev: add function to release HW rings
Renata Saiakhova [Fri, 10 Jul 2020 21:43:42 +0000 (22:43 +0100)]
ethdev: add function to release HW rings

Free previously allocated memzone for HW rings

Signed-off-by: Renata Saiakhova <renata.saiakhova@ekinops.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Andrew Rybchenko <arybchenko@solarflare.com>
4 years agodrivers/net: fix exposing internal headers
Ferruh Yigit [Fri, 10 Jul 2020 21:43:41 +0000 (22:43 +0100)]
drivers/net: fix exposing internal headers

Using '__rte_internal' tag in 'rte_ethdev_driver.h' causing build error
for applications and examples. Because they don't define
'ALLOW_INTERNAL_API' flag and '__rte_internal' causes the error.
This patch is preparation for future '__rte_internal' usage.

At first place, applications/examples should not include
'rte_ethdev_driver.h', this is happening because of PMD public header
files include 'rte_ethdev_driver.h' by mistake.

Updated PMD public header files to not include internal header files.

But for unit test application, 'app/test', enable accessing internal
APIs, since some unit tests need them.

Fixes: ffc905f3b856 ("ethdev: separate driver APIs")
Fixes: ec0dec44ecb9 ("net/atlantic: enable MACsec configuration")
Cc: stable@dpdk.org
Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Thomas Monjalon <thomas@monjalon.net>
4 years agonet/nfp: fix RSS hash configuration reporting
Heinrich Kuhn [Fri, 10 Jul 2020 14:28:46 +0000 (16:28 +0200)]
net/nfp: fix RSS hash configuration reporting

Prior to this fix the NFP PMD implementation of the .rss_hash_conf_get
callback did not propagate the current hardware state of rss_hf back up
to the caller. Users of the hash_conf_get callback would receive an
incorrect representation of what the RSS configuration currently is in
hardware.

Fixes: 934e4c60fbff ("nfp: add RSS")
Cc: stable@dpdk.org
Signed-off-by: Heinrich Kuhn <heinrich.kuhn@netronome.com>
Signed-off-by: Simon Horman <simon.horman@netronome.com>
4 years agoapp/testpmd: add Tx scheduling command
Viacheslav Ovsiienko [Fri, 10 Jul 2020 12:39:42 +0000 (12:39 +0000)]
app/testpmd: add Tx scheduling command

This commit adds testpmd capability to provide timestamps on the packets
being sent in the txonly mode. This includes:

 - SEND_ON_TIMESTAMP support
   new device Tx offload capability support added, example:

     testpmd> port config 0 tx_offload send_on_timestamp on

 - set txtimes, registers field and flag, example:

     testpmd> set txtimes 1000000,0

   This command enables the packet send scheduling on timestamps if
   the first parameter is not zero, generic format:

     testpmd> set txtimes (inter),(intra)

   where:

     inter - is the delay between the bursts in the device clock units.
     If "intra" (next parameter) is zero, this is the time between the
     beginnings of the first packets in the neighbour bursts, if "intra"
     is not zero, "inter" specifies the time between the beginning of
     the first packet of the current burst and the beginning of the last
     packet of the previous burst. If "inter"parameter is zero the send
     scheduling on timestamps is disabled (default).

     intra - is the delay between the packets within the burst specified
     in the device clock units. The number of packets in the burst is
     defined by regular burst setting. If "intra" parameter is zero no
     timestamps provided in the packets excepting  the first one in the
     burst.

     As the result the bursts of packet will be transmitted with
     specific delay between the packets within the burst and specific
     delay between the bursts. The rte_eth_read_clock() is supposed to
     be engaged to get the current device clock value and provide the
     reference for the timestamps. If there is no supported
     rte_eth_read_clock() there will be no provided send scheduling on
     the device.

 - show txtimes, displays the timing settings
 - txonly burst time pattern

Signed-off-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
4 years agombuf: introduce accurate packet Tx scheduling
Viacheslav Ovsiienko [Fri, 10 Jul 2020 12:39:41 +0000 (12:39 +0000)]
mbuf: introduce accurate packet Tx scheduling

There is the requirement on some networks for precise traffic timing
management. The ability to send (and, generally speaking, receive)
the packets at the very precisely specified moment of time provides
the opportunity to support the connections with Time Division
Multiplexing using the contemporary general purpose NIC without involving
an auxiliary hardware. For example, the supporting of O-RAN Fronthaul
interface is one of the promising features for potentially usage of the
precise time management for the egress packets.

The main objective of this patchset is to specify the way how applications
can provide the moment of time at what the packet transmission must be
started and to describe in preliminary the supporting this feature
from mlx5 PMD side [1].

The new dynamic timestamp field is proposed, it provides some timing
information, the units and time references (initial phase) are not
explicitly defined but are maintained always the same for a given port.
Some devices allow to query rte_eth_read_clock() that will return
the current device timestamp. The dynamic timestamp flag tells whether
the field contains actual timestamp value. For the packets being sent
this value can be used by PMD to schedule packet sending.

The device clock is opaque entity, the units and frequency are
vendor specific and might depend on hardware capabilities and
configurations. If might (or not) be synchronized with real time
via PTP, might (or not) be synchronous with CPU clock (for example
if NIC and CPU share the same clock source there might be no
any drift between the NIC and CPU clocks), etc.

After PKT_RX_TIMESTAMP flag and fixed timestamp field supposed
deprecation and obsoleting, these dynamic flag and field might be
used to manage the timestamps on receiving datapath as well. Having
the dedicated flags for Rx/Tx timestamps allows applications not
to perform explicit flags reset on forwarding and not to promote
received timestamps to the transmitting datapath by default.
The static PKT_RX_TIMESTAMP is considered as candidate to become
the dynamic flag and this move should be discussed.

When PMD sees the "rte_dynfield_timestamp" set on the packet being sent
it tries to synchronize the time of packet appearing on the wire with
the specified packet timestamp. If the specified one is in the past it
should be ignored, if one is in the distant future it should be capped
with some reasonable value (in range of seconds). These specific cases
("too late" and "distant future") can be optionally reported via
device xstats to assist applications to detect the time-related
problems.

There is no any packet reordering according timestamps is supposed,
neither within packet burst, nor between packets, it is an entirely
application responsibility to generate packets and its timestamps
in desired order. The timestamps can be put only in the first packet
in the burst providing the entire burst scheduling.

PMD reports the ability to synchronize packet sending on timestamp
with new offload flag:

This is palliative and might be replaced with new eth_dev API
about reporting/managing the supported dynamic flags and its related
features. This API would break ABI compatibility and can't be introduced
at the moment, so is postponed to 20.11.

For testing purposes it is proposed to update testpmd "txonly"
forwarding mode routine. With this update testpmd application generates
the packets and sets the dynamic timestamps according to specified time
pattern if it sees the "rte_dynfield_timestamp" is registered.

The new testpmd command is proposed to configure sending pattern:

set tx_times <burst_gap>,<intra_gap>

<intra_gap> - the delay between the packets within the burst
              specified in the device clock units. The number
              of packets in the burst is defined by txburst parameter

<burst_gap> - the delay between the bursts in the device clock units

As the result the bursts of packet will be transmitted with specific
delays between the packets within the burst and specific delay between
the bursts. The rte_eth_read_clock is supposed to be engaged to get the
current device clock value and provide the reference for the timestamps.

[1] http://patches.dpdk.org/patch/73714/

Signed-off-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
4 years agonet: use named constants for deprecated QinQ TPIDs
Ivan Malov [Fri, 19 Jun 2020 09:21:15 +0000 (10:21 +0100)]
net: use named constants for deprecated QinQ TPIDs

Add named constants for deprecated QinQ TPIDs.
Update drivers which have already been using existing
TPID named constants from librte_net to use the
new named constants rather than magic numbers.

Signed-off-by: Ivan Malov <ivan.malov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>