dpdk.git
3 years agonet/txgbe: update link setup process of backplane NICs
Jiawen Wu [Mon, 29 Mar 2021 03:17:21 +0000 (11:17 +0800)]
net/txgbe: update link setup process of backplane NICs

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

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

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

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

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

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

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

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

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

Remove OS restriction and update release notes.

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

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

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

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

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

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

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

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

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

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

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

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

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

Update i40e PMD firmware/driver mapping table.

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Check return value of rte_kvargs_process()

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Matching on PPPoE fields is not supported.

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

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

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

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

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

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

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

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

This patch added oerrors stats for PF in kunpeng930.

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

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

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

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

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

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

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

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

Signed-off-by: Chengchang Tang <tangchengchang@huawei.com>
Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
3 years agonet/hns3: add runtime config to select IO burst function
Chengwen Feng [Tue, 23 Mar 2021 11:21:00 +0000 (19:21 +0800)]
net/hns3: add runtime config to select IO burst function

Currently, the driver support multiple IO burst function and auto
selection of the most appropriate function based on offload
configuration.

Most applications such as l2fwd/l3fwd don't provide the means to
change offload configuration, so it will use the auto selection's io
burst function.

This patch support runtime config to select io burst function, which
add two config: rx_func_hint and tx_func_hint, both could assign
vec/sve/simple/common.

The driver will use the following rules to select io burst func:
a. if hint equal vec and meet the vec Rx/Tx usage condition then use the
   neon function.
b. if hint equal sve and meet the sve Rx/Tx usage condition then use the
   sve function.
c. if hint equal simple and meet the simple Rx/Tx usage condition then
   use the simple function.
d. if hint equal common then use the common function.
e. if hint not set then:
e.1. if meet the vec Rx/Tx usage condition then use the neon function.
e.2. if meet the simple Rx/Tx usage condition then use the simple
     function.
e.3. else use the common function.

Note: the sve Rx/Tx usage condition based on the vec Rx/Tx usage
condition and runtime environment (which must support SVE).

In the previous versions, driver will preferred use the sve function
when meet the sve Rx/Tx usage condition, but in this case driver could
get better performance if use the neon function.

Signed-off-by: Chengwen Feng <fengchengwen@huawei.com>
Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
3 years agonet/cxgbe: disable Rx during port link down
Rahul Lakkireddy [Mon, 15 Mar 2021 21:51:46 +0000 (03:21 +0530)]
net/cxgbe: disable Rx during port link down

When link goes down, disable the port's Rx path to drop the incoming
traffic closer to the wire, instead of accepting them in for further
Rx processing, only to eventually drop them at the port's RxQs. This
prevents unnecessary congestion in the Rx path. The port's Rx path
will be re-enabled once the link up event is received in the firmware
event queue.

Signed-off-by: Rahul Lakkireddy <rahul.lakkireddy@chelsio.com>
3 years agocommon/sfc_efx: remove GENEVE from supported tunnels
Andrew Rybchenko [Thu, 11 Mar 2021 12:25:39 +0000 (15:25 +0300)]
common/sfc_efx: remove GENEVE from supported tunnels

The first GA of the SN1022 does not support Geneve.

Fixes: d874d2a149ed ("common/sfc_efx/base: support UDP tunnel operations for EF100")
Cc: stable@dpdk.org
Signed-off-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
3 years agonet/sfc: improve tunnel TSO mask calculation
Andrew Rybchenko [Thu, 11 Mar 2021 12:25:38 +0000 (15:25 +0300)]
net/sfc: improve tunnel TSO mask calculation

Corresponding tunnel TSO is not supported if the tunnel is not
supported.

Signed-off-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
3 years agonet/sfc: support action VXLAN decap in transfer rules
Ivan Malov [Fri, 12 Mar 2021 11:07:45 +0000 (14:07 +0300)]
net/sfc: support action VXLAN decap in transfer rules

If there is no VXLAN among pattern items, the action will be turned down.

Signed-off-by: Ivan Malov <ivan.malov@oktetlabs.ru>
Reviewed-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
Reviewed-by: Andy Moreton <amoreton@xilinx.com>
3 years agocommon/sfc_efx/base: support adding decap action to a set
Ivan Malov [Fri, 12 Mar 2021 11:07:44 +0000 (14:07 +0300)]
common/sfc_efx/base: support adding decap action to a set

The action has no arguments.

Signed-off-by: Ivan Malov <ivan.malov@oktetlabs.ru>
Reviewed-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
Reviewed-by: Andy Moreton <amoreton@xilinx.com>
3 years agonet/sfc: support action VXLAN encap in MAE backend
Ivan Malov [Fri, 12 Mar 2021 11:07:43 +0000 (14:07 +0300)]
net/sfc: support action VXLAN encap in MAE backend

Provide necessary facilities for handling this action.

Signed-off-by: Ivan Malov <ivan.malov@oktetlabs.ru>
Reviewed-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
Reviewed-by: Andy Moreton <amoreton@xilinx.com>
3 years agonet/sfc: change MAE rule actions parsing parameter
Igor Romanov [Fri, 12 Mar 2021 11:07:42 +0000 (14:07 +0300)]
net/sfc: change MAE rule actions parsing parameter

Current API signature makes it hard to add other entities that
belong to a flow specification. Pass the flow specification
so that additional members can be accessed through the spec.

Signed-off-by: Igor Romanov <igor.romanov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
Reviewed-by: Andy Moreton <amoreton@xilinx.com>
Reviewed-by: Ivan Malov <ivan.malov@oktetlabs.ru>
3 years agocommon/sfc_efx/base: support adding encap action to a set
Ivan Malov [Fri, 12 Mar 2021 11:07:41 +0000 (14:07 +0300)]
common/sfc_efx/base: support adding encap action to a set

For convenience, there are two separate APIs provided, one for
adding the action and one for setting the encap. header ID.
This design allows the client driver to first build the action
set specification (which validates the order of the actions)
and, if everything is correct, proceed with allocation of the
resource utilised by the action set (encap. header). This
facilitates clarity of the client code and its efficiency.

Signed-off-by: Ivan Malov <ivan.malov@oktetlabs.ru>
Reviewed-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
Reviewed-by: Andy Moreton <amoreton@xilinx.com>
3 years agocommon/sfc_efx/base: support encap header provisioning
Ivan Malov [Fri, 12 Mar 2021 11:07:40 +0000 (14:07 +0300)]
common/sfc_efx/base: support encap header provisioning

Let the client allocate / free encap. headers.

Signed-off-by: Ivan Malov <ivan.malov@oktetlabs.ru>
Reviewed-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
Reviewed-by: Andy Moreton <amoreton@xilinx.com>
3 years agoethdev: reuse VXLAN header definition in flow item
Ivan Malov [Fri, 12 Mar 2021 11:07:39 +0000 (14:07 +0300)]
ethdev: reuse VXLAN header definition in flow item

One ought to reuse existing header structs in flow items.

Signed-off-by: Ivan Malov <ivan.malov@oktetlabs.ru>
Reviewed-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
Reviewed-by: Andy Moreton <amoreton@xilinx.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
3 years agonet: clarify endianness of 32-bit fields in VXLAN headers
Ivan Malov [Fri, 12 Mar 2021 11:07:38 +0000 (14:07 +0300)]
net: clarify endianness of 32-bit fields in VXLAN headers

These fields have network byte order. Highlight it using dedicated type.

Signed-off-by: Ivan Malov <ivan.malov@oktetlabs.ru>
Reviewed-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
Reviewed-by: Andy Moreton <amoreton@xilinx.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
3 years agoethdev: reuse VLAN header definition in flow item
Ivan Malov [Fri, 12 Mar 2021 11:07:37 +0000 (14:07 +0300)]
ethdev: reuse VLAN header definition in flow item

One ought to reuse existing header structs in flow items.
This particular item contains non-header fields, so it's
important to keep the header fields in a separate struct.

Signed-off-by: Ivan Malov <ivan.malov@oktetlabs.ru>
Reviewed-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
Reviewed-by: Andy Moreton <amoreton@xilinx.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
3 years agoethdev: reuse ethernet header definition in flow item
Ivan Malov [Fri, 12 Mar 2021 11:07:36 +0000 (14:07 +0300)]
ethdev: reuse ethernet header definition in flow item

One ought to reuse existing header structs in flow items.
This particular item contains non-header fields, so it's
important to keep the header fields in a separate struct.

Signed-off-by: Ivan Malov <ivan.malov@oktetlabs.ru>
Reviewed-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
Reviewed-by: Andy Moreton <amoreton@xilinx.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
3 years agonet/ark: localize internal packet generator
Ed Czeck [Thu, 18 Mar 2021 17:37:00 +0000 (13:37 -0400)]
net/ark: localize internal packet generator

Remove unnecessary includes, no functional changes

Signed-off-by: Ed Czeck <ed.czeck@atomicrules.com>
3 years agonet/ark: generalize meta data between FPGA and PMD
Ed Czeck [Thu, 18 Mar 2021 17:36:59 +0000 (13:36 -0400)]
net/ark: generalize meta data between FPGA and PMD

In this commit we generalize the movement of user-specified
meta data between mbufs and FPGA AXIS tuser fields using
user-defined hook functions.

- Previous use of PMD dynfields are removed
- Remove emptied rte_pmd_ark.h
- Hook function added to ark_user_ext
- Add hook function calls in Rx and Tx paths
- Update guide with example of hook function use

Signed-off-by: Ed Czeck <ed.czeck@atomicrules.com>
3 years agonet/ark: cleanup dynamic extension interface
Ed Czeck [Thu, 18 Mar 2021 17:36:58 +0000 (13:36 -0400)]
net/ark: cleanup dynamic extension interface

- Rename extension functions with rte_pmd_ark prefix
- Update local function documentation

Signed-off-by: Ed Czeck <ed.czeck@atomicrules.com>
3 years agonet/ark: update to reflect FPGA updates
Ed Czeck [Thu, 18 Mar 2021 17:36:57 +0000 (13:36 -0400)]
net/ark: update to reflect FPGA updates

- New PCIe IDs using net/ark driver
- Update Version IDs and structures specified by hardware
- New internal descriptor status for TX
- Adjust data placement in RX operations, headroom in retained for
  segmented mbufs

Signed-off-by: Ed Czeck <ed.czeck@atomicrules.com>
3 years agonet/ark: refactor Rx buffer recovery
Ed Czeck [Thu, 18 Mar 2021 17:36:56 +0000 (13:36 -0400)]
net/ark: refactor Rx buffer recovery

Allocate mbufs for Rx path in bulk of at least 64 buffers
to improve performance. Allow recovery even without
a Rx operation to support lack of buffers in pool.

Fixes: be410a861598 ("net/ark: add recovery for lack of mbufs")
Cc: stable@dpdk.org
Signed-off-by: Ed Czeck <ed.czeck@atomicrules.com>
3 years agonet/ark: update packet director initial state
Ed Czeck [Thu, 18 Mar 2021 17:36:55 +0000 (13:36 -0400)]
net/ark: update packet director initial state

Fixes: b33ccdb17f55 ("net/ark: provide API for hardware modules MPU RQP and pktdir")
Cc: stable@dpdk.org
Signed-off-by: Ed Czeck <ed.czeck@atomicrules.com>
3 years agotelemetry: cleanup internal header
David Marchand [Fri, 26 Mar 2021 08:24:47 +0000 (09:24 +0100)]
telemetry: cleanup internal header

The experimental banner can be removed.
Every in-tree file is compiled with _GNU_SOURCE, so RTE_HAS_CPUSET is
unneeded for an internal header.

Fixes: 0e64ae618e10 ("telemetry: move init function to internal header")

Signed-off-by: David Marchand <david.marchand@redhat.com>
Acked-by: Thomas Monjalon <thomas@monjalon.net>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Ciara Power <ciara.power@intel.com>
3 years agomem: fix cleanup when multi-process is disabled
Dmitry Kozlyuk [Wed, 24 Mar 2021 19:32:26 +0000 (22:32 +0300)]
mem: fix cleanup when multi-process is disabled

rte_eal_memory_detach() did not account for cases where multi-process
mode is disabled: --in-memory and --no-shconf. This resulted
in unmapping memory that had not been mapped, which caused errors:

    EAL: Could not unmap memory: No error   (Windows)
    EAL: Cannot munmap(0x1d47f40, 0x7000): Invalid argument  (Linux)

Confusing "No error" was caused by using errno instead of rte_errno
set by rte_mem_unmap().

Skip detaching memory altogether when --in-memory is specified.
Skip unmapping configuration when it's not shared.
Fix and add error handling to produce proper log messages.

Fixes: dfbc61a2f9a6 ("mem: detach memsegs on cleanup")

Reported-by: Jie Zhou <jizh@microsoft.com>
Suggested-by: David Marchand <david.marchand@redhat.com>
Signed-off-by: Dmitry Kozlyuk <dmitry.kozliuk@gmail.com>
Acked-by: Ranjit Menon <ranjit.menon@intel.com>
Acked-by: Anatoly Burakov <anatoly.burakov@intel.com>
3 years agoeal: rename thread TLS API
Tal Shnaiderman [Tue, 16 Mar 2021 13:28:19 +0000 (15:28 +0200)]
eal: rename thread TLS API

Rename the key opaque pointer from rte_tls_key to
rte_thread_key to avoid confusion with transport layer security.

Also rename and remove the "_tls" term from the following
functions to avoid redundancy:

rte_thread_tls_key_create
rte_thread_tls_key_delete
rte_thread_tls_value_set
rte_thread_tls_value_get

Suggested-by: Vladimir Medvedkin <vladimir.medvedkin@intel.com>
Suggested-by: Morten Brørup <mb@smartsharesystems.com>
Signed-off-by: Tal Shnaiderman <talshn@nvidia.com>
Acked-by: Morten Brørup <mb@smartsharesystems.com>
3 years agoeal: add error numbers in thread TLS API
Tal Shnaiderman [Tue, 16 Mar 2021 13:28:18 +0000 (15:28 +0200)]
eal: add error numbers in thread TLS API

Add error number reporting to rte_errno in all
functions in the rte_thread_tls_* API.

Suggested-by: Anatoly Burakov <anatoly.burakov@intel.com>
Signed-off-by: Tal Shnaiderman <talshn@nvidia.com>
Acked-by: Dmitry Kozlyuk <dmitry.kozliuk@gmail.com>
3 years agousertools: show hugepages requested/set on failure
Thomas Monjalon [Mon, 8 Mar 2021 22:25:20 +0000 (23:25 +0100)]
usertools: show hugepages requested/set on failure

In case the number of requested hugepages cannot be set,
a more detailed error message is printed.
The new message does not mention "reserve" because setting
can be reserving or clearing.
The filename and numbers requested/set are printed to ease debugging.

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
3 years agousertools: check 0-division with hugepage size
Thomas Monjalon [Sun, 21 Mar 2021 09:09:03 +0000 (10:09 +0100)]
usertools: check 0-division with hugepage size

The default page size can be None, and the page size from user request
can be 0 kB if lower than 1024. In these cases, a division will fail.
In order to avoid a Python exception, the page size is checked
and an error message "Invalid page size" is printed.

A similar error message is printed in set_hugepages()
if the size is not supported, except at this stage the message can be
completed with "Valid page sizes".
Unfortunately the first check is too early to print such information.

A third error message can be printed in a different place (get_memsize)
in case of a format issue, e.g. a negative size.
The function get_memsize() is also used for total requested size,
so the error message "not a valid page size" was potentially wrong.
This message is replaced with the more general "is not a valid size".

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Acked-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Anatoly Burakov <anatoly.burakov@intel.com>
3 years agousertools: print process name when telemetry connects
Bruce Richardson [Tue, 16 Feb 2021 11:39:21 +0000 (11:39 +0000)]
usertools: print process name when telemetry connects

When the dpdk-telemetry client connects to a DPDK instance, we can use the
PID provided in the initial connection message to query from /proc the name
of the process we are connected to, and display that to the user. We use
the "cmdline" procfs entry for the query since that is available on both
Linux and FreeBSD (assuming procfs is mounted on the BSD instance).

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Anatoly Burakov <anatoly.burakov@intel.com>
Acked-by: Kevin Laatz <kevin.laatz@intel.com>
3 years agousertools: add file-prefix option for telemetry
Kevin Laatz [Tue, 16 Feb 2021 11:50:08 +0000 (11:50 +0000)]
usertools: add file-prefix option for telemetry

Currently the dpdk-telemetry.py script connects to all running DPDK apps
consecutively. With the addition of this file-prefix argument, we can limit
the amount of information returned providing improved consumability and
precision to the user.

Signed-off-by: Kevin Laatz <kevin.laatz@intel.com>
Reviewed-by: Bruce Richardson <bruce.richardson@intel.com>
Tested-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Anatoly Burakov <anatoly.burakov@intel.com>
3 years agomaintainers: update for telemetry
Ciara Power [Thu, 25 Mar 2021 11:53:11 +0000 (11:53 +0000)]
maintainers: update for telemetry

Replace Kevin Laatz with Ciara Power.

Signed-off-by: Ciara Power <ciara.power@intel.com>
Acked-by: Kevin Laatz <kevin.laatz@intel.com>
3 years agotelemetry: move init function to internal header
Bruce Richardson [Thu, 25 Mar 2021 13:57:07 +0000 (13:57 +0000)]
telemetry: move init function to internal header

The rte_telemetry_init() function is for EAL use only, so can be moved to
the internal header rather than being in the public one.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Ciara Power <ciara.power@intel.com>
3 years agotelemetry: rename internal-only header file
Bruce Richardson [Thu, 25 Mar 2021 13:57:06 +0000 (13:57 +0000)]
telemetry: rename internal-only header file

The header file containing the legacy telemetry function prototypes was all
internal-only, so we rename the file to be an internal-only one to make it
clearer it's not for installation.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Ciara Power <ciara.power@intel.com>
3 years agotelemetry: make the legacy registration function internal
Bruce Richardson [Thu, 25 Mar 2021 13:57:05 +0000 (13:57 +0000)]
telemetry: make the legacy registration function internal

The function for registration of callbacks for legacy telemetry was
documented as internal-only in the API documents, but marked as
experimental in the version.map file. Since this is an internal-only
function, for consistency we update the version mapping to have it as
internal.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Ciara Power <ciara.power@intel.com>
3 years agotelemetry: use log function from pointer
Bruce Richardson [Thu, 25 Mar 2021 13:57:04 +0000 (13:57 +0000)]
telemetry: use log function from pointer

Rather than passing back an error string to the caller, take as input the
rte_log function to use, and just use regular logging.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Ciara Power <ciara.power@intel.com>
3 years agotest: fix autotest handling of skipped tests
Thinh Tran [Mon, 2 Mar 2020 20:41:32 +0000 (15:41 -0500)]
test: fix autotest handling of skipped tests

- When running the default configuration of autotest of the make test
  it'd take 900 seconds (15 minutes) for the script TIMEOUT and marks
  Failed for a specific device test that is not supported on the
  system under test.
- Adding the checking for those tests, print out as "Skipped [Not Run]"
  quickly return and continue for next test

Fixes: da0af48a67a5 ("test: add skipped return result")
Cc: stable@dpdk.org
Signed-off-by: Thinh Tran <thinhtr@linux.vnet.ibm.com>
Reviewed-by: David Christensen <drc@linux.vnet.ibm.com>
3 years agopower: check sysfs base frequency
David Hunt [Tue, 16 Mar 2021 09:38:11 +0000 (09:38 +0000)]
power: check sysfs base frequency

Some kernels may show in incorrect value for base frequency in
sysfs (e.g. 15 GHz). This throws off the SST-BF algorithm for
high and low priority cores. So if base_frequency is greater
than max turbo frequency, ignore, and handle it as a normal
core.

Known Kernel version with issue: Linux 5.8.7

Signed-off-by: David Hunt <david.hunt@intel.com>
3 years agopipeline: add meter array to SWX
Cristian Dumitrescu [Tue, 16 Mar 2021 11:40:39 +0000 (11:40 +0000)]
pipeline: add meter array to SWX

Meter arrays are stateful objects that are updated by the data plane
and configured & monitored by the control plane. The meters implement
the RFC 2698 Two Rate Three Color Marker (trTCM) algorithm.

Signed-off-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
3 years agopipeline: add register array to SWX
Cristian Dumitrescu [Tue, 16 Mar 2021 11:40:38 +0000 (11:40 +0000)]
pipeline: add register array to SWX

Register arrays are stateful objects that can be read & modified by
both the data plane and the control plane, as opposed to tables, which
are read-only for data plane. One key use-case is the implementation
of stats counters.

Signed-off-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
3 years agopipeline: fix instruction translation
Cristian Dumitrescu [Wed, 24 Mar 2021 11:36:03 +0000 (11:36 +0000)]
pipeline: fix instruction translation

The SWX pipeline instructions work with operands of different types:
header fields (h.header.field), packet meta-data (m.field), extern
object mailbox field (e.obj.field), extern function (f.field), action
data read from table entries (t.field), or immediate values; hence the
HMEFTI acronym.

For some pipeline instructions (add/sub, srl/shr, jmplt/jmpgt), only
the H, M and I cases were handled, while the E, F and T cases were
disregarded. This is what we fix here.

Fixes: baf7999303d0 ("pipeline: introduce SWX add instruction")
Fixes: c88c62943818 ("pipeline: introduce SWX subtract instruction")
Fixes: b09ba6d0a3c2 ("pipeline: introduce SWX SHL instruction")
Fixes: e0f51638b715 ("pipeline: introduce SWX SHR instruction")
Fixes: b3947e25bed4 ("pipeline: introduce SWX jump and return instructions")
Cc: stable@dpdk.org
Signed-off-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
3 years agoexamples/pipeline: support hexadecimal argument in CLI
Churchill Khangar [Wed, 24 Mar 2021 12:22:33 +0000 (08:22 -0400)]
examples/pipeline: support hexadecimal argument in CLI

This patch allows specification of integer arguments for the
CLI commands in hexadecimal and octal as well as decimal.

Signed-off-by: Churchill Khangar <churchill.khangar@intel.com>
Acked-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
3 years agoexamples/packet_ordering: fix port configuration
Dapeng Yu [Fri, 19 Mar 2021 07:11:18 +0000 (15:11 +0800)]
examples/packet_ordering: fix port configuration

A global ethernet port configuration is assigned to local variable
because in this way the local variable may be updated as required. But
this local variable is not used as input of rte_eth_dev_configure() in
original implementation, and cause that fast mbuf free feature cannot
be enabled on port.

This patch use this local variable as input of rte_eth_dev_configure().

Fixes: 6833f919f56b ("examples/packet_ordering: convert to new ethdev offloads API")
Cc: stable@dpdk.org
Signed-off-by: Dapeng Yu <dapengx.yu@intel.com>
Acked-by: Reshma Pattan <reshma.pattan@intel.com>
3 years agoexamples/pipeline: make quanta configurable
Cristian Dumitrescu [Fri, 19 Feb 2021 14:26:19 +0000 (14:26 +0000)]
examples/pipeline: make quanta configurable

Make the pipeline instruction quanta configurable at build time.

Signed-off-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
3 years agoport: add file descriptor SWX port
Venkata Suresh Kumar P [Tue, 23 Mar 2021 18:05:03 +0000 (14:05 -0400)]
port: add file descriptor SWX port

Add the file descriptor input/output port type for the SWX pipeline.
File descriptor port type provides interface with the kernel network
stack. Example file descriptor port is TAP device.

Signed-off-by: Venkata Suresh Kumar P <venkata.suresh.kumar.p@intel.com>
Signed-off-by: Churchill Khangar <churchill.khangar@intel.com>
Acked-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
3 years agotable: add wildcard match table type
Cristian Dumitrescu [Tue, 16 Feb 2021 20:46:46 +0000 (20:46 +0000)]
table: add wildcard match table type

Add the widlcard match/ACL table type for the SWX pipeline, which is
used under the hood by the table instruction.

Signed-off-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
Signed-off-by: Churchill Khangar <churchill.khangar@intel.com>
3 years agotable: add table entry priority
Cristian Dumitrescu [Tue, 16 Feb 2021 20:46:45 +0000 (20:46 +0000)]
table: add table entry priority

Add support for table entry priority, which is required for the
wildcard match/ACL table type.

Signed-off-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
3 years agopipeline: support non-incremental table updates
Cristian Dumitrescu [Tue, 16 Feb 2021 20:46:44 +0000 (20:46 +0000)]
pipeline: support non-incremental table updates

Some table types (e.g. exact match/hash) allow for incremental table
updates, while others (e.g. wildcard match/ACL) do not. The former is
already supported, the latter is enabled by this patch.

Signed-off-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
3 years agopipeline: improve table entry parsing
Cristian Dumitrescu [Tue, 16 Feb 2021 20:46:43 +0000 (20:46 +0000)]
pipeline: improve table entry parsing

Improve the table entry parsing: better code structure, enable parsing
for the key field masks, allow comments and empty lines in the table
entry files.

Signed-off-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
Signed-off-by: Venkata Suresh Kumar P <venkata.suresh.kumar.p@intel.com>
Signed-off-by: Churchill Khangar <churchill.khangar@intel.com>
3 years agopipeline: improve table entry helpers
Cristian Dumitrescu [Tue, 16 Feb 2021 20:46:42 +0000 (20:46 +0000)]
pipeline: improve table entry helpers

Improve the internal table entry helper routines for key comparison,
entry duplication and checks.

Signed-off-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
3 years agotable: fix actions with different data size
Cristian Dumitrescu [Wed, 17 Mar 2021 11:42:07 +0000 (11:42 +0000)]
table: fix actions with different data size

The table layer provisions an action_id and action_data_size data
bytes for each table key. This action_data_size is a maximal amount,
as some actions (depending on action_id) can require zero or less data
bytes than the maximal action_data_size. This fix allows for actions
with different data sizes to co-exist within the same table.

Fixes: d0a00966618b ("table: add exact match SWX table")
Cc: stable@dpdk.org
Signed-off-by: Churchill Khangar <churchill.khangar@intel.com>
Signed-off-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
Acked-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
3 years agoport: add ring SWX port
Cristian Dumitrescu [Thu, 28 Jan 2021 18:55:12 +0000 (18:55 +0000)]
port: add ring SWX port

Add the ring input/output port type for the SWX pipeline.

Signed-off-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
3 years agoexamples/vhost_crypto: enhance getopt_long usage
Ibtisam Tariq [Thu, 4 Feb 2021 07:34:20 +0000 (07:34 +0000)]
examples/vhost_crypto: enhance getopt_long usage

Instead of using getopt_long return value, strcmp was used to
compare the input parameters with the struct option array. This
patch get rid of all those strcmp by directly binding each longopt
with an int enum. This is to improve readability and consistency in
all examples.

Bugzilla ID: 238

Reported-by: David Marchand <david.marchand@redhat.com>
Signed-off-by: Ibtisam Tariq <ibtisam.tariq@emumba.com>
Acked-by: Fan Zhang <roy.fan.zhang@intel.com>
Reviewed-by: David Marchand <david.marchand@redhat.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
3 years agoexamples/vhost: enhance getopt_long usage
Ibtisam Tariq [Thu, 4 Feb 2021 07:34:19 +0000 (07:34 +0000)]
examples/vhost: enhance getopt_long usage

Instead of using getopt_long return value, strcmp was used to
compare the input parameters with the struct option array. This
patch get rid of all those strcmp by directly binding each longopt
with an int enum. This is to improve readability and consistency in
all examples.

Bugzilla ID: 238

Reported-by: David Marchand <david.marchand@redhat.com>
Signed-off-by: Ibtisam Tariq <ibtisam.tariq@emumba.com>
Reviewed-by: David Marchand <david.marchand@redhat.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
3 years agoexamples/qos_sched: enhance getopt_long usage
Ibtisam Tariq [Thu, 4 Feb 2021 07:34:18 +0000 (07:34 +0000)]
examples/qos_sched: enhance getopt_long usage

Instead of using getopt_long return value, strcmp was used to
compare the input parameters with the struct option array. This
patch get rid of all those strcmp by directly binding each longopt
with an int enum. This is to improve readability and consistency in
all examples.

Bugzilla ID: 238

Reported-by: David Marchand <david.marchand@redhat.com>
Signed-off-by: Ibtisam Tariq <ibtisam.tariq@emumba.com>
Reviewed-by: David Marchand <david.marchand@redhat.com>
3 years agoexamples/performance-thread: enhance getopt_long usage
Ibtisam Tariq [Thu, 4 Feb 2021 07:34:17 +0000 (07:34 +0000)]
examples/performance-thread: enhance getopt_long usage

Instead of using getopt_long return value, strcmp was used to
compare the input parameters with the struct option array. This
patch get rid of all those strcmp by directly binding each longopt
with an int enum. This is to improve readability and consistency in
all examples.

Bugzilla ID: 238

Reported-by: David Marchand <david.marchand@redhat.com>
Signed-off-by: Ibtisam Tariq <ibtisam.tariq@emumba.com>
Reviewed-by: David Marchand <david.marchand@redhat.com>
3 years agoexamples/packet_ordering: enhance getopt_long usage
Ibtisam Tariq [Thu, 4 Feb 2021 07:34:16 +0000 (07:34 +0000)]
examples/packet_ordering: enhance getopt_long usage

Instead of using getopt_long return value, strcmp was used to
compare the input parameters with the struct option array. This
patch get rid of all those strcmp by directly binding each longopt
with an int enum. This is to improve readability and consistency in
all examples.

Bugzilla ID: 238

Reported-by: David Marchand <david.marchand@redhat.com>
Signed-off-by: Ibtisam Tariq <ibtisam.tariq@emumba.com>
Reviewed-by: David Marchand <david.marchand@redhat.com>
3 years agoexamples/l3fwd-acl: enhance getopt_long usage
Ibtisam Tariq [Thu, 4 Feb 2021 07:34:15 +0000 (07:34 +0000)]
examples/l3fwd-acl: enhance getopt_long usage

Instead of using getopt_long return value, strcmp was used to
compare the input parameters with the struct option array. This
patch get rid of all those strcmp by directly binding each longopt
with an int enum. This is to improve readability and consistency in
all examples.

Bugzilla ID: 238

Reported-by: David Marchand <david.marchand@redhat.com>
Signed-off-by: Ibtisam Tariq <ibtisam.tariq@emumba.com>
Reviewed-by: David Marchand <david.marchand@redhat.com>
3 years agoexamples/fips_validation: enhance getopt_long usage
Ibtisam Tariq [Thu, 4 Feb 2021 07:34:14 +0000 (07:34 +0000)]
examples/fips_validation: enhance getopt_long usage

Instead of using getopt_long return value, strcmp was used to
compare the input parameters with the struct option array. This
patch get rid of all those strcmp by directly binding each longopt
with an int enum. This is to improve readability and consistency in
all examples.

Bugzilla ID: 238

Reported-by: David Marchand <david.marchand@redhat.com>
Signed-off-by: Ibtisam Tariq <ibtisam.tariq@emumba.com>
Reviewed-by: David Marchand <david.marchand@redhat.com>
3 years agoexamples/bbdev: fix header include for musl
Thomas Monjalon [Thu, 25 Feb 2021 08:43:35 +0000 (09:43 +0100)]
examples/bbdev: fix header include for musl

The header file unistd.h should not be included from sys/ directory,
it is an error with musl libc.

Fixes: 1ffee690eaa1 ("examples/bbdev: add sample app")
Cc: stable@dpdk.org
Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Acked-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
Acked-by: David Marchand <david.marchand@redhat.com>
3 years agoapp/testpmd: fix build with musl
Natanael Copa [Thu, 5 Nov 2020 21:17:09 +0000 (22:17 +0100)]
app/testpmd: fix build with musl

1/ Improve portability by avoiding use of non-standard 'uint'.
Use uint8_t for hash_key_len as rss_key_len is a uint8_t type.
This solves following build error when building with musl libc:
    app/test-pmd/testpmd.h:813:29: error: unknown type name 'uint'

2/ In musl libc, stdout is of type (FILE * const).
Because of the const qualifier, a dark magic cast
must be achieved through uintptr_t.

Fixes: 8205e241b2b0 ("app/testpmd: add missing type to RSS hash commands")
Fixes: e977e4199a8d ("app/testpmd: add commands to load/unload BPF filters")
Cc: stable@dpdk.org
Signed-off-by: Natanael Copa <ncopa@alpinelinux.org>
Reviewed-by: Morten Brørup <mb@smartsharesystems.com>
Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Acked-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
Acked-by: David Marchand <david.marchand@redhat.com>
3 years agoevent/dlb: fix header includes for musl
Thomas Monjalon [Fri, 19 Mar 2021 09:20:42 +0000 (10:20 +0100)]
event/dlb: fix header includes for musl

The header file fcntl.h should not be included from sys/ directory
as done in dlb drivers, it is an error with musl libc.

Fixes: 19980083fd57 ("event/dlb: add eventdev probe")
Fixes: 5433956d5185 ("event/dlb2: add eventdev probe")
Cc: stable@dpdk.org
Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Acked-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
Acked-by: David Marchand <david.marchand@redhat.com>
Acked-by: Timothy McDaniel <timothy.mcdaniel@intel.com>
3 years agovdpa/mlx5: replace pthread functions unavailable in musl
Thomas Monjalon [Wed, 24 Feb 2021 23:05:10 +0000 (00:05 +0100)]
vdpa/mlx5: replace pthread functions unavailable in musl

1/ The function pthread_yield() does not exist in musl libc,
and can be replaced with sched_yield() after including sched.h.

2/ The function pthread_attr_setaffinity_np() does not exist in musl libc,
and can be replaced with pthread_setaffinity_np() after pthread_create().

Fixes: b7fa0bf4d5c6 ("vdpa/mlx5: fix polling threads scheduling")
Fixes: 5cf3fd3af4df ("vdpa/mlx5: add CPU core parameter to bind polling thread")
Cc: stable@dpdk.org
Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Acked-by: Matan Azrad <matan@nvidia.com>
Acked-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
Acked-by: David Marchand <david.marchand@redhat.com>
3 years agonet/igc: remove use of uint type
Thomas Monjalon [Thu, 25 Feb 2021 09:45:09 +0000 (10:45 +0100)]
net/igc: remove use of uint type

Improve portability (especially with musl libc)
by replacing the non-standard type 'uint' with 'size_t'.

Fixes: 746664d546fb ("net/igc: support flow API")
Cc: stable@dpdk.org
Suggested-by: David Marchand <david.marchand@redhat.com>
Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Acked-by: Haiyue Wang <haiyue.wang@intel.com>
Acked-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
Acked-by: David Marchand <david.marchand@redhat.com>
3 years agonet/cxgbe: remove use of uint type
Natanael Copa [Thu, 5 Nov 2020 21:17:10 +0000 (22:17 +0100)]
net/cxgbe: remove use of uint type

Improve portability by replacing non-standard 'uint' with 'unsigned int'.

This solves the build error with musl libc:

In file included from ../drivers/net/cxgbe/cxgbe.h:9,
                 from ../drivers/net/cxgbe/cxgbe_ethdev.c:37:
../drivers/net/cxgbe/base/common.h:201:4: error: unknown type name 'uint'
  201 |    uint synmapen:1; /* SYN Map Enable */
      |    ^~~~

Fixes: bfcb257d3014 ("net/cxgbe: enable RSS for VF")
Cc: stable@dpdk.org
Signed-off-by: Natanael Copa <ncopa@alpinelinux.org>
Reviewed-by: Morten Brørup <mb@smartsharesystems.com>
Acked-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
Acked-by: David Marchand <david.marchand@redhat.com>
3 years agobus/pci: support I/O port operations with musl
Thomas Monjalon [Thu, 5 Nov 2020 21:17:11 +0000 (22:17 +0100)]
bus/pci: support I/O port operations with musl

Add a fallback for non-GNU libc systems like musl libc for the
non-standard functions outl_p, outw_p and outb_p.

It solves the following errors when building with musl libc:
pci_uio.c: undefined reference to 'outw_p'
pci_uio.c: undefined reference to 'outl_p'
pci_uio.c: undefined reference to 'outb_p'

Bugzilla ID: 35
Fixes: 756ce64b1ecd ("eal: introduce PCI ioport API")
Cc: stable@dpdk.org
Reported-by: Natanael Copa <ncopa@alpinelinux.org>
Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Acked-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
Acked-by: David Marchand <david.marchand@redhat.com>
3 years agobus/dpaa: fix build with musl
Natanael Copa [Thu, 5 Nov 2020 21:17:12 +0000 (22:17 +0100)]
bus/dpaa: fix build with musl

The header files argp.h and error.h do not exist in musl libc.

Fix build with musl libc by using err(3) instead of
the GNU-specific error(3).

We could have used the identical errx("...: %s", strerror(ret))` but
strerror(3) is not thread-safe and the strerror_r variant has two
incompatible versions, one GNU specific and one XSI-compliant.
Avoid the mess by letting "err" use the thread-local errno.

This also fixes error message for kzmalloc failures which previously
would always have given "Unknown error -1", since that is what
strerror(-1) returns. Let "err" use the proper error message from errno
which is set by kzalloc.

Fixes: 9d32ef0f5d61 ("bus/dpaa: support creating dynamic HW portal")
Fixes: f09ede6c8fd1 ("bus/dpaa: add BMAN driver core")
Fixes: 5b22cf744689 ("bus/dpaa: introducing FMan configurations")
Fixes: 39f373cf015a ("bus/dpaa: add compatibility and helper macros")
Cc: stable@dpdk.org
Signed-off-by: Natanael Copa <ncopa@alpinelinux.org>
Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Acked-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
Acked-by: David Marchand <david.marchand@redhat.com>
3 years agobus/dpaa: fix 64-bit arch detection
Natanael Copa [Thu, 5 Nov 2020 21:17:13 +0000 (22:17 +0100)]
bus/dpaa: fix 64-bit arch detection

There is no standard saying that __WORDSIZE should be defined or in
what include it should be defined. Use RTE_ARCH_64 instead.

This solves a warning when building with musl libc:

 warning: "__WORDSIZE" is not defined, evaluates to 0 [-Wundef]

Fixes: 847ee3bd0d1f ("bus/dpaa: support FMAN frame queue lookup")
Cc: stable@dpdk.org
Signed-off-by: Natanael Copa <ncopa@alpinelinux.org>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
Acked-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
Acked-by: David Marchand <david.marchand@redhat.com>