dpdk.git
3 years agoethdev: fix data type in TC queues
Huisong Li [Sun, 27 Sep 2020 03:16:36 +0000 (11:16 +0800)]
ethdev: fix data type in TC queues

Currently, base and nb_queue in the tc_rxq and tc_txq information
of queue and TC mapping on both TX and RX paths are uint8_t.
However, these data will be truncated when queue number under a TC
is greater than 256. So it is necessary for base and nb_queue to
change from uint8_t to uint16_t.

Fixes: 89d6728c7837 ("ethdev: get DCB information")
Cc: stable@dpdk.org
Signed-off-by: Huisong Li <lihuisong@huawei.com>
Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
Reviewed-by: Wei Hu (Xavier) <xavier.huwei@huawei.com>
Reviewed-by: Dongdong Liu <liudongdong3@huawei.com>
Acked-by: Thomas Monjalon <thomas@monjalon.net>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
3 years agoethdev: move RSS expansion code to mlx5 driver
Dekel Peled [Thu, 24 Sep 2020 14:52:14 +0000 (17:52 +0300)]
ethdev: move RSS expansion code to mlx5 driver

Patch [1] added support for RSS flow expansion.
It was added in ethdev for public use, but until now it is used only
by MLX5 PMD.
To allow local changes in this code, this patch removes it from ethdev
and moves it to MLX5 PMD file.

[1] commit 4ed05fcd441b ("ethdev: add flow API to expand RSS flows")

Signed-off-by: Dekel Peled <dekelp@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
3 years agoethdev: fix RSS flow expansion in case of mismatch
Dekel Peled [Thu, 24 Sep 2020 14:52:13 +0000 (17:52 +0300)]
ethdev: fix RSS flow expansion in case of mismatch

Function rte_flow_expand_rss() is used to expand a flow rule with
partial pattern into several rules, to ensure all relevant packets
are matched.
It uses utility function rte_flow_expand_rss_item_complete(), to check
if the last valid item in the flow rule pattern needs to be completed.
For example the pattern "eth / ipv4 proto is 17 / end" will be completed
with a "udp" item.
This function returns "void" item in two cases:
1) The last item has empty spec, for example "eth / ipv4 / end".
2) The last itme has spec that can't be expanded for RSS.
   For example the pattern "eth / ipv4 proto is 47 / end" ends with IPv4
   item that has next protocol GRE.

In both cases the flow rule may be expanded, but in the second case such
expansion may create rules with invalid pattern.
For example "eth / ipv4 proto is 47 / udp / end".
In such a case the flow rule should not be expanded.

This patch updates function rte_flow_expand_rss_item_complete().
Return value RTE_FLOW_ITEM_TYPE_END is used to indicate the flow rule
should not be expanded.
In such a case, rte_flow_expand_rss() will return with the original flow
rule only, without any expansion.

Fixes: fc2dd8dd492f ("ethdev: fix expand RSS flows")
Cc: stable@dpdk.org
Signed-off-by: Dekel Peled <dekelp@nvidia.com>
Acked-by: Xiaoyu Min <jackmin@nvidia.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
Acked-by: Ori Kam <orika@nvidia.com>
3 years agoethdev: check if queues are allocated before getting info
Ferruh Yigit [Thu, 1 Oct 2020 18:14:02 +0000 (19:14 +0100)]
ethdev: check if queues are allocated before getting info

A crash is detected when '--txpkts=#' parameter provided to the testpmd,
this is because queue information is requested before queues have been
allocated.

Adding check to queue info APIs
('rte_eth_rx_queue_info_get()' & 'rte_eth_tx_queue_info_get')
to protect against similar cases.

Fixes: ba2fb4f022fc ("ethdev: check if queue setup when getting queue info")

Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
3 years agonet/qede: fix getting link details
Rasesh Mody [Fri, 2 Oct 2020 19:59:45 +0000 (12:59 -0700)]
net/qede: fix getting link details

This patch fixes get current link details, without this change the link
details can be inaccurate if proper lock is not acquired.

Fixes: 739a5b2f2b49 ("net/qede/base: use passed ptt handler")
Cc: stable@dpdk.org
Reported-by: Ferruh Yigit <ferruh.yigit@intel.com>
Signed-off-by: Rasesh Mody <rmody@marvell.com>
Signed-off-by: Igor Russkikh <irusskikh@marvell.com>
3 years agonet/mlx5: fix Rx queue count calculation
Alexander Kozyrev [Tue, 29 Sep 2020 18:36:23 +0000 (18:36 +0000)]
net/mlx5: fix Rx queue count calculation

There are a few discrepancies in the Rx queue count calculation.

The wrong index is used to calculate the number of used descriptors
in an Rx queue in case of the compressed CQE processing. The global
CQ index is used while we really need an internal index in a single
compressed session to get the right number of elements processed.

The total number of CQs should be used instead of the number of mbufs
to find out about the maximum number of Rx descriptors. These numbers
are not equal for the Multi-Packet Rx queue.

Allow the Rx queue count calculation for all possible Rx bursts since
CQ handling is the same for regular, vectorized, and multi-packet Rx
queues.

Fixes: 26f04883441a ("net/mlx5: support Rx queue count API")
Cc: stable@dpdk.org
Signed-off-by: Alexander Kozyrev <akozyrev@nvidia.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
3 years agonet/mlx5: fix meter table definitions
Suanming Mou [Wed, 30 Sep 2020 06:47:01 +0000 (14:47 +0800)]
net/mlx5: fix meter table definitions

As metering and metadata features were developed at the same time. The
metering and metadata tables are defined conflicted.

This cause the meter suffix flow jump to the same metadata table and
cause flow deadloop.

Adjust the metering table define to fix that issue.

Fixes: 46a5e6bc6a85 ("net/mlx5: prepare meter flow tables")
Cc: stable@dpdk.org
Signed-off-by: Suanming Mou <suanmingm@nvidia.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
3 years agonet/mlx5: fix DevX CQ attributes values
Dekel Peled [Wed, 30 Sep 2020 12:19:36 +0000 (15:19 +0300)]
net/mlx5: fix DevX CQ attributes values

Previous patch wrongly used rdma-core defined values, when preparing
attributes for creating DevX CQ object.
This patch adds the correct value definition and uses them instead.

Fixes: 08d1838f645a ("net/mlx5: implement CQ for Rx using DevX API")
Cc: stable@dpdk.org
Signed-off-by: Dekel Peled <dekelp@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
3 years agonet/bnxt: update HWRM structures
Ajit Khaparde [Tue, 22 Sep 2020 23:55:43 +0000 (16:55 -0700)]
net/bnxt: update HWRM structures

HWRM API to a newer 1.10.1.70 version.

Few fields have been renamed because of this.
rx_err_pkt -> rx_discard_pkts
rx_drop_pkts -> rx_error_pkts

tx_err_pkts -> tx_discard_pkts
tx_drop_pkts -> tx_error_pkts

link_signal_mode -> active_fec_signal_mode

tx_bd_long_hi.mss -> tx_bd_long_hi.kid_or_ts_high_mss
tx_bd_long_hi.hdr_size -> tx_bd_long_hi.kid_or_ts_low_hdr_size

Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
3 years agonet/bnxt: support RSS hash selection
Ajit Khaparde [Fri, 18 Sep 2020 23:33:41 +0000 (16:33 -0700)]
net/bnxt: support RSS hash selection

Add support to select RSS hash based on innermost or outermost
headers. If an application is started without any specific settings
the default mode configured by FW or HW shall be used.

Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
3 years agoethdev: use mbuf bulk free API
Stephen Hemminger [Wed, 30 Sep 2020 21:27:18 +0000 (14:27 -0700)]
ethdev: use mbuf bulk free API

The mbuf library now has routine to free multiple buffers.
Loop is no longer needed.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Reviewed-by: Andrew Rybchenko <arybchenko@solarflare.com>
3 years agonet/hns3: remove redundant return value assignment
Hongbo Zheng [Tue, 29 Sep 2020 12:01:17 +0000 (20:01 +0800)]
net/hns3: remove redundant return value assignment

When an error occurs in the reset process, -EIO is returned.
The assignment of ret here is redundant, so deleted it.

Signed-off-by: Hongbo Zheng <zhenghongbo3@huawei.com>
Signed-off-by: Wei Hu (Xavier) <xavier.huwei@huawei.com>
3 years agonet/hns3: check PCI config space reads
Hongbo Zheng [Tue, 29 Sep 2020 12:01:16 +0000 (20:01 +0800)]
net/hns3: check PCI config space reads

This patch add return value check when calling rte_pci_read_config
function.

Fixes: cea37e513329 ("net/hns3: fix FLR reset")
Cc: stable@dpdk.org
Signed-off-by: Hongbo Zheng <zhenghongbo3@huawei.com>
Signed-off-by: Wei Hu (Xavier) <xavier.huwei@huawei.com>
3 years agonet/hns3: support queue start and stop
Chengchang Tang [Tue, 29 Sep 2020 12:01:15 +0000 (20:01 +0800)]
net/hns3: support queue start and stop

The new generation hns3 network engine supports independent enabling and
disabling of a single Tx/Rx queue. So, it can support the queue start
and stop feature. In addition, when different numbers of Tx and Rx
queues need to be enabled in some applications, hns3 pmd does not need
to create fake queues to enable these scenarios.

This patch Add queue start and stop feature for the new generation hns3
networking engine. Cancel the creation of fake queue on the new
generation network engine. And the previously improperly named queue
related function was renamed to improve readability.

Signed-off-by: Chengchang Tang <tangchengchang@huawei.com>
Signed-off-by: Wei Hu (Xavier) <xavier.huwei@huawei.com>
3 years agonet/hns3: set max scheduling rate based on actual board
Huisong Li [Tue, 29 Sep 2020 12:01:14 +0000 (20:01 +0800)]
net/hns3: set max scheduling rate based on actual board

Currently, max scheduling rates configuration of pg, pri and port are
set to 100000Mbps, which is the maximum bandwidth of hns3 network engine
with revision_id equals 0x21. However, max scheduling rate configuration
should be set to hardware based on the actual hardware board
environment.

The max_tm_rate in struct hns3_hw, meaning the rate, is obtained from
firmware. So we should use the variable to configure the max scheduling
rate.

Signed-off-by: Huisong Li <lihuisong@huawei.com>
Signed-off-by: Wei Hu (Xavier) <xavier.huwei@huawei.com>
3 years agonet/hns3: offload calculating shapping to firmware
Huisong Li [Tue, 29 Sep 2020 12:01:13 +0000 (20:01 +0800)]
net/hns3: offload calculating shapping to firmware

In order to have more flexible selection of shapping algorithm based on
different versions of hns3 network engine, moves the algorithm of
calculating shapping parameter to firmware to execute. If bit
HNS3_TM_RATE_VLD_B of flag field of struct named hns3_pri_shapping_cmd,
hns3_pg_shapping_cmd or hns3_port_shapping_cmd is set to 1, firmware of
network engine, which device revision_id is greater than and equal to
0x30, will recalculate the shapping parameters according to the xxx_rate
field of struct hns3_xxx_shapping_cmd and the opcode of scheduling
level, and configure to hardware.

But driver still needs to calculate shapping parameters and configure
firmware, so as to be compatible with the network engine with
revision_id eqauls 0x21. And the rate and the flag will be ignored based
on the network engine with revision_id equals 0x21.

Signed-off-by: Huisong Li <lihuisong@huawei.com>
Signed-off-by: Wei Hu (Xavier) <xavier.huwei@huawei.com>
3 years agonet/hns3: fix flow error type
Wei Hu (Xavier) [Tue, 29 Sep 2020 12:01:12 +0000 (20:01 +0800)]
net/hns3: fix flow error type

The API of rte_flow_error_set is used to pass detail error information
to caller, this patch sets suitable type when calling rte_flow_error_set
API.

Fixes: fcba820d9b9e ("net/hns3: support flow director")
Fixes: c37ca66f2b27 ("net/hns3: support RSS")
Cc: stable@dpdk.org
Signed-off-by: Chengwen Feng <fengchengwen@huawei.com>
Signed-off-by: Wei Hu (Xavier) <xavier.huwei@huawei.com>
3 years agonet/hns3: fix error type when validating RSS flow action
Wei Hu (Xavier) [Tue, 29 Sep 2020 12:01:11 +0000 (20:01 +0800)]
net/hns3: fix error type when validating RSS flow action

Because the macro named RTE_FLOW_ERROR_TYPE_ACTION_CONF indicates a
action configuration and the macro named RTE_FLOW_ERROR_TYPE_ACTION
indicates a specific action, the driver needs to return
RTE_FLOW_ERROR_ACTION_CONF type and notify the user when a RSS
configuration is invalid with actions list in the internal function
named hns3_parse_rss_filter called by the '.validate' ops implementation
function named hns3_flow_validate.

Besides, this patch removes some unnecessary judgment lines in
hns3_parse_rss_filter.

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>
3 years agonet/hns3: maximize queue number
Wei Hu (Xavier) [Tue, 29 Sep 2020 12:01:10 +0000 (20:01 +0800)]
net/hns3: maximize queue number

The maximum number of queues for hns3 PF and VF driver is 64 based on
hns3 network engine with revision_id equals 0x21. Based on hns3 network
engine with revision_id equals 0x30, the hns3 PF PMD driver can support
up to 1280 queues, and hns3 VF PMD driver can support up to 128 queues.

The following points need to be modified to support maximizing queue
number and maintain better compatibility:
1) Maximizing the number of queues for hns3 PF and VF PMD driver In
   current version, VF is not supported when PF is driven by hns3 PMD
   driver. If maximum queue numbers allocated to PF PMD driver is less
   than total tqps_num allocated to this port, all remaining number of
   queues are mapped to VF function, which is unreasonable. So we fix
   that all remaining number of queues are mapped to PF function.

   Using RTE_LIBRTE_HNS3_MAX_TQP_NUM_PER_PF which comes from
   configuration file to limit the queue number allocated to PF device
   based on hns3 network engine with revision_id greater than 0x30. And
   PF device still keep the maximum 64 queues based on hns3 network
   engine with revision_id equals 0x21.

   Remove restriction of the macro HNS3_MAX_TQP_NUM_PER_FUNC on the
   maximum number of queues in hns3 VF PMD driver and use the value
   allocated by hns3 PF kernel netdev driver.

2) According to the queue number allocated to PF device, a variable
   array for Rx and Tx queue is dynamically allocated to record the
   statistics of Rx and Tx queues during the .dev_init ops
   implementation function.
3) Add an extended field in hns3_pf_res_cmd to support the case that
   numbers of queue are greater than 1024.
4) Use new base address of Rx or Tx queue if QUEUE_ID of Rx or Tx queue
   is greater than 1024.
5) Remove queue id mask and use all bits of actual queue_id as the
   queue_id to configure hardware.
6) Currently, 0~9 bits of qset_id in hns3_nq_to_qs_link_cmd used to
   record actual qset id and 10 bit as VLD bit are configured to
   hardware. So we also need to use 11~15 bits when actual qset_id is
   greater than 1024.
7) The number of queue sets based on different network engine are
   different. We use it to calculate group number and configure to
   hardware in the backpressure configuration.
8) Adding check operations for number of Rx and Tx queue user configured
   when mapping queue to tc Rx queue numbers under a single TC must be
   less than rss_size_max supported by a single TC. Rx and Tx queue
   numbers are allocated to every TC by average. So Rx and Tx queue
   numbers must be an integer multiple of 2, or redundant queues are not
   available.
9) We can specify which packets enter the queue with a specific queue
   number, when creating flow table rules by rte_flow API. Currently,
   driver uses 0~9 bits to record the queue_id. So it is necessary to
   extend one bit field to record queue_id and configure to hardware, if
   the queue_id is greater than 1024.

Signed-off-by: Huisong Li <lihuisong@huawei.com>
Signed-off-by: Wei Hu (Xavier) <xavier.huwei@huawei.com>
3 years agonet/hns3: expand number of queues for one TC up to 512
Huisong Li [Tue, 29 Sep 2020 12:01:09 +0000 (20:01 +0800)]
net/hns3: expand number of queues for one TC up to 512

The maximum number of queues for one TC hns3 PF PMD driver supported is
64 based on hns3 network engine with revision_id equals 0x21, while it
is expanded up to 512 on hns3 network engine with revision_id equals
0x30.

So the following points need to be modified to maintain better
compatibility.
1) Using a extended rss_size_max field as the maximum queue number of
   one TC PF driver supported.
2) The data type of the RSS redirection table needs to be changed from
   uint8_t to uint16_t.
3) rss_tc_mode modification
   The bitwidth of tc_offset, meaning the rx queue index, has to expand
   from 10 bit to 11 bits. The tc_size, meaning the exponent with base 2
   of queues supported on TC, needs to expand from 3 bits to 4 bits.
4) RSS indirection table modification
   Currently, a field with 7 bits width is used to record the queue
   index for RSS indirection table. It means that PF needs to expand the
   queue index field to 9 bits. As the RSS indirection table config
   command reserved 4 bytes to configure the RSS queue index, a extern
   field can be added. So an entries of RSS indirection table queue
   index has two fields to set: rss_result_l and rss_result_h, while
   rss_result_l records the lower 8 bits and rss_result_h records the
   higher 1 bit.

In addition, 2~4 modifications is also compatible with hns3 VF PMD
driver.

Signed-off-by: Huisong Li <lihuisong@huawei.com>
Signed-off-by: Wei Hu (Xavier) <xavier.huwei@huawei.com>
3 years agonet/enic: share flow actions with same signature
John Daley [Wed, 30 Sep 2020 03:45:04 +0000 (20:45 -0700)]
net/enic: share flow actions with same signature

Flow actions are a limited resource on the Cisco VIC, but they
can be shared between flows if they are exactly the same.
Use a hash table and a reference count in the PMD to enable sharing
actions with the same signature between flows.

Signed-off-by: John Daley <johndale@cisco.com>
Reviewed-by: Hyong Youb Kim <hyonkim@cisco.com>
3 years agomaintainers: update for MCS lock
Honnappa Nagarahalli [Thu, 8 Oct 2020 23:13:59 +0000 (18:13 -0500)]
maintainers: update for MCS lock

Updating MAINTAINERS file for MCS lock.

Signed-off-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
Acked-by: Phil Yang <phil.yang@arm.com>
3 years agoeal: fix experimental block for 20.11
David Marchand [Thu, 8 Oct 2020 12:49:27 +0000 (14:49 +0200)]
eal: fix experimental block for 20.11

In EAL, we try to sort the experimental symbols per the release they
were introduced in.

Fixes: 8929de043eb4 ("service: retrieve lcore active state")

Signed-off-by: David Marchand <david.marchand@redhat.com>
Acked-by: Thomas Monjalon <thomas@monjalon.net>
3 years agoexamples/pipeline: fix files for table update
Cristian Dumitrescu [Tue, 6 Oct 2020 20:37:50 +0000 (21:37 +0100)]
examples/pipeline: fix files for table update

Coverity issue: 362744, 362745, 362882
Fixes: 5074e1d551 ("examples/pipeline: add configuration commands")

Signed-off-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
3 years agopipeline: fix instruction config free
Cristian Dumitrescu [Tue, 6 Oct 2020 20:37:55 +0000 (21:37 +0100)]
pipeline: fix instruction config free

Coverity issue: 362901
Fixes: a1711f948d ("pipeline: add SWX Rx and extract instructions")

Signed-off-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
3 years agopipeline: fix unused variable
Cristian Dumitrescu [Tue, 6 Oct 2020 20:37:54 +0000 (21:37 +0100)]
pipeline: fix unused variable

Coverity issue: 362855
Fixes: 75634474ca ("pipeline: add SWX instruction verifier")

Signed-off-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
3 years agopipeline: fix memory free
Cristian Dumitrescu [Tue, 6 Oct 2020 20:37:52 +0000 (21:37 +0100)]
pipeline: fix memory free

Coverity issue: 362796, 362804, 362819, 362836, 362858, 362865, 362869
Fixes: 3ca60ceed7 ("pipeline: add SWX pipeline specification file")

Signed-off-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
3 years agopipeline: fix argument check
Cristian Dumitrescu [Tue, 6 Oct 2020 20:37:51 +0000 (21:37 +0100)]
pipeline: fix argument check

Coverity issue: 362789
Fixes: 3ca60ceed7 ("pipeline: add SWX pipeline specification file")

Signed-off-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
3 years agopipeline: fix resource leak
Cristian Dumitrescu [Tue, 6 Oct 2020 20:37:53 +0000 (21:37 +0100)]
pipeline: fix resource leak

Coverity issue: 362812
Fixes: b32c0a2c5e ("pipeline: add SWX table update high level API")

Signed-off-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
3 years agopipeline: fix memory leak
Cristian Dumitrescu [Tue, 6 Oct 2020 20:37:49 +0000 (21:37 +0100)]
pipeline: fix memory leak

Coverity issue: 362741
Fixes: b32c0a2c5e ("pipeline: add SWX table update high level API")

Signed-off-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
3 years agoexamples/ioat: fix stats print
Kevin Laatz [Thu, 17 Sep 2020 13:07:40 +0000 (14:07 +0100)]
examples/ioat: fix stats print

Currently some of the status string at the top of the stats output is being
cut off. To fix this, the status string array size has been increased.
In addition to this, the "\n" has been moved to the printf, rather than
having it in the last string, in case of future formatting issues due to
truncation.

Bugzilla ID: 536
Fixes: 632bcd9b5d4f ("examples/ioat: print statistics")
Cc: stable@dpdk.org
Signed-off-by: Kevin Laatz <kevin.laatz@intel.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
3 years agoraw/ioat: add fill operation
Kevin Laatz [Thu, 8 Oct 2020 09:51:33 +0000 (10:51 +0100)]
raw/ioat: add fill operation

Add fill operation enqueue support for IOAT and IDXD. The fill enqueue is
similar to the copy enqueue, but takes a 'pattern' rather than a source
address to transfer to the destination address. This patch also includes an
additional test case for the new operation type.

Signed-off-by: Kevin Laatz <kevin.laatz@intel.com>
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Radu Nicolau <radu.nicolau@intel.com>
3 years agoraw/ioat: clean up use of common test function
Bruce Richardson [Thu, 8 Oct 2020 09:51:32 +0000 (10:51 +0100)]
raw/ioat: clean up use of common test function

Now that all devices can pass the same set of unit tests, eliminate the
temporary idxd_rawdev_test function and move the prototype for
ioat_rawdev_test to the proper internal header file, to be used by all
device instances.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Reviewed-by: Kevin Laatz <kevin.laatz@intel.com>
Acked-by: Radu Nicolau <radu.nicolau@intel.com>
3 years agoraw/ioat: add xstats tracking for idxd device
Bruce Richardson [Thu, 8 Oct 2020 09:51:31 +0000 (10:51 +0100)]
raw/ioat: add xstats tracking for idxd device

Add update of the relevant stats for the data path functions and point the
overall device struct xstats function pointers to the existing ioat
functions.

At this point, all necessary hooks for supporting the existing unit tests
are in place so call them for each device.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Reviewed-by: Kevin Laatz <kevin.laatz@intel.com>
Acked-by: Radu Nicolau <radu.nicolau@intel.com>
3 years agoraw/ioat: move xstats functions to common file
Bruce Richardson [Thu, 8 Oct 2020 09:51:30 +0000 (10:51 +0100)]
raw/ioat: move xstats functions to common file

The xstats functions can be used by all ioat devices so move them from the
ioat_rawdev.c file to ioat_common.c, and add the function prototypes to the
internal header file.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Reviewed-by: Kevin Laatz <kevin.laatz@intel.com>
Acked-by: Radu Nicolau <radu.nicolau@intel.com>
3 years agoraw/ioat: create separate statistics structure
Bruce Richardson [Thu, 8 Oct 2020 09:51:29 +0000 (10:51 +0100)]
raw/ioat: create separate statistics structure

Rather than having the xstats as fields inside the main driver structure,
create a separate structure type for them.

As part of the change, when updating the stats functions referring to the
stats by the old path, we can simplify them to use the id to directly index
into the stats structure, making the code shorter and simpler.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Reviewed-by: Kevin Laatz <kevin.laatz@intel.com>
Acked-by: Radu Nicolau <radu.nicolau@intel.com>
3 years agoraw/ioat: add info query for idxd device
Bruce Richardson [Thu, 8 Oct 2020 09:51:28 +0000 (10:51 +0100)]
raw/ioat: add info query for idxd device

Add the info get function for DSA devices, returning just the ring size
info about the device, same as is returned for existing IOAT/CBDMA devices.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Reviewed-by: Kevin Laatz <kevin.laatz@intel.com>
Acked-by: Radu Nicolau <radu.nicolau@intel.com>
3 years agoraw/ioat: add data path for idxd device
Bruce Richardson [Thu, 8 Oct 2020 09:51:27 +0000 (10:51 +0100)]
raw/ioat: add data path for idxd device

Add support for doing copies using DSA hardware. This is implemented by
just switching on the device type field at the start of the inline
functions. Since there is no hardware which will have both device types
present this branch will always be predictable after the first call,
meaning it has little to no perf penalty.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Reviewed-by: Kevin Laatz <kevin.laatz@intel.com>
Acked-by: Radu Nicolau <radu.nicolau@intel.com>
3 years agoraw/ioat: start and stop idxd device
Bruce Richardson [Thu, 8 Oct 2020 09:51:26 +0000 (10:51 +0100)]
raw/ioat: start and stop idxd device

Add the start and stop functions for DSA hardware devices using the
vfio/uio kernel drivers. For vdevs using the idxd kernel driver, the device
must be started using sysfs before the device node appears for vdev use -
making start/stop functions in the driver unnecessary.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Reviewed-by: Kevin Laatz <kevin.laatz@intel.com>
Acked-by: Radu Nicolau <radu.nicolau@intel.com>
3 years agoraw/ioat: configure idxd devices
Bruce Richardson [Thu, 8 Oct 2020 09:51:25 +0000 (10:51 +0100)]
raw/ioat: configure idxd devices

Add configure function for idxd devices, taking the same parameters as the
existing configure function for ioat. The ring_size parameter is used to
compute the maximum number of bursts to be supported by the driver, given
that the hardware works on individual bursts of descriptors at a time.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Reviewed-by: Kevin Laatz <kevin.laatz@intel.com>
Acked-by: Radu Nicolau <radu.nicolau@intel.com>
3 years agoraw/ioat: add datapath data structures for idxd devices
Bruce Richardson [Thu, 8 Oct 2020 09:51:24 +0000 (10:51 +0100)]
raw/ioat: add datapath data structures for idxd devices

Add in the relevant data structures for the data path for DSA devices. Also
include a device dump function to output the status of each device.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Reviewed-by: Kevin Laatz <kevin.laatz@intel.com>
Acked-by: Radu Nicolau <radu.nicolau@intel.com>
3 years agoraw/ioat: probe idxd vdev
Kevin Laatz [Thu, 8 Oct 2020 09:51:23 +0000 (10:51 +0100)]
raw/ioat: probe idxd vdev

For each vdev (DSA work queue) instance, create a rawdev instance.

Signed-off-by: Kevin Laatz <kevin.laatz@intel.com>
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Radu Nicolau <radu.nicolau@intel.com>
3 years agoraw/ioat: probe idxd PCI
Bruce Richardson [Thu, 8 Oct 2020 09:51:22 +0000 (10:51 +0100)]
raw/ioat: probe idxd PCI

When a matching device is found via PCI probe create a rawdev instance for
each queue on the hardware. Use empty self-test function for these devices
so that the overall rawdev_autotest does not report failures.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Reviewed-by: Kevin Laatz <kevin.laatz@intel.com>
Acked-by: Radu Nicolau <radu.nicolau@intel.com>
3 years agoraw/ioat: include example configuration script
Bruce Richardson [Thu, 8 Oct 2020 09:51:21 +0000 (10:51 +0100)]
raw/ioat: include example configuration script

Devices managed by the idxd kernel driver must be configured for DPDK use
before it can be used by the ioat driver. This example script serves both
as a quick way to get the driver set up with a simple configuration, and as
the basis for users to modify it and create their own configuration
scripts.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Reviewed-by: Kevin Laatz <kevin.laatz@intel.com>
Acked-by: Radu Nicolau <radu.nicolau@intel.com>
3 years agoraw/ioat: introduce vdev probe for DSA/idxd device
Kevin Laatz [Thu, 8 Oct 2020 09:51:20 +0000 (10:51 +0100)]
raw/ioat: introduce vdev probe for DSA/idxd device

The Intel DSA devices can be exposed to userspace via kernel driver, so can
be used without having to bind them to vfio/uio. Therefore we add support
for using those kernel-configured devices as vdevs, taking as parameter the
individual HW work queue to be used by the vdev.

Signed-off-by: Kevin Laatz <kevin.laatz@intel.com>
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Radu Nicolau <radu.nicolau@intel.com>
3 years agoraw/ioat: add skeleton for VFIO/UIO based DSA device
Bruce Richardson [Thu, 8 Oct 2020 09:51:19 +0000 (10:51 +0100)]
raw/ioat: add skeleton for VFIO/UIO based DSA device

Add in the basic probe/remove skeleton code for DSA devices which are bound
directly to vfio or uio driver. The kernel module for supporting these uses
the "idxd" name, so that name is used as function and file prefix to avoid
conflict with existing "ioat" prefixed functions.

Since we are adding new files to the driver and there will be common
definitions shared between the various files, we create a new internal
header file ioat_private.h to hold common macros and function prototypes.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Reviewed-by: Kevin Laatz <kevin.laatz@intel.com>
Acked-by: Radu Nicolau <radu.nicolau@intel.com>
3 years agousertools: support binding Intel DSA device
Kevin Laatz [Thu, 8 Oct 2020 09:51:18 +0000 (10:51 +0100)]
usertools: support binding Intel DSA device

Intel Data Streaming Accelerator (Intel DSA) is a high-performance data
copy and transformation accelerator which will be integrated in future
Intel processors [1].

Add DSA device support to dpdk-devbind.py script.

[1] https://01.org/blogs/2019/introducing-intel-data-streaming-accelerator

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Signed-off-by: Kevin Laatz <kevin.laatz@intel.com>
Acked-by: Radu Nicolau <radu.nicolau@intel.com>
3 years agoraw/ioat: make HW register spec private
Bruce Richardson [Thu, 8 Oct 2020 09:51:17 +0000 (10:51 +0100)]
raw/ioat: make HW register spec private

Only a few definitions from the hardware spec are actually used in the
driver runtime, so we can copy over those few and make the rest of the spec
a private header in the driver.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Reviewed-by: Kevin Laatz <kevin.laatz@intel.com>
Acked-by: Radu Nicolau <radu.nicolau@intel.com>
3 years agoraw/ioat: add separate API for fence call
Bruce Richardson [Thu, 8 Oct 2020 09:51:16 +0000 (10:51 +0100)]
raw/ioat: add separate API for fence call

Rather than having the fence signalled via a flag on a descriptor - which
requires reading the docs to find out whether the flag needs to go on the
last descriptor before, or the first descriptor after the fence - we can
instead add a separate fence API call. This becomes unambiguous to use,
since the fence call explicitly comes between two other enqueue calls. It
also allows more freedom of implementation in the driver code.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Reviewed-by: Kevin Laatz <kevin.laatz@intel.com>
Acked-by: Radu Nicolau <radu.nicolau@intel.com>
3 years agoraw/ioat: rename functions to be operation-agnostic
Bruce Richardson [Thu, 8 Oct 2020 09:51:15 +0000 (10:51 +0100)]
raw/ioat: rename functions to be operation-agnostic

Since the hardware supported by the ioat driver is capable of operations
other than just copies, we can rename the doorbell and completion-return
functions to not have "copies" in their names. These functions are not
copy-specific, and so would apply for other operations which may be added
later to the driver.

Also add a suitable warning using deprecation attribute for any code using
the old functions names.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Reviewed-by: Kevin Laatz <kevin.laatz@intel.com>
Acked-by: Radu Nicolau <radu.nicolau@intel.com>
3 years agoraw/ioat: split header file for readability
Bruce Richardson [Thu, 8 Oct 2020 09:51:14 +0000 (10:51 +0100)]
raw/ioat: split header file for readability

Rather than having a single long complicated header file for general use we
can split things so that there is one header with all the publicly needed
information - data structs and function prototypes - while the rest of the
internal details are put separately. This makes it easier to read,
understand and use the APIs.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Reviewed-by: Kevin Laatz <kevin.laatz@intel.com>
Acked-by: Radu Nicolau <radu.nicolau@intel.com>
3 years agoraw/ioat: add flag to control copying handle parameters
Cheng Jiang [Thu, 8 Oct 2020 09:51:13 +0000 (10:51 +0100)]
raw/ioat: add flag to control copying handle parameters

Add a flag which controls whether rte_ioat_enqueue_copy and
rte_ioat_completed_copies function should process handle parameters. Not
doing so can improve the performance when handle parameters are not
necessary.

Signed-off-by: Cheng Jiang <cheng1.jiang@intel.com>
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Reviewed-by: Kevin Laatz <kevin.laatz@intel.com>
Acked-by: Radu Nicolau <radu.nicolau@intel.com>
3 years agoraw/ioat: include extra info in test errors
Bruce Richardson [Thu, 8 Oct 2020 09:51:12 +0000 (10:51 +0100)]
raw/ioat: include extra info in test errors

In case of any failures, include the function name and the line number of
the error message in the message, to make tracking down the failure easier.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Reviewed-by: Kevin Laatz <kevin.laatz@intel.com>
Acked-by: Radu Nicolau <radu.nicolau@intel.com>
3 years agoraw/ioat: enable use from C++
Bruce Richardson [Thu, 8 Oct 2020 09:51:11 +0000 (10:51 +0100)]
raw/ioat: enable use from C++

To allow the header file to be used from C++ code we need to ensure all
typecasts are explicit, and include an 'extern "C"' guard.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Reviewed-by: Kevin Laatz <kevin.laatz@intel.com>
Acked-by: Radu Nicolau <radu.nicolau@intel.com>
3 years agoraw/ioat: fix missing close function
Kevin Laatz [Thu, 8 Oct 2020 09:51:10 +0000 (10:51 +0100)]
raw/ioat: fix missing close function

When rte_rawdev_pmd_release() is called, rte_rawdev_close() looks for a
dev_close function for the device causing a segmentation fault when no
close() function is implemented for a driver.

This patch resolves the issue by adding a stub function ioat_dev_close().

Fixes: f687e842e328 ("raw/ioat: introduce IOAT driver")
Cc: stable@dpdk.org
Reported-by: Sunil Pai G <sunil.pai.g@intel.com>
Signed-off-by: Kevin Laatz <kevin.laatz@intel.com>
Reviewed-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Sunil Pai G <sunil.pai.g@intel.com>
Acked-by: Radu Nicolau <radu.nicolau@intel.com>
3 years agodoc: add ioat driver to API index
Bruce Richardson [Thu, 8 Oct 2020 09:51:09 +0000 (10:51 +0100)]
doc: add ioat driver to API index

Add the ioat driver to the doxygen documentation.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Reviewed-by: Kevin Laatz <kevin.laatz@intel.com>
Acked-by: Radu Nicolau <radu.nicolau@intel.com>
3 years agopmdinfogen: fix build with gcc 11
Ferruh Yigit [Mon, 21 Sep 2020 13:38:30 +0000 (14:38 +0100)]
pmdinfogen: fix build with gcc 11

Error observed with gcc 11 under development
gcc (GCC) 11.0.0 20200920 (experimental)

build error:
In file included from ../buildtools/pmdinfogen/pmdinfogen.c:17:
../buildtools/pmdinfogen/pmdinfogen.c: In function ‘parse_elf’:
../buildtools/pmdinfogen/pmdinfogen.h:78:1:
warning: this ‘else’ clause does not guard...
[-Wmisleading-indentation]
   78 | else \
      | ^~~~
../buildtools/pmdinfogen/pmdinfogen.h:83:35:
note: in expansion of macro ‘CONVERT_NATIVE’
   83 | #define TO_NATIVE(fend, width, x) CONVERT_NATIVE(fend, width, x)
      |                                   ^~~~~~~~~~~~~~
../buildtools/pmdinfogen/pmdinfogen.c:152:28:
note: in expansion of macro ‘TO_NATIVE’
  152 |         hdr->e_type      = TO_NATIVE(endian, 16, hdr->e_type);
      |                            ^~~~~~~~~
../buildtools/pmdinfogen/pmdinfogen.h:80:9:
note: ...this statement, but the latter is misleadingly indented
as if it were guarded by the ‘else’
   80 |         ___x; \
      |         ^~~~

Fixes: 98b0fdb0ffc6 ("pmdinfogen: add buildtools and pmdinfogen utility")
Cc: stable@dpdk.org
Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
Reviewed-by: David Marchand <david.marchand@redhat.com>
3 years agoapp/testpmd: fix build with gcc 11
Ferruh Yigit [Mon, 21 Sep 2020 13:38:29 +0000 (14:38 +0100)]
app/testpmd: fix build with gcc 11

Error observed with gcc 11 under development
gcc (GCC) 11.0.0 20200920 (experimental)

../app/test-pmd/config.c:1777:61:
warning: argument 3 of type ‘const uint32_t[n]’
{aka ‘const unsigned int[n]’} declared as a variable length
array [-Wvla-parameter]
 1777 | port_flow_list(portid_t port_id, uint32_t n,
  const uint32_t group[n])
      |                 ~~~~~~~~~~~~~~~^~~~~~~~
In file included from ../app/test-pmd/config.c:53:
../app/test-pmd/testpmd.h:764:67:
note: previously declared as a pointer ‘const uint32_t *’
{aka ‘const unsigned int *’}
  764 | void port_flow_list(portid_t port_id, uint32_t n,
   const uint32_t *group);
      |                         ~~~~~~~~~~~~~~~~^~~~~

Fixes: 938a184a1870 ("app/testpmd: implement basic support for flow API")
Cc: stable@dpdk.org
Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
Reviewed-by: David Marchand <david.marchand@redhat.com>
Reviewed-by: Phil Yang <phil.yang@arm.com>
Reviewed-by: Asaf Penso <asafp@nvidia.com>
3 years agotimer: add limitation note for sync stop and reset
Erik Gabriel Carrillo [Wed, 9 Sep 2020 14:41:14 +0000 (09:41 -0500)]
timer: add limitation note for sync stop and reset

If a timer's callback function calls rte_timer_reset_sync() or
rte_timer_stop_sync() on another timer that is in the RUNNING state and
owned by the current lcore, the *_sync() calls will loop indefinitely.

Relatedly, if a timer's callback function calls *_sync() on another
timer that is in the RUNNING state and is owned by a different lcore,
but a timer callback function runs on that different lcore and calls
*_sync() on a timer that is in the RUNNING state and owned by the
current lcore, the two lcores will loop indefinitely.

Add a note in the rte_timer_stop_sync and rte_timer_reset_sync
documentation that indicates that these APIs should not be used inside
timer callback functions in order to avoid the hangs described above,
and suggests an alternative.

Bugzilla ID: 491
Cc: stable@dpdk.org
Signed-off-by: Erik Gabriel Carrillo <erik.g.carrillo@intel.com>
Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
3 years agodoc: add stack mempool guide
Gage Eads [Wed, 7 Oct 2020 14:18:32 +0000 (09:18 -0500)]
doc: add stack mempool guide

This guide describes the two stack modes, their tradeoffs, and (via a
reference to the mempool guide) how to enable them.

Signed-off-by: Gage Eads <gage.eads@intel.com>
Reviewed-by: Olivier Matz <olivier.matz@6wind.com>
3 years agotrace: increase event CTF description buffer size
Timothy McDaniel [Mon, 5 Oct 2020 20:02:34 +0000 (15:02 -0500)]
trace: increase event CTF description buffer size

The current buffer size is not big enough to register trace points for
new additions in the eventdev subsystem.
Increase TRACE_CTF_FIELD_SIZE by 64 bytes for now.

Signed-off-by: Timothy McDaniel <timothy.mcdaniel@intel.com>
Acked-by: Sunil Kumar Kori <skori@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
3 years agopower: fix current frequency index
Reshma Pattan [Wed, 29 Jul 2020 13:58:53 +0000 (14:58 +0100)]
power: fix current frequency index

During power initialization the pstate cpufreq api is
not setting the initial curr_idx of pstate_power_info
to corresponding current frequency index.

Without this the idx is always 0, which is causing the
below check to pass and returns without setting the initial
min/max frequency to system max frequency and this leads to
incorrect frequency settings when power_pstate_cpufreq_set_freq()
is called in the apps.

set_freq_internal(struct pstate_power_info *pi, uint32_t idx)
{
...

 /* Check if it is the same as current */
        if (idx == pi->curr_idx)
                return 0;
...
}

scenario 1:
If system has starting scaling min/max: 1000/1000, and want to
set this to 2200/2200, the max frequency gets updated but not min.

scenario 2:
If system has starting scaling min/max: 2200/1000, and want to set
to 2200/2200, the max, min frequency was not updated. Since no change
in max that should be ok, but min was also ignored, which will be fixed
now with the new changes.

Fixes: e6c6dc0f ("power: add p-state driver compatibility")
Cc: stable@dpdk.org
Signed-off-by: Reshma Pattan <reshma.pattan@intel.com>
Reviewed-by: Liang Ma <liang.j.ma@intel.com>
3 years agotrace: add size_t as generic trace point
Pavan Nikhilesh [Tue, 25 Aug 2020 23:24:09 +0000 (04:54 +0530)]
trace: add size_t as generic trace point

Add size_t as a generic trace point. Also, update
test_generic_trace_point() to validate size_t emitter.

Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
Acked-by: Sunil Kumar Kori <skori@mavell.com>
3 years agotrace: fix size_t field emitter
Pavan Nikhilesh [Tue, 25 Aug 2020 23:24:08 +0000 (04:54 +0530)]
trace: fix size_t field emitter

Add size_t CTF format metadata, this is needed by CTF analyzers to
parse the emitted CTF trace.

Fixes: 262c4ee791c6 ("trace: add size_t field emitter")

Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
Acked-by: Sunil Kumar Kori <skori@mavell.com>
3 years agomempool: dump handler index and name
Hemant Agrawal [Tue, 8 Sep 2020 05:41:53 +0000 (11:11 +0530)]
mempool: dump handler index and name

Enhance the dump function to also print the ops index
and associated mempool ops name

Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
Acked-by: Andrew Rybchenko <arybchenko@solarflare.com>
3 years agoport: remove useless assignment
Fan Zhang [Fri, 18 Sep 2020 08:23:10 +0000 (09:23 +0100)]
port: remove useless assignment

This patch fixes an unused value in pcap source port by
removing the setting to the value.

Coverity issue: 362020
Fixes: d4b42133d85b ("port: add pcap file source")
Cc: stable@dpdk.org
Signed-off-by: Fan Zhang <roy.fan.zhang@intel.com>
3 years agoraw/skeleton: allow closing already closed device
Lukasz Wojciechowski [Mon, 21 Sep 2020 21:44:20 +0000 (23:44 +0200)]
raw/skeleton: allow closing already closed device

This patch return OK code (0) from skeleton_rawdev_close function
if firmware is in SKELETON_FW_READY state. Formerly it returned
-EINVAL error code.

Returning an error here is troublesome as it disallows proper release
of the rawdev. The rte_rawdev_pmd_release function from librte_rawdev
library calls drivers' rawdev_close handler and continues execution
only in case of errorless call.
(see lib/librte_rawdev/rte_rawdev.c:540)

The SKELETON_FW_READY state is reached after creation, reset, unload
or close of the device. The device should be ok to be released in
such situations.

To reproduce issue fixed by this patch, call rawdev_autotest
from dpdk-test app for few times. As the device is not properly
released, the next calls will fail.

Fixes: 61c592a8d035 ("raw/skeleton: introduce skeleton rawdev driver")
Cc: stable@dpdk.org
Signed-off-by: Lukasz Wojciechowski <l.wojciechow@partner.samsung.com>
3 years agoraw/skeleton: reset test statistics
Lukasz Wojciechowski [Mon, 21 Sep 2020 21:44:19 +0000 (23:44 +0200)]
raw/skeleton: reset test statistics

Statistics: passed, failed, unsupported and total are kept
in global static variables. As global variables they are initiated
with zeroes. However running test multiple times cumulates results
from previous calls.

This patch resets statistics with zeroes in testsuite_setup().

To reproduce issue fixed by this patch, run rawdev_autotest command
in dpdk-test app multiple times.

Fixes: 55ca1b0f2151 ("raw/skeleton: add test cases")
Cc: stable@dpdk.org
Signed-off-by: Lukasz Wojciechowski <l.wojciechow@partner.samsung.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
3 years agoethdev: add common stats for telemetry
Ciara Power [Wed, 23 Sep 2020 11:12:28 +0000 (12:12 +0100)]
ethdev: add common stats for telemetry

The ethdev library now registers a telemetry command for common ethdev
statistics.

An example usage is shown below:

Connecting to /var/run/dpdk/rte/dpdk_telemetry.v2
{"version": "DPDK 20.08.0-rc1", "pid": 14119, "max_output_len": 16384}
--> /ethdev/stats,0
{"/ethdev/stats": {"ipackets": 0, "opackets": 0, "ibytes": 0, "obytes": \
    0, "imissed": 0, "ierrors": 0, "oerrors": 0, "rx_nombuf": 0, \
    "q_ipackets": [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], \
    "q_opackets": [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], \
    "q_ibytes": [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], \
    "q_obytes": [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], \
    "q_errors": [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]}}

Signed-off-by: Ciara Power <ciara.power@intel.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
3 years agotest/telemetry: add unit tests for data to JSON
Louise Kilheeney [Wed, 23 Sep 2020 11:12:27 +0000 (12:12 +0100)]
test/telemetry: add unit tests for data to JSON

This patch adds tests for verifying telemetry data structures are
converted to JSON as expected. Both flat and recursive data structures
are tested, for all possible value types.

The app connects to the telemetry socket as a client, and registers one
command with a corresponding callback function. Each time the callback
function is called, it copies a global data variable to the data pointer
passed in by telemetry.
When a test case is run, the test case function builds up the global
data variable with the relevant data types, and the expected json string
output which should be generated from that. The 'test_output()' function
is used to trigger the callback and ensure the actual output matches
that expected.

Signed-off-by: Louise Kilheeney <louise.kilheeney@intel.com>
Signed-off-by: Ciara Power <ciara.power@intel.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
3 years agotelemetry: support array values in data object
Ciara Power [Wed, 23 Sep 2020 11:12:26 +0000 (12:12 +0100)]
telemetry: support array values in data object

Arrays of type uint64_t/int/string can now be included within an array
or dict. One level of embedded containers is supported. This is
necessary to allow for instances such as the ethdev queue stats to be
reported as a list of uint64_t values, rather than having multiple dict
entries with one uint64_t value for each queue stat.

The memory management APIs provided by telemetry simplify the memory
allocation/free aspect of the embedded container. The rte_tel_data_alloc
function is called in the library/app callback to return a pointer to a
container that has been allocated memory. When adding this container
to an array/dict, a parameter is passed to indicate if the memory
should be freed by telemetry after use. This will allow reuse of the
allocated memory if the library/app wishes to do so.

Signed-off-by: Ciara Power <ciara.power@intel.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
3 years agotelemetry: fix passing full params string to command
Ciara Power [Thu, 27 Aug 2020 08:39:22 +0000 (09:39 +0100)]
telemetry: fix passing full params string to command

Telemetry only passed the first param to the command handler if multiple
were entered by the user, separated by commas. Telemetry is required to
pass the full params string to the command, by splitting by a comma
delimiter only once to remove the command part of the string. This will
enable future commands to take multiple param values.

Fixes: b1ad0e124536 ("rawdev: add telemetry callbacks")
Fixes: c190daedb9b1 ("ethdev: add telemetry callbacks")
Fixes: 6dd571fd07c3 ("telemetry: introduce new functionality")
Cc: stable@dpdk.org
Signed-off-by: Ciara Power <ciara.power@intel.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
3 years agoapp/procinfo: close devices before exit
Ferruh Yigit [Wed, 30 Sep 2020 12:06:37 +0000 (13:06 +0100)]
app/procinfo: close devices before exit

As well as this is correct thing to close devices before exit, it is
also useful to test the closing devices from secondary process.

Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
3 years agogro: support VXLAN UDP/IPv4
Yi Yang [Thu, 24 Sep 2020 08:57:39 +0000 (16:57 +0800)]
gro: support VXLAN UDP/IPv4

VXLAN UDP/IPv4 GRO can help improve VM-to-VM UDP
performance when UFO or GSO is enabled in VM, GRO
must be supported if UFO or GSO is enabled,
otherwise, performance can't get big improvement
if only GSO is there.

With this enabled in DPDK, OVS DPDK can leverage it
to improve VM-to-VM UDP performance, it will reassemble
VXLAN UDP/IPv4 fragments immediate after they are
received from a physical NIC. It is very helpful in
OVS DPDK VXLAN use case.

Signed-off-by: Yi Yang <yangyi01@inspur.com>
Acked-by: Jiayu Hu <jiayu.hu@intel.com>
3 years agogro: support UDP/IPv4
Yi Yang [Thu, 24 Sep 2020 08:57:38 +0000 (16:57 +0800)]
gro: support UDP/IPv4

UDP/IPv4 GRO can help improve VM-to-VM UDP performance
when UFO or GSO is enabled in VM, GRO must be supported
if UFO or GSO is enabled, otherwise, performance can't
get big improvement if only GSO is there.

With this enabled in DPDK, OVS DPDK can leverage it
to improve VM-to-VM UDP performance, it will reassemble
UDP fragments immediate after they are received from
a physical NIC. It is very helpful in OVS DPDK VLAN use
case.

Signed-off-by: Yi Yang <yangyi01@inspur.com>
Acked-by: Jiayu Hu <jiayu.hu@intel.com>
3 years agonet: calculate checksum of packet with IPv4 options
Michael Pfeiffer [Tue, 1 Sep 2020 09:47:55 +0000 (11:47 +0200)]
net: calculate checksum of packet with IPv4 options

Currently, rte_ipv4_cksum() and rte_ipv4_udptcp_cksum() assume all IPv4
headers have sizeof(struct rte_ipv4_hdr) bytes. This is not true for
those (rare) packets with IPv4 options. Thus, both IPv4 and TCP/UDP
checksums are calculated wrong.

This patch fixes the issue by using the actual IPv4 header length from
the packet's IHL field.

Signed-off-by: Michael Pfeiffer <michael.pfeiffer@tu-ilmenau.de>
Reviewed-by: Andrew Rybchenko <arybchenko@solarflare.com>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
3 years agokernel/linux: remove igb_uio
Thomas Monjalon [Mon, 7 Sep 2020 22:39:03 +0000 (00:39 +0200)]
kernel/linux: remove igb_uio

As decided in the Technical Board in November 2019,
the kernel module igb_uio is moved to the dpdk-kmods repository
in the /linux/igb_uio/ directory.

Minutes of Technical Board meeting:
https://mails.dpdk.org/archives/dev/2019-November/151763.html

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Acked-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Andrew Rybchenko <arybchenko@solarflare.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
3 years agobus/dpaa: enhance link status
Rohit Raj [Thu, 24 Sep 2020 04:02:09 +0000 (09:32 +0530)]
bus/dpaa: enhance link status

This patch adds support to get/set link speed, duplex and
autoneg mode status from/to PHY. Enhance device capabilities
to advertise all supported link speeds according to mac type.

Also enables fallback support for get link status API where
kernel support is missing.

Signed-off-by: Sachin Saxena <sachin.saxena@oss.nxp.com>
Signed-off-by: Rohit Raj <rohit.raj@nxp.com>
Acked-by: Nipun Gupta <nipun.gupta@nxp.com>
3 years agonet/dpaa: send error packets to application
Nipun Gupta [Thu, 24 Sep 2020 04:02:08 +0000 (09:32 +0530)]
net/dpaa: send error packets to application

Send error packets to main queue (rx) to make application
enable to receive error packets.
Earlier all packets with L3/L4 checksum errors were getting
dropped by the hardware.

Signed-off-by: Rohit Raj <rohit.raj@nxp.com>
Signed-off-by: Nipun Gupta <nipun.gupta@nxp.com>
3 years agobus/dpaa: enable Rx/Tx error queues
Sachin Saxena [Thu, 24 Sep 2020 04:02:07 +0000 (09:32 +0530)]
bus/dpaa: enable Rx/Tx error queues

Enables a debugging queue to fetch error (Rx/Tx) packets
to user space. Earlier all packets with L3/L4 checksum
errors were getting dropped by the hardware.

Setting CONFIG_RTE_LIBRTE_DPAA_DEBUG_DRIVER=y is required
which enables following enhancements.
1) Enable TX/RX error queues to check the errors packet.
2) Display error frame information(payload, status, paresr result).
3) Send error packets to application

Signed-off-by: Jun Yang <jun.yang@nxp.com>
Signed-off-by: Rohit Raj <rohit.raj@nxp.com>
Signed-off-by: Nipun Gupta <nipun.gupta@nxp.com>
Signed-off-by: Sachin Saxena <sachin.saxena@oss.nxp.com>
3 years agonet/dpaa2: fix check for key size
Apeksha Gupta [Thu, 24 Sep 2020 04:02:06 +0000 (09:32 +0530)]
net/dpaa2: fix check for key size

DPAA2 has support for raw flow classification, which can
be used for any protocol rules. This change fixes flow key
pattern length match boundary condition with spec length.

Fixes: 3f881f8d6eb0 ("net/dpaa2: support raw flow classification")
Cc: stable@dpdk.org
Signed-off-by: Apeksha Gupta <apeksha.gupta@nxp.com>
Acked-by: Nipun Gupta <nipun.gupta@nxp.com>
3 years agobus/fslmc: run secondary debug app without restriction
Rohit Raj [Thu, 24 Sep 2020 04:02:05 +0000 (09:32 +0530)]
bus/fslmc: run secondary debug app without restriction

dpaa2 hw impose limits on some HW access devices like DPMCP(Management
control Port) and DPIO (HW portal). This causes issue in their shared
usages in case of multi-process applications. It can overcome by using
whitelist/blacklist in primary and secondary applications.
However it imposes restrictions on standard debugging apps like
dpdk-procinfo, which can be used to debug any existing application.

This patch introduces reserving extra DPMCP and DPIO to be used by
secondary process if devices are not blocked previously in primary
application.
This leaves the last DPMCP and DPIO for the secondary process usages.

Signed-off-by: Rohit Raj <rohit.raj@nxp.com>
Signed-off-by: Sachin Saxena <sachin.saxena@oss.nxp.com>
Acked-by: Nipun Gupta <nipun.gupta@nxp.com>
3 years agobus/fslmc: fix atomic queues on NXP LX2 platform
Youri Querry [Thu, 24 Sep 2020 04:02:04 +0000 (09:32 +0530)]
bus/fslmc: fix atomic queues on NXP LX2 platform

Traffic was stalling after few packet while running l2fwd-event
in atomic mode on LX2 platform. It was due to wrong dca setting
while enqueuing packets to EQCR.
This patch fixes the issue by writing correct dca setting.

Fixes: 1b49352f41be ("bus/fslmc: rename portal pi index to consumer index")
Cc: stable@dpdk.org
Signed-off-by: Youri Querry <youri.querry_1@nxp.com>
Signed-off-by: Rohit Raj <rohit.raj@nxp.com>
Acked-by: Nipun Gupta <nipun.gupta@nxp.com>
3 years agomempool: promote some experimental functions as stable
Olivier Matz [Tue, 6 Oct 2020 07:07:50 +0000 (09:07 +0200)]
mempool: promote some experimental functions as stable

Move symbols introduced in version <= 19.11 in the stable ABI.

Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
Reviewed-by: David Marchand <david.marchand@redhat.com>
3 years agomempool: remove v20 ABI compatibility
Olivier Matz [Tue, 6 Oct 2020 07:07:49 +0000 (09:07 +0200)]
mempool: remove v20 ABI compatibility

Remove the deprecated v20 ABI of rte_mempool_populate_iova() and
rte_mempool_populate_virt().

Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
Reviewed-by: David Marchand <david.marchand@redhat.com>
3 years agobus/fslmc: fix dpio close
Rohit Raj [Tue, 28 Jul 2020 16:24:59 +0000 (21:54 +0530)]
bus/fslmc: fix dpio close

The current state of the DPIO object should be checked
before trying to close/disable the object.

Fixes: 293c0ca94c36 ("bus/fslmc: support memory backed portals with QBMAN 5.0")
Cc: stable@dpdk.org
Signed-off-by: Rohit Raj <rohit.raj@nxp.com>
Acked-by: Sachin Saxena <sachin.saxena@oss.nxp.com>
3 years agorcu: promote library as stable
Joyce Kong [Fri, 11 Sep 2020 05:45:33 +0000 (13:45 +0800)]
rcu: promote library as stable

RCU library supporting quiescent state was introduced
in 19.05 release and has been around 4 releases, it
should be mature enough to remove the experimental tag.

Signed-off-by: Joyce Kong <joyce.kong@arm.com>
Reviewed-by: Ruifeng Wang <ruifeng.wang@arm.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
Acked-by: David Christensen <drc@linux.vnet.ibm.com>
3 years agomcslock: promote as stable
Joyce Kong [Fri, 11 Sep 2020 05:45:32 +0000 (13:45 +0800)]
mcslock: promote as stable

Since rte_mcslock APIs were introduced in 19.08 release,
it is now possible to remove the experimental tag from:
rte_mcslock_lock()
rte_mcslock_unlock()
rte_mcslock_trylock()
rte_mcslock_is_locked()

Signed-off-by: Joyce Kong <joyce.kong@arm.com>
Reviewed-by: Ruifeng Wang <ruifeng.wang@arm.com>
Acked-by: Phil Yang <phil.yang@arm.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
Acked-by: David Christensen <drc@linux.vnet.ibm.com>
3 years agoticketlock: promote as stable
Joyce Kong [Fri, 11 Sep 2020 05:45:31 +0000 (13:45 +0800)]
ticketlock: promote as stable

As rte_ticketlock was introduced in 19.05 release
and there were no changes in its public API since
19.11 release, it should be mature enough to remove
the experimental tag.

Signed-off-by: Joyce Kong <joyce.kong@arm.com>
Reviewed-by: Phil Yang <phil.yang@arm.com>
Reviewed-by: Ruifeng Wang <ruifeng.wang@arm.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
Acked-by: David Christensen <drc@linux.vnet.ibm.com>
3 years agoeal: promote wait until equal API as stable
Joyce Kong [Fri, 11 Sep 2020 05:45:34 +0000 (13:45 +0800)]
eal: promote wait until equal API as stable

rte_wait_until_equal_xx APIs were introduced in 19.11 release
and there were no changes in the public APIs since then, it
should be mature enough to remove the experimental tag.

Signed-off-by: Joyce Kong <joyce.kong@arm.com>
Reviewed-by: Phil Yang <phil.yang@arm.com>
Reviewed-by: Ruifeng Wang <ruifeng.wang@arm.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
Acked-by: David Christensen <drc@linux.vnet.ibm.com>
3 years agomaintainers: add titles for examples
Olivier Matz [Tue, 6 Oct 2020 07:03:02 +0000 (09:03 +0200)]
maintainers: add titles for examples

The devtools/get-maintainer.sh script does not work with examples
because there is no title line between them: it returns a longer list
than expected.

Add the missing titles for each example to fix this behavior.

Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
3 years agoexamples/vm_power: fix 32-bit build
Ferruh Yigit [Mon, 5 Oct 2020 17:02:01 +0000 (18:02 +0100)]
examples/vm_power: fix 32-bit build

Compiler version:
gcc 10.2.1 "cc (GCC) 10.2.1 20200723 (Red Hat 10.2.1-1)"

Build error:
../examples/vm_power_manager/guest_cli/vm_power_cli_guest.c:346:23:
 warning: format ‘%ld’ expects argument of type ‘long int’, but
argument 4 has type ‘uint64_t’ {aka ‘long long unsigned int’}
[-Wformat=]
  346 |    cmdline_printf(cl, "Capabilities of [%d] vcore are:"
      |                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
......
  349 |      pkt_caps_list.turbo[i],
      |      ~~~~~~~~~~~~~~~~~~~~~~
      |                         |
      |                         uint64_t {aka long long unsigned int}

Fixes: 07525d1a047a ("examples/vm_power: send capabilities request from guest")
Cc: stable@dpdk.org
Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
Tested-by: David Marchand <david.marchand@redhat.com>
Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
3 years agotest/raw: remove ioat-specific autotest
Bruce Richardson [Thu, 10 Sep 2020 16:47:16 +0000 (17:47 +0100)]
test/raw: remove ioat-specific autotest

Since the rawdev autotest can now be used to test all rawdevs on the
system, there is no need for a dedicated ioat autotest command.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Reviewed-by: Kevin Laatz <kevin.laatz@intel.com>
3 years agotest/raw: run selftest on all devices
Bruce Richardson [Thu, 10 Sep 2020 16:47:15 +0000 (17:47 +0100)]
test/raw: run selftest on all devices

Rather than having each rawdev provide its own autotest command, we can
instead just use the generic rawdev_autotest to test any and all available
rawdevs.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Reviewed-by: Kevin Laatz <kevin.laatz@intel.com>
3 years agoraw/ioat: support multiple devices being tested
Bruce Richardson [Thu, 10 Sep 2020 16:47:14 +0000 (17:47 +0100)]
raw/ioat: support multiple devices being tested

The current selftest function uses a single global variable to track state
which implies that only a single instance can have the selftest function
called on it. Change this to an array to allow multiple instances to be
tested.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Reviewed-by: Kevin Laatz <kevin.laatz@intel.com>
3 years agoraw/ntb: support Intel Ice Lake
Xiaoyun Li [Tue, 8 Sep 2020 03:27:54 +0000 (11:27 +0800)]
raw/ntb: support Intel Ice Lake

Add NTB device support (4th generation) for Intel Ice Lake platform.

Signed-off-by: Xiaoyun Li <xiaoyun.li@intel.com>
Acked-by: Jingjing Wu <jingjing.wu@intel.com>
3 years agodrivers/common: mark all symbols as internal
David Marchand [Thu, 1 Oct 2020 07:55:17 +0000 (09:55 +0200)]
drivers/common: mark all symbols as internal

Now that we have the internal tag, let's avoid confusion with exported
symbols in common drivers that were using the experimental tag as a
workaround.
There is also no need to put internal API symbols in the public stable
ABI.

Signed-off-by: David Marchand <david.marchand@redhat.com>
Acked-by: Anoob Joseph <anoobj@marvell.com>
Acked-by: Ray Kinsella <mdr@ashroe.eu>
3 years agoregex/mlx5: add dynamic memory registration to datapath
Yuval Avnery [Mon, 5 Oct 2020 10:51:20 +0000 (10:51 +0000)]
regex/mlx5: add dynamic memory registration to datapath

Currently job data is being copied to pre-registered buffer.
To avoid memcpy on the datapath, use dynamic memory registration.

This change will reduce latency when sending regex jobs. The first few
jobs may have high latency due to registration, but assuming all
following mbufs will arrive from the same mempool/hugepage, there will
be no further memory registration.

Signed-off-by: Yuval Avnery <yuvalav@nvidia.com>
Acked-by: Ori Kam <orika@nvidia.com>
3 years agomem: fix allocation in container with SELinux
David Marchand [Thu, 10 Sep 2020 16:24:07 +0000 (18:24 +0200)]
mem: fix allocation in container with SELinux

This is something we encountered while working in an OpenShift
environment with SELinux enabled.
In this environment, a DPDK application could create/write to hugepage
files but removing them was refused.
This resulted in dirty files being reused when starting a new DPDK
application and triggered random crashes / erratic behavior.

Getting a SELinux setup can be a challenge, and even more if you add
containers to the picture :-).
So here is a reproducer for the interested testers:

  # cat >wrap.c <<EOF
  #define _GNU_SOURCE
  #include <dlfcn.h>
  #include <errno.h>
  #include <stdio.h>
  #include <string.h>
  #include <sys/stat.h>
  #include <sys/types.h>
  #include <unistd.h>

  int unlink(const char *pathname)
  {
   static int (*orig)(const char *pathname) = NULL;
   struct stat st;

   if (orig == NULL)
   orig = dlsym(RTLD_NEXT, "unlink");
   if (strstr(pathname, "rtemap_") != NULL &&
stat(pathname, &st) == 0) {
   fprintf(stderr, "### refused unlink for %s\n",
   pathname);
   errno = EACCES;
   return -1;
   }
   fprintf(stderr, "### called unlink for %s\n", pathname);
   return orig(pathname);
  }

  int unlinkat(int dirfd, const char *pathname, int flags)
  {
   static int (*orig)(int dirfd, const char *pathname, int flags) =
   NULL;
   struct stat st;

   if (orig == NULL)
   orig = dlsym(RTLD_NEXT, "unlinkat");
   if (strstr(pathname, "rtemap_") != NULL &&
   fstatat(dirfd, pathname, &st, flags) == 0) {
   fprintf(stderr, "### refused unlinkat for %s\n",
   pathname);
   errno = EACCES;
   return -1;
   }
   fprintf(stderr, "### called unlinkat for %s\n", pathname);
   return orig(dirfd, pathname, flags);
  }
  EOF

  # gcc -fPIC -shared  -o libwrap.so wrap.c -ldl
  # \rm /dev/hugepages/rtemap*

  # # First run is fine
  # LD_PRELOAD=libwrap.so dpdk-testpmd -w 0000:01:00.0 -- -i
  [...]
  Configuring Port 0 (socket 0)
  Port 0: 24:6E:96:3C:52:D8
  Checking link statuses...
  Done
  testpmd>

  # # Second run we have dirty memory
  # LD_PRELOAD=libwrap.so dpdk-testpmd -w 0000:01:00.0 -- -i
  [...]
  ### refused unlinkat for rtemap_0
  [...]
  Port 0 is now not stopped
  Please stop the ports first
  Done
  testpmd>

Removing hugepage files is done in multiple places and the memory
allocation code is complex.
This fix tries to do the minimum and avoids touching other paths.

If trying to remove the hugepage file before allocating a page fails,
the error is reported to the caller and the user will see a memory
allocation error log.

Fixes: 582bed1e1d1d ("mem: support mapping hugepages at runtime")
Cc: stable@dpdk.org
Signed-off-by: David Marchand <david.marchand@redhat.com>
Acked-by: Anatoly Burakov <anatoly.burakov@intel.com>
3 years agomempool: dump socket attribute
Sachin Saxena [Fri, 11 Sep 2020 08:13:16 +0000 (13:43 +0530)]
mempool: dump socket attribute

Enhance the dump function to also print socket_id attribute
passed at creation time.

Signed-off-by: Sachin Saxena <sachin.saxena@oss.nxp.com>
Acked-by: Andrew Rybchenko <arybchenko@solarflare.com>