dpdk.git
2 years agocommon/cnxk: fix unaligned access to device memory
Satheesh Paul [Wed, 20 Apr 2022 06:38:25 +0000 (12:08 +0530)]
common/cnxk: fix unaligned access to device memory

Use mbox_memcpy() instead of memcpy() to prevent unaligned access.

Fixes: 1f66919817e ("common/cnxk: improve MCAM entries management")
Cc: stable@dpdk.org
Signed-off-by: Satheesh Paul <psatheesh@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
2 years agonet/cnxk: add message on flow parsing failure
Satheesh Paul [Tue, 19 Apr 2022 06:34:38 +0000 (12:04 +0530)]
net/cnxk: add message on flow parsing failure

Set the error message with rte_flow_error_set() API
when flow parsing fails.

Fixes: 8c009b4505e ("net/cnxk: support flow API")
Cc: stable@dpdk.org
Signed-off-by: Satheesh Paul <psatheesh@marvell.com>
Reviewed-by: Kiran Kumar K <kirankumark@marvell.com>
2 years agonet/cnxk: use ROC errata API
Rahul Bhansali [Wed, 30 Mar 2022 08:43:56 +0000 (14:13 +0530)]
net/cnxk: use ROC errata API

Used errata APIs roc_errata_nix_has_no_drop_re() and
roc_errata_nix_has_cq_min_size_4k() instead of direct
ROC model check.

Signed-off-by: Rahul Bhansali <rbhansali@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
2 years agocommon/cnxk: add ROC errata list
Rahul Bhansali [Wed, 30 Mar 2022 08:43:55 +0000 (14:13 +0530)]
common/cnxk: add ROC errata list

Created roc_errata.h to list the errata handled in userspace drivers.
Added no_drop_re, cq_min_size_4k, no_fc_stype_ststp, no_drop_aging,
no_vwqe_flush_op etc erratas.

Signed-off-by: Rahul Bhansali <rbhansali@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
2 years agonet/cnxk: fix crash during hotplug detach operation
Sunil Kumar Kori [Tue, 29 Mar 2022 10:28:57 +0000 (15:58 +0530)]
net/cnxk: fix crash during hotplug detach operation

hot_plug application does not perform any port setup
configuration via rte_eth_dev_configure() API. All the probed
Ethernet ports do not contain any Rx and Tx queues.

While detaching a device via rte_eal_hotplug_remove(), CNXK
driver expects Rx and Tx queues structures populated during
reset of PFC. So application gets crashed as data->rx_queues
and data->tx_queues are NULL.

Fixes: 9544713564f5 ("net/cnxk: support priority flow control")
Cc: stable@dpdk.org
Signed-off-by: Sunil Kumar Kori <skori@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
2 years agocommon/cnxk: add null check for inline device
Volodymyr Fialko [Mon, 28 Mar 2022 10:41:02 +0000 (12:41 +0200)]
common/cnxk: add null check for inline device

Inline device could be null in cases when it was not bound or missing.
Added check to prevent null pointer access.

Fixes: fe5846bcc07 ("net/cnxk: add devargs for min-max SPI")
Cc: stable@dpdk.org
Signed-off-by: Volodymyr Fialko <vfialko@marvell.com>
2 years agocommon/cnxk: fix QinQ ROC item mismatch
Satheesh Paul [Thu, 17 Mar 2022 03:50:36 +0000 (09:20 +0530)]
common/cnxk: fix QinQ ROC item mismatch

ROC code is assuming presence of vlan extension headers in
case of QinQ, because of this, there is incompatibility
between the driver and ROC. Fixed this in ROC by treating
QINQ as multiple VLAN pattern items for DPDK (as opposed to
treating QINQ as separate pattern item).

Fixes: b8ac8b089ce ("common/cnxk: support matching VLAN existence")
Cc: stable@dpdk.org
Signed-off-by: Satheesh Paul <psatheesh@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
2 years agocommon/cnxk: correct ROC naming conventions
Satheesh Paul [Thu, 17 Mar 2022 03:50:35 +0000 (09:20 +0530)]
common/cnxk: correct ROC naming conventions

Corrected some names to follow ROC naming convention in ROC NPC code.

Signed-off-by: Satheesh Paul <psatheesh@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
2 years agonet/cnxk: support mark pattern item type
Satheesh Paul [Mon, 28 Feb 2022 04:53:22 +0000 (10:23 +0530)]
net/cnxk: support mark pattern item type

Added support for RTE_FLOW_ITEM_TYPE_MARK. This item type
can be used to create ingress flow rules to match packets
from CPT's second pass packets.

Signed-off-by: Satheesh Paul <psatheesh@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
2 years agocommon/cnxk: support CPT second pass flow rules
Satheesh Paul [Mon, 28 Feb 2022 04:53:21 +0000 (10:23 +0530)]
common/cnxk: support CPT second pass flow rules

Added support to create flow rules to match packets
from CPT's second pass packets. With this change, ingress
rules will be created with bits 10 and 11 of channel field
in the MCAM ignored by default. For rules specific to
second pass packets, the CPT channel bits will be set
in the MCAM.

Signed-off-by: Satheesh Paul <psatheesh@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
2 years agoapp/testpmd: fix MTU verification
Huisong Li [Wed, 6 Apr 2022 08:45:37 +0000 (16:45 +0800)]
app/testpmd: fix MTU verification

The macro RTE_ETHER_MIN_LEN isn't the minimum value of MTU. But testpmd
used it when execute 'port config mtu 0 xx' cmd. This patch fixes it.

Fixes: 1bb4a528c41f ("ethdev: fix max Rx packet length")
Cc: stable@dpdk.org
Signed-off-by: Huisong Li <lihuisong@huawei.com>
Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
Acked-by: Ferruh Yigit <ferruh.yigit@xilinx.com>
2 years agoapp/testpmd: check statistics query before printing
Min Hu (Connor) [Wed, 6 Apr 2022 08:45:36 +0000 (16:45 +0800)]
app/testpmd: check statistics query before printing

In function 'fwd_stats_display', if function 'rte_eth_stats_get' fails,
'stats' is uncertainty value. The display result will be abnormal.

This patch check the return value of 'rte_eth_stats_get' to avoid
display abnormal stats.

Fixes: 53324971a14e ("app/testpmd: display/clear forwarding stats on demand")
Cc: stable@dpdk.org
Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
Acked-by: Aman Singh <aman.deep.singh@intel.com>
2 years agonet/hns3: remove unnecessary RSS switch
Huisong Li [Wed, 6 Apr 2022 06:57:01 +0000 (14:57 +0800)]
net/hns3: remove unnecessary RSS switch

Whether the RSS is enabled depends on RTE_ETH_MQ_RX_RSS_FLAG and packet
tuple are enabled. So the RSS switch is unnecessary.

Fixes: 5e782bc2570c ("net/hns3: fix configuring RSS hash when rules are flushed")
Fixes: fd8196838763 ("net/hns3: fix configuring device with RSS enabled")
Cc: stable@dpdk.org
Signed-off-by: Huisong Li <lihuisong@huawei.com>
Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
2 years agoethdev: fix RSS update when RSS is disabled
Huisong Li [Wed, 6 Apr 2022 06:57:00 +0000 (14:57 +0800)]
ethdev: fix RSS update when RSS is disabled

The RTE_ETH_MQ_RX_RSS_FLAG flag is a switch to enable RSS. If the flag
is not set in dev_configure, RSS will be not configured and enabled.
However, RSS hash and reta can still be configured by ethdev ops to
enable RSS if the flag isn't set. The behavior is inconsistent.

Fixes: 99a2dd955fba ("lib: remove librte_ prefix from directory names")
Cc: stable@dpdk.org
Signed-off-by: Huisong Li <lihuisong@huawei.com>
Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@xilinx.com>
2 years agonet/hns3: remove redundant RSS tuple field
Huisong Li [Thu, 5 May 2022 12:27:07 +0000 (20:27 +0800)]
net/hns3: remove redundant RSS tuple field

The 'rss_tuple_fields' in struct struct hns3_rss_conf::rss_tuple_sets is
redundant. Because the enabled RSS tuple in PMD is already managed by
the 'types' in struct hns3_rss_conf::conf. This patch removes this
redundant variable.

Fixes: c37ca66f2b27 ("net/hns3: support RSS")
Cc: stable@dpdk.org
Signed-off-by: Huisong Li <lihuisong@huawei.com>
Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
2 years agonet/hns3: fix rollback on RSS hash update
Huisong Li [Thu, 5 May 2022 12:27:06 +0000 (20:27 +0800)]
net/hns3: fix rollback on RSS hash update

The RSS tuple isn't restored when RSS key length is invalid or setting
algo key failed. This patch fixes it.

Fixes: c37ca66f2b27 ("net/hns3: support RSS")
Cc: stable@dpdk.org
Signed-off-by: Huisong Li <lihuisong@huawei.com>
Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
2 years agonet/hns3: fix RSS disable
Huisong Li [Thu, 5 May 2022 12:27:05 +0000 (20:27 +0800)]
net/hns3: fix RSS disable

Currently, hns3 PMD disable RSS by resetting redirection table when user
set rss_hf to 0 so as to all packets go to queue 0. The implementation
may cause following problems:
1) the same type packet may go to different queue on the case of
   disabling all tuples and partial tuples. The problem is determined by
   hardware design.
2) affect the configuration of redirection table and user experience.

For hns3 hardware, the packets with RSS disabled are always go to the
queue corresponding to first entry of the redirection table. Generally,
disable RSS should be implemented by disabling all tuples, This patch
fix the implementation.

Fixes: c37ca66f2b27 ("net/hns3: support RSS")
Cc: stable@dpdk.org
Signed-off-by: Huisong Li <lihuisong@huawei.com>
Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
2 years agonet/hns3: fix mbuf free on Tx done cleanup
Chengwen Feng [Thu, 5 May 2022 12:27:04 +0000 (20:27 +0800)]
net/hns3: fix mbuf free on Tx done cleanup

Currently, the hns3 PMD may free more mbufs than free_cnt parameter,
this is an incorrect implementation. This patch fixes it.

Fixes: 0b77e8f3d364 ("net/hns3: optimize Tx performance")
Cc: stable@dpdk.org
Signed-off-by: Chengwen Feng <fengchengwen@huawei.com>
Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
2 years agonet/hns3: fix pseudo-sharing between threads
Huisong Li [Thu, 5 May 2022 12:27:03 +0000 (20:27 +0800)]
net/hns3: fix pseudo-sharing between threads

Some fields in the end of 'struct hns3_rx_queue' and
'struct hns3_tx_queue' are not accessed in the I/O path.
But these fields may be accessed in other threads, which may lead to the
problem of cache pseudo-sharing of IO threads. This patch add a
cacheline alignment to avoid it.

Fixes: 9261fd3caf1f ("net/hns3: improve IO path data cache usage")
Cc: stable@dpdk.org
Signed-off-by: Huisong Li <lihuisong@huawei.com>
Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
2 years agonet/hns3: fix MAC and queues HW statistics overflow
Huisong Li [Thu, 5 May 2022 12:27:02 +0000 (20:27 +0800)]
net/hns3: fix MAC and queues HW statistics overflow

The MAC and queues statistics are 32-bit registers in hardware. If
hardware statistics are not obtained for a long time, these statistics
will be overflow.
So PF and VF driver have to periodically obtain and save these
statistics. Since the periodical task and the stats API are in different
threads, we introduce a statistics lock to protect the statistics.

Fixes: 8839c5e202f3 ("net/hns3: support device stats")
Cc: stable@dpdk.org
Signed-off-by: Huisong Li <lihuisong@huawei.com>
Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
2 years agonet/hns3: fix order of clearing imissed register in PF
Huisong Li [Thu, 5 May 2022 12:27:01 +0000 (20:27 +0800)]
net/hns3: fix order of clearing imissed register in PF

Clearing imissed registers in PF hardware depends on the
'drop_stats_mode' in struct hns3_hw. The variable is initialized after
the "hns3_get_configuration". But, in current code, the clearing
operation runs before the function.
So this patch fixes this order. In addition, this patch extracts a
public function to initialize and uninitialize statistics to improve the
maintainability of these codes.

Fixes: 3e9f3042d7c8 ("net/hns3: add imissed packet stats")
Cc: stable@dpdk.org
Signed-off-by: Huisong Li <lihuisong@huawei.com>
Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
2 years agoethdev: fix build with vtune option
Aman Singh [Thu, 5 May 2022 13:01:38 +0000 (18:31 +0530)]
ethdev: fix build with vtune option

When VTune profile option is enabled, compilation error is seen.

Bugzilla ID: 1004
Fixes: f9bdee267ab8 ("ethdev: hide internal structures")
Cc: stable@dpdk.org
Signed-off-by: Aman Singh <aman.deep.singh@intel.com>
Reviewed-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
2 years agonet/tap: fix interrupt handler freeing
Quentin Armitage [Tue, 3 May 2022 15:27:32 +0000 (16:27 +0100)]
net/tap: fix interrupt handler freeing

rte_pmd_tun/tap_probe() allocates pmd->intr_handle in eth_dev_tap_create()
and it should not be freed until rte_pmd_tap_remove() is called.

Inspection of tap_rx_intr_vec_set() shows that the call to
tap_tx_intr_vec_uninstall() was calling rte_intr_instance_free() but
tap_tx_intr_vec_install() can then be immediately called, and this then
uses pmd->intr_handle without it being reallocated.

Move rte_intr_instance_free() call from tap_tx_intr_vec_uninstall()
to rte_pmd_tap_remove().

Fixes: d61138d4f0e2 ("drivers: remove direct access to interrupt handle")
Cc: stable@dpdk.org
Signed-off-by: Quentin Armitage <quentin@armitage.org.uk>
Reviewed-by: David Marchand <david.marchand@redhat.com>
2 years agonet/bonding: fix slave stop and remove on port close
Huisong Li [Tue, 3 May 2022 10:02:14 +0000 (18:02 +0800)]
net/bonding: fix slave stop and remove on port close

All slaves will be stopped and removed when closing a bonded port.
But the while loop can not end if both rte_eth_dev_stop and
rte_eth_bond_slave_remove fails, runs infinitely.
This is because the skipped slave port counted in both function failures
but it should be counted only one.

Fixing by not continue to process in the loop after first failure.

Fixes: fb0379bc5db3 ("net/bonding: check stop call status")
Cc: stable@dpdk.org
Signed-off-by: Huisong Li <lihuisong@huawei.com>
Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
2 years agonet/bonding: fix stopping non-active slaves
Huisong Li [Tue, 3 May 2022 10:02:13 +0000 (18:02 +0800)]
net/bonding: fix stopping non-active slaves

When stopping a bonded port, all slaves should be stopped. But only
active slaves are stopped.
So fix by stopping all slave ports and later do "deactivate_slave()" for
active slaves.

Fixes: 0911d4ec0183 ("net/bonding: fix crash when stopping mode 4 port")
Cc: stable@dpdk.org
Signed-off-by: Huisong Li <lihuisong@huawei.com>
Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
2 years agonet/ice: support power management in DCF mode
Kevin Liu [Fri, 29 Apr 2022 09:19:57 +0000 (09:19 +0000)]
net/ice: support power management in DCF mode

Implement support for the power management API by implementing a
'get_monitor_addr' function that will return an address of an RX ring's
status bit.

Signed-off-by: Kevin Liu <kevinx.liu@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
2 years agonet/ice: support DCF queue information query
Kevin Liu [Fri, 29 Apr 2022 09:19:56 +0000 (09:19 +0000)]
net/ice: support DCF queue information query

Add below ops,
rxq_info_get
txq_info_get

Signed-off-by: Kevin Liu <kevinx.liu@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
2 years agonet/ice: support extended statistics in DCF mode
Kevin Liu [Fri, 29 Apr 2022 09:19:55 +0000 (09:19 +0000)]
net/ice: support extended statistics in DCF mode

Add implementation of xstats() functions in DCF PMD.

Signed-off-by: Kevin Liu <kevinx.liu@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
2 years agonet/ice: support DCF VLAN filter and offload
Alvin Zhang [Fri, 29 Apr 2022 09:19:54 +0000 (09:19 +0000)]
net/ice: support DCF VLAN filter and offload

Below PMD ops are supported in this patch:
    .vlan_filter_set  = dcf_dev_vlan_filter_set
    .vlan_offload_set = dcf_dev_vlan_offload_set

Signed-off-by: Alvin Zhang <alvinx.zhang@intel.com>
Signed-off-by: Kevin Liu <kevinx.liu@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
2 years agonet/ice: support DCF MAC configuration
Kevin Liu [Fri, 29 Apr 2022 09:19:53 +0000 (09:19 +0000)]
net/ice: support DCF MAC configuration

Below PMD ops are supported in this patch:
    .mac_addr_add      = dcf_dev_add_mac_addr
    .mac_addr_remove   = dcf_dev_del_mac_addr
    .set_mc_addr_list  = dcf_set_mc_addr_list
    .mac_addr_set      = dcf_dev_set_default_mac_addr

Signed-off-by: Alvin Zhang <alvinx.zhang@intel.com>
Signed-off-by: Kevin Liu <kevinx.liu@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
2 years agonet/ice: support DCF promiscuous configuration
Alvin Zhang [Fri, 29 Apr 2022 09:19:52 +0000 (09:19 +0000)]
net/ice: support DCF promiscuous configuration

Support configuration of unicast and multicast promisc on dcf.

Signed-off-by: Alvin Zhang <alvinx.zhang@intel.com>
Signed-off-by: Kevin Liu <kevinx.liu@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
2 years agonet/ice: add supported packet types query to DCF mode
Jie Wang [Fri, 29 Apr 2022 09:19:51 +0000 (09:19 +0000)]
net/ice: add supported packet types query to DCF mode

Add API "dev_supported_ptypes_get" to DCF, that DCF pmd can get
ptypes through the new API.

Signed-off-by: Jie Wang <jie1x.wang@intel.com>
Signed-off-by: Kevin Liu <kevinx.liu@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
2 years agonet/ice: support MTU configuration in DCF mode
Jie Wang [Fri, 29 Apr 2022 09:19:50 +0000 (09:19 +0000)]
net/ice: support MTU configuration in DCF mode

add API "mtu_set" to dcf, and it can configure the port mtu through
cmdline.

Signed-off-by: Jie Wang <jie1x.wang@intel.com>
Signed-off-by: Kevin Liu <kevinx.liu@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
2 years agonet/ice: support Tx buffers cleanup in DCF mode
Robin Zhang [Fri, 29 Apr 2022 09:19:49 +0000 (09:19 +0000)]
net/ice: support Tx buffers cleanup in DCF mode

Add support for ops rte_eth_tx_done_cleanup in dcf

Signed-off-by: Robin Zhang <robinx.zhang@intel.com>
Signed-off-by: Kevin Liu <kevinx.liu@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
2 years agonet/ice: support RSS hash configuration in DCF mode
Steve Yang [Fri, 29 Apr 2022 09:19:48 +0000 (09:19 +0000)]
net/ice: support RSS hash configuration in DCF mode

RSS HASH should be updated and queried by application,
Add related ops ('.rss_hash_update', '.rss_hash_conf_get') for DCF.

Because DCF doesn't support configure RSS HASH, only HASH key can be
updated within ops '.rss_hash_update'.

Signed-off-by: Steve Yang <stevex.yang@intel.com>
Signed-off-by: Kevin Liu <kevinx.liu@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
2 years agonet/ice: support RSS RETA configuration in DCF mode
Steve Yang [Fri, 29 Apr 2022 09:19:47 +0000 (09:19 +0000)]
net/ice: support RSS RETA configuration in DCF mode

RSS RETA should be updated and queried by application,
Add related ops ('.reta_update', '.reta_query') for DCF.

Signed-off-by: Steve Yang <stevex.yang@intel.com>
Signed-off-by: Kevin Liu <kevinx.liu@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
2 years agonet/iavf: improve performance of Rx timestamp offload
Wenjun Wu [Thu, 28 Apr 2022 08:13:46 +0000 (16:13 +0800)]
net/iavf: improve performance of Rx timestamp offload

In this patch, We use CPU ticks instead of HW register
to determine whether low 32 bits timestamp has turned
over. It can avoid requesting register value frequently
and improve receiving performance.

Signed-off-by: Wenjun Wu <wenjun1.wu@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
2 years agonet/iavf: enable Rx timestamp on flex descriptor
Simei Su [Thu, 28 Apr 2022 08:13:45 +0000 (16:13 +0800)]
net/iavf: enable Rx timestamp on flex descriptor

Dump Rx timestamp value into dynamic mbuf field by flex descriptor.
This feature is turned on by dev config "enable-rx-timestamp".
Currently, it's only supported under scalar path.

Signed-off-by: Simei Su <simei.su@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
2 years agocommon/iavf: support Rx timestamp in virtual channel
Simei Su [Thu, 28 Apr 2022 08:13:44 +0000 (16:13 +0800)]
common/iavf: support Rx timestamp in virtual channel

Add new ops and structures to support VF to support Rx timestamp
on flex descriptor.

"VIRTCHNL_OP_1588_PTP_GET_CAPS" ops is sent by the VF to request PTP
capabilities and responded by the PF with capabilities enabled for
that VF.

"VIRTCHNL_OP_1588_PTP_GET_TIME" ops is sent by the VF to request
the current time of the PHC. The PF will respond by reading the
device time and reporting it back to the VF.

Signed-off-by: Simei Su <simei.su@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
2 years agonet/ixgbe: promote MDIO API
Zhichao Zeng [Tue, 19 Apr 2022 11:06:13 +0000 (11:06 +0000)]
net/ixgbe: promote MDIO API

Promote the MDIO APIs to be stable.

Signed-off-by: Zhichao Zeng <zhichaox.zeng@intel.com>
Acked-by: Ray Kinsella <mdr@ashroe.eu>
2 years agodoc: update matching versions in ice guide
Qiming Yang [Tue, 26 Apr 2022 05:36:29 +0000 (13:36 +0800)]
doc: update matching versions in ice guide

Add recommended matching list for ice PMD in DPDK 22.03.

Cc: stable@dpdk.org
Signed-off-by: Qiming Yang <qiming.yang@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
2 years agonet/ice: optimize maximum queue number calculation
Qi Zhang [Fri, 8 Apr 2022 11:23:43 +0000 (19:23 +0800)]
net/ice: optimize maximum queue number calculation

Remove the limitation that max queue pair number must be 2^n.
With this patch, even on a 8 ports device, the max queue pair
number increased from 128 to 254.

Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Wenjun Wu <wenjun1.wu@intel.com>
2 years agonet/dpaa: fix event queue detach
Gagandeep Singh [Fri, 22 Apr 2022 04:57:29 +0000 (10:27 +0530)]
net/dpaa: fix event queue detach

Calling the correct qman queue free APIs to de-attach the queue.

Fixes: 5e7455931442 ("net/dpaa: support Rx queue configurations with eventdev")
Cc: stable@dpdk.org
Signed-off-by: Gagandeep Singh <g.singh@nxp.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
2 years agonet/dpaa2: support ESP in packet type parsing
Gagandeep Singh [Fri, 22 Apr 2022 04:57:28 +0000 (10:27 +0530)]
net/dpaa2: support ESP in packet type parsing

This patch supports ESP packet type in packet parsing.

Signed-off-by: Gagandeep Singh <g.singh@nxp.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
2 years agonet/dpaa2: support mempool debug
Gagandeep Singh [Fri, 22 Apr 2022 04:57:27 +0000 (10:27 +0530)]
net/dpaa2: support mempool debug

This patch supports mempool debug to detect
buffer overflows.

Signed-off-by: Gagandeep Singh <g.singh@nxp.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
2 years agonet/dpaa2: update management complex to 10.32
Rohit Raj [Fri, 22 Apr 2022 04:57:26 +0000 (10:27 +0530)]
net/dpaa2: update management complex to 10.32

Updating the management complex to version 10.32

Signed-off-by: Rohit Raj <rohit.raj@nxp.com>
Signed-off-by: Gagandeep Singh <g.singh@nxp.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
2 years agonet/nfp: update how max MTU is read
Walter Heymans [Wed, 20 Apr 2022 13:46:39 +0000 (15:46 +0200)]
net/nfp: update how max MTU is read

The 'max_rx_pktlen' value was previously read from hardware, which was
set by the running firmware. This caused confusion due to different
meanings of 'MAX_MTU'. This patch updates the 'max_rx_pktlen' to the
maximum value that the NFP NIC can support. The 'max_mtu' value that is
read from hardware, is assigned to the 'dev_info->max_mtu' variable.

If more layer 2 metadata must be used, the firmware can be updated to
report a smaller 'max_mtu' value.

The constant defined for NFP_FRAME_SIZE_MAX is derived for the maximum
supported buffer size of 10240, minus 136 bytes that is reserved by the
hardware and another 56 bytes reserved for expansion in firmware. This
results in a usable maximum packet length of 10048 bytes.

Signed-off-by: Walter Heymans <walter.heymans@corigine.com>
Signed-off-by: Niklas Söderlund <niklas.soderlund@corigine.com>
Reviewed-by: Louis Peens <louis.peens@corigine.com>
Reviewed-by: Chaoyong He <chaoyong.he@corigine.com>
Reviewed-by: Richard Donkin <richard.donkin@corigine.com>
2 years agovdpa/mlx5: make statistics counter persistent
Xueming Li [Sun, 8 May 2022 14:25:54 +0000 (17:25 +0300)]
vdpa/mlx5: make statistics counter persistent

In order to speed-up the device suspend and resume, make the statistics
counters persistent in reconfiguration until the device gets removed.

Signed-off-by: Xueming Li <xuemingl@nvidia.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
2 years agovdpa/mlx5: support device cleanup callback
Xueming Li [Sun, 8 May 2022 14:25:53 +0000 (17:25 +0300)]
vdpa/mlx5: support device cleanup callback

This patch supports device cleanup callback API which is called when
the device is disconnected from the VM. Cached resources like VM MR and
VQ memory are released.

Signed-off-by: Xueming Li <xuemingl@nvidia.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
2 years agovdpa/mlx5: cache and reuse hardware resources
Xueming Li [Sun, 8 May 2022 14:25:52 +0000 (17:25 +0300)]
vdpa/mlx5: cache and reuse hardware resources

During device suspend and resume, resources are not changed normally.
When huge resources were allocated to VM, like huge memory size or lots
of queues, time spent on release and recreate became significant.

To speed up, this patch reuses resources like VM MR and VirtQ memory if
not changed.

Signed-off-by: Xueming Li <xuemingl@nvidia.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
2 years agovdpa/mlx5: reuse resources in reconfiguration
Xueming Li [Sun, 8 May 2022 14:25:51 +0000 (17:25 +0300)]
vdpa/mlx5: reuse resources in reconfiguration

To speed up device resume, create reuseable resources during device
probe state, release when device is removed. Reused resources includes
TIS,
TD, VAR Doorbell mmap, error handling event channel and interrupt
handler, UAR, Rx event channel, NULL MR, steer domain and table.

Signed-off-by: Xueming Li <xuemingl@nvidia.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
2 years agovdpa/mlx5: avoid kick handling during shutdown
Xueming Li [Sun, 8 May 2022 14:25:50 +0000 (17:25 +0300)]
vdpa/mlx5: avoid kick handling during shutdown

When Qemu suspends a VM, HW notifier is un-mmapped while vCPU thread may
still be active and write notifier through kick socket.

PMD kick handler thread tries to install HW notifier through client
socket. In such case, it will timeout and slow down device close.

This patch skips HW notifier install if VQ or device in middle of
shutdown.

Signed-off-by: Xueming Li <xuemingl@nvidia.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
2 years agovdpa/mlx5: fix dead loop when process interrupted
Xueming Li [Sun, 8 May 2022 14:25:49 +0000 (17:25 +0300)]
vdpa/mlx5: fix dead loop when process interrupted

In Ctrl+C handling, sometimes kick handling thread gets endless EGAIN
error and fall into dead lock.

Kick happens frequently in real system due to busy traffic or retry
mechanism. This patch simplifies kick firmware anyway and skip setting
hardware notifier due to potential device error, notifier could be set
in next successful kick request.

Fixes: 62c813706e41 ("vdpa/mlx5: map doorbell")
Cc: stable@dpdk.org
Signed-off-by: Xueming Li <xuemingl@nvidia.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
2 years agovdpa/mlx5: fix interrupt trash that leads to crash
Xueming Li [Sun, 8 May 2022 14:25:48 +0000 (17:25 +0300)]
vdpa/mlx5: fix interrupt trash that leads to crash

Disable interrupt unregister timeout to avoid invalid FD caused
interrupt thread segment fault.

Fixes: 62c813706e41 ("vdpa/mlx5: map doorbell")
Cc: stable@dpdk.org
Signed-off-by: Xueming Li <xuemingl@nvidia.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
2 years agovhost: fix missing virtqueue lock protection
Maxime Coquelin [Thu, 24 Mar 2022 12:46:34 +0000 (13:46 +0100)]
vhost: fix missing virtqueue lock protection

This patch ensures virtqueue metadata are not being
modified while rte_vhost_vring_call() is executed.

Fixes: 6c299bb7322f ("vhost: introduce vring call API")
Cc: stable@dpdk.org
Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Reviewed-by: David Marchand <david.marchand@redhat.com>
2 years agovhost: validate FDs attached to messages
David Marchand [Mon, 25 Apr 2022 12:54:30 +0000 (14:54 +0200)]
vhost: validate FDs attached to messages

Some message handlers do not expect any file descriptor attached as
ancillary data.
Provide a common way to enforce this by adding a accepts_fd boolean in
the message handler structure. When a message handler sets accepts_fd to
true, it is responsible for calling validate_msg_fds with a right
expected file descriptor count.
This will avoid leaking some file descriptor by mistake when adding
support for new vhost user message types.

Signed-off-by: David Marchand <david.marchand@redhat.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
2 years agovhost: refactor messages handlers declaration
David Marchand [Mon, 25 Apr 2022 12:54:29 +0000 (14:54 +0200)]
vhost: refactor messages handlers declaration

Move message handler description and callbacks into a single array and
remove unneeded VHOST_USER_MAX and VHOST_SLAVE_MAX enums.

Signed-off-by: David Marchand <david.marchand@redhat.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
2 years agonet/vhost: fix TSO feature default disablement
Maxime Coquelin [Fri, 22 Apr 2022 09:35:43 +0000 (11:35 +0200)]
net/vhost: fix TSO feature default disablement

By default, TSO feature should be disabled because it requires
application's support to be functional as mentioned in the
documentation.

However, if "tso" devarg was not specified, the feature did
not get disabled.

This patch fixes this issue, so that TSO is disabled, even if
"tso=0" is not passed as devarg.

Fixes: e289400669d5 ("net/vhost: support TSO disabling")
Cc: stable@dpdk.org
Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Reviewed-by: David Marchand <david.marchand@redhat.com>
2 years agonet/virtio: restore some optimisations with AVX512
David Marchand [Mon, 11 Apr 2022 15:04:20 +0000 (17:04 +0200)]
net/virtio: restore some optimisations with AVX512

Those optimisations were only enabled with make builds, fix the meson
part.

Fixes: 77d66da83834 ("net/virtio: add vectorized packed ring Rx")
Cc: stable@dpdk.org
Signed-off-by: David Marchand <david.marchand@redhat.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
2 years agoexamples/vhost: use API to check in-flight packets
Xuan Ding [Fri, 8 Apr 2022 10:22:14 +0000 (10:22 +0000)]
examples/vhost: use API to check in-flight packets

In async data path, call rte_vhost_async_get_inflight_thread_unsafe()
API to directly return the number of in-flight packets instead of
maintaining a local variable.

Signed-off-by: Xuan Ding <xuan.ding@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
2 years agovhost: add unsafe API to check in-flight packets
Xuan Ding [Fri, 8 Apr 2022 10:22:13 +0000 (10:22 +0000)]
vhost: add unsafe API to check in-flight packets

In async data path, when vring state changes or device is destroyed,
it is necessary to know the number of in-flight packets in DMA engine.
This patch provides a thread unsafe API to return the number of
in-flight packets for a vhost queue without using any lock.

Signed-off-by: Xuan Ding <xuan.ding@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
2 years agonet/vhost: fix access to freed memory
Yuan Wang [Fri, 11 Mar 2022 16:35:12 +0000 (00:35 +0800)]
net/vhost: fix access to freed memory

This patch fixes heap-use-after-free reported by ASan.

It is possible for the rte_vhost_dequeue_burst() to access the vq
is freed when numa_realloc() gets called in the device running state.
The control plane will set the vq->access_lock to protected the vq
from the data plane. Unfortunately the lock will fail at the moment
the vq is freed, allowing the rte_vhost_dequeue_burst() to access
the fields of the vq, which will trigger a heap-use-after-free error.

In the case of multiple queues, the vhost pmd can access other queues
that are not ready when the first queue is ready, which makes no sense
and also allows numa_realloc() and rte_vhost_dequeue_burst() access to
vq to happen at the same time. By controlling vq->allow_queuing we can make
the pmd access only the queues that are ready.

Fixes: 1ce3c7fe149 ("net/vhost: emulate device start/stop behavior")

Signed-off-by: Yuan Wang <yuanx.wang@intel.com>
Tested-by: Wei Ling <weix.ling@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
2 years agonet/virtio: support NAPI when using vhost-net backend
Harold Huang [Wed, 2 Mar 2022 09:41:05 +0000 (17:41 +0800)]
net/virtio: support NAPI when using vhost-net backend

In patch [1], NAPI has been supported in kernel tun driver to accelerate
packet processing received from vhost-net. This will greatly improve the
throughput of the tap device in the vhost-net backend.

[1]: https://git.kernel.org/pub/scm/linux/kernel/git/netdev/net-next.git/commit/?id=fb3f903769e8

Signed-off-by: Harold Huang <baymaxhuang@gmail.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
2 years agonet/cxgbe: simplify Rx payload buffer size posting
Rahul Lakkireddy [Mon, 18 Apr 2022 22:24:20 +0000 (03:54 +0530)]
net/cxgbe: simplify Rx payload buffer size posting

Match the closest supported Rx payload buffer size with the mempool
data size and program it for the Rx queue. This removes unnecessary
need for handling additional padding, packing, and alignment, when
posting Rx buffers to hardware.

Signed-off-by: Rahul Lakkireddy <rahul.lakkireddy@chelsio.com>
2 years agonet/cxgbe: fix Tx queue stuck with mbuf chain coalescing
Rahul Lakkireddy [Mon, 18 Apr 2022 22:24:19 +0000 (03:54 +0530)]
net/cxgbe: fix Tx queue stuck with mbuf chain coalescing

When trying to coalesce mbufs with chain on Tx side, it is possible
to get stuck during queue wrap around. When coalescing this mbuf
chain fails, the Tx path returns EBUSY and when the same packet
is retried again, it couldn't get coalesced again, and the loop
repeats. Fix by pushing the packet through the normal Tx path.
Also use FW_ETH_TX_PKTS_WR to handle mbufs with chain for FW
to optimize.

Fixes: 6c2809628cd5 ("net/cxgbe: improve latency for slow traffic")
Cc: stable@dpdk.org
Signed-off-by: Rahul Lakkireddy <rahul.lakkireddy@chelsio.com>
2 years agonet/cxgbe: fix port ID in Rx mbuf
Rahul Lakkireddy [Mon, 18 Apr 2022 22:24:18 +0000 (03:54 +0530)]
net/cxgbe: fix port ID in Rx mbuf

Fill the correct DPDK ethdev port_id, instead of local adapter
physical port_id in mbufs allocated for Rx.

Fixes: 78fc1a716ae8 ("cxgbe: improve Rx performance")
Cc: stable@dpdk.org
Signed-off-by: Rahul Lakkireddy <rahul.lakkireddy@chelsio.com>
2 years agonet/hns3: fix device info dump
Min Hu (Connor) [Thu, 14 Apr 2022 13:00:56 +0000 (21:00 +0800)]
net/hns3: fix device info dump

Rx/Tx queue info dump and pvid info dump is both supported
in PF and VF. This patch fixed it.

Fixes: 1a03c659cb9d ("net/hns3: dump device basic info")
Cc: stable@dpdk.org
Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
2 years agonet/hns3: fix TM info dump
Min Hu (Connor) [Thu, 14 Apr 2022 13:00:55 +0000 (21:00 +0800)]
net/hns3: fix TM info dump

Shouldn't dump TM info when TM is not supported by the NIC.
This patch fixed it.

Fixes: e4cfe6bb9114 ("net/hns3: dump TM configuration info")
Cc: stable@dpdk.org
Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
2 years agonet/hns3: refactor queue info dump
Min Hu (Connor) [Thu, 14 Apr 2022 13:00:54 +0000 (21:00 +0800)]
net/hns3: refactor queue info dump

This patch refactors queue info dump.

Fixes: 6038c8a3f63c ("net/hns3: dump queue info")
Cc: stable@dpdk.org
Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
2 years agonet/hns3: refactor feature capability dump
Min Hu (Connor) [Thu, 14 Apr 2022 13:00:53 +0000 (21:00 +0800)]
net/hns3: refactor feature capability dump

This patch refactors feature capability dump.

Fixes: 14ea9f0a62c6 ("net/hns3: dump device feature capability")
Cc: stable@dpdk.org
Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
2 years agonet/hns3: refactor adapter state dump
Min Hu (Connor) [Thu, 14 Apr 2022 13:00:52 +0000 (21:00 +0800)]
net/hns3: refactor adapter state dump

This patch refactors adapter state dump.

Fixes: 1a03c659cb9d ("net/hns3: dump device basic info")
Cc: stable@dpdk.org
Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
2 years agonet/bonding: fix RSS key config with extended key length
Ke Zhang [Mon, 11 Apr 2022 05:40:03 +0000 (05:40 +0000)]
net/bonding: fix RSS key config with extended key length

When creating a bonding device, if the slave device's
RSS key length = standard_rss_key length + extended_hash_key length,
then bonding device will be same as slave,
in function bond_ethdev_configure(), the default_rss_key length is 40,
it is not matched, so it should calculate a new key for bonding device
if the default key could not be used.

Fixes: 6b1a001ec546 ("net/bonding: fix RSS key length")
Cc: stable@dpdk.org
Signed-off-by: Ke Zhang <ke1x.zhang@intel.com>
Acked-by: Min Hu (Connor) <humin29@huawei.com>
2 years agonet/nfp: remove unneeded header inclusion
David Marchand [Fri, 8 Apr 2022 09:41:16 +0000 (11:41 +0200)]
net/nfp: remove unneeded header inclusion

Looking at this driver history, there was never a need for including
execinfo.h.

Fixes: bdbf45c24b07 ("net/nfp: fix build with musl libc")
Cc: stable@dpdk.org
Signed-off-by: David Marchand <david.marchand@redhat.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund@corigine.com>
2 years agonet/netvsc: fix hot adding multiple VF PCI devices
Long Li [Thu, 24 Mar 2022 17:46:17 +0000 (10:46 -0700)]
net/netvsc: fix hot adding multiple VF PCI devices

This patch fixes two issues with hot removing/adding a VF PCI device:
1. The original device argument is lost when it's hot added
2. If there are multiple VFs hot adding at the same time, some of the
   VFs may not get added successfully because only one single VF status
   is stored in the netvsc.

Fix these by storing the original device arguments and maintain a list
of hot add contexts to deal with multiple VF devices.

Fixes: a2a23a794b ("net/netvsc: support VF device hot add/remove")
Cc: stable@dpdk.org
Signed-off-by: Long Li <longli@microsoft.com>
2 years agoci: build some job with ASan
David Marchand [Thu, 5 May 2022 09:29:52 +0000 (11:29 +0200)]
ci: build some job with ASan

Enable ASan, this can greatly help identify leaks and buffer overflows.
Running unit tests relying on multiprocess is unreliable with ASan
enabled, so skip them.

Signed-off-by: David Marchand <david.marchand@redhat.com>
Acked-by: Aaron Conole <aconole@redhat.com>
2 years agotest/mem: disable ASan when accessing unallocated memory
David Marchand [Thu, 5 May 2022 09:29:51 +0000 (11:29 +0200)]
test/mem: disable ASan when accessing unallocated memory

As described in bugzilla, ASan reports accesses to all memory segment as
invalid, since those parts have not been allocated with rte_malloc.
Move __rte_no_asan to rte_common.h and disable ASan on a part of the test.

Bugzilla ID: 880
Fixes: 6cc51b1293ce ("mem: instrument allocator for ASan")
Cc: stable@dpdk.org
Signed-off-by: David Marchand <david.marchand@redhat.com>
Acked-by: Anatoly Burakov <anatoly.burakov@intel.com>
2 years agotest/hash: report non HTM numbers for single thread
Stanislaw Kardach [Tue, 10 May 2022 11:57:34 +0000 (13:57 +0200)]
test/hash: report non HTM numbers for single thread

In hash_readwrite_perf_autotest a single read and write operation is
benchmarked for both HTM and non HTM cases. However the result summary
only shows the HTM value. Therefore add the non HTM value for
completeness.

Fixes: 0eb3726ebcf1 ("test/hash: add test for read/write concurrency")

Signed-off-by: Stanislaw Kardach <kda@semihalf.com>
Acked-by: Yipeng Wang <yipeng1.wang@intel.com>
2 years agomaintainers: update for Intel i40e
Beilei Xing [Tue, 12 Apr 2022 02:02:57 +0000 (10:02 +0800)]
maintainers: update for Intel i40e

Add Yuying as Intel i40e maintainer.

Signed-off-by: Beilei Xing <beilei.xing@intel.com>
Acked-by: Yuying Zhang <yuying.zhang@intel.com>
2 years agomaintainers: update for Intel igc
Haiyue Wang [Fri, 8 Apr 2022 05:58:17 +0000 (13:58 +0800)]
maintainers: update for Intel igc

Junfeng and Simei have been appointed the new maintainers for the igc
PMD. Update the MAINTAINERS file to reflect this.

Signed-off-by: Haiyue Wang <haiyue.wang@intel.com>
Acked-by: Simei Su <simei.su@intel.com>
Acked-by: Junfeng Guo <junfeng.guo@intel.com>
2 years agomaintainers: update for Intel ixgbe
Haiyue Wang [Fri, 8 Apr 2022 05:58:16 +0000 (13:58 +0800)]
maintainers: update for Intel ixgbe

Qiming and Wenjun have been appointed the new maintainers for the ixgbe
PMD. Update the MAINTAINERS file to reflect this.

Signed-off-by: Haiyue Wang <haiyue.wang@intel.com>
Acked-by: Qiming Yang <qiming.yang@intel.com>
Acked-by: Wenjun Wu <wenjun1.wu@intel.com>
2 years agomaintainers: update for Intel e1000
Haiyue Wang [Fri, 8 Apr 2022 05:58:15 +0000 (13:58 +0800)]
maintainers: update for Intel e1000

Simei and Wenjun have been appointed the new maintainers for the e1000
PMD. Update the MAINTAINERS file to reflect this.

Signed-off-by: Haiyue Wang <haiyue.wang@intel.com>
Acked-by: Simei Su <simei.su@intel.com>
Acked-by: Wenjun Wu <wenjun1.wu@intel.com>
2 years agomaintainers: update for vmxnet3 driver
Jochen Behrens [Fri, 6 May 2022 20:06:31 +0000 (20:06 +0000)]
maintainers: update for vmxnet3 driver

Make Jochen Behrens the maintainer of the net/vmxnet3 device
driver as Yong Wang is not working on vmxnet3 any more.

Signed-off-by: Jochen Behrens <jbehrens@vmware.com>
Acked-by: Yong Wang <yongwang@vmware.com>
2 years agomaintainers: update email address
Konstantin Ananyev [Thu, 21 Apr 2022 15:20:59 +0000 (16:20 +0100)]
maintainers: update email address

Use new email address.

Signed-off-by: Konstantin Ananyev <konstantin.v.ananyev@yandex.ru>
Acked-by: John McNamara <john.mcnamara@intel.com>
2 years agoexamples/l2fwd-crypto: fix stats refresh rate
Raja Zidane [Thu, 7 Apr 2022 11:42:49 +0000 (14:42 +0300)]
examples/l2fwd-crypto: fix stats refresh rate

TIMER_MILLISECOND is defined as the number of cpu cycles per millisecond,
current definition is correct for cores with frequency of 2GHZ, for cores
with different frequency, it caused different periods between refresh,
(i.e. the definition is about 14ms on ARM cores).
The devarg that stated the period between stats print was not used,
instead, it was always defaulted to 10 seconds (on 2GHZ core).

Use DPDK API to get CPU frequency, to define TIMER_MILLISECOND.
Use the refresh period devarg instead of defaulting to 10s always.

Fixes: 387259bd6c67 ("examples/l2fwd-crypto: add sample application")
Cc: stable@dpdk.org
Signed-off-by: Raja Zidane <rzidane@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
2 years agocompress/octeontx: support OCTEON TX2 SoC family
Mahipal Challa [Mon, 28 Feb 2022 03:40:35 +0000 (09:10 +0530)]
compress/octeontx: support OCTEON TX2 SoC family

The octeontx2 9xxx SoC family support is added.

Signed-off-by: Mahipal Challa <mchalla@marvell.com>
Acked-by: Ashish Gupta <ashishg@marvell.com>
2 years agotest/crypto-perf: add vector file for AES-GCM
Archana Muniganti [Fri, 8 Apr 2022 10:18:35 +0000 (15:48 +0530)]
test/crypto-perf: add vector file for AES-GCM

Added test vector file for AES-128-GCM for
64B and 512B length buffers.

Signed-off-by: Archana Muniganti <marchana@marvell.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
2 years agotest/crypto-perf: populate mbuf in latency test
Archana Muniganti [Fri, 8 Apr 2022 10:18:34 +0000 (15:48 +0530)]
test/crypto-perf: populate mbuf in latency test

For decrypt, ICV mismatch can come as data is dummy and
latency will be calculated for error path. Hence populate
mbuf with test vector data.

Signed-off-by: Archana Muniganti <marchana@marvell.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
2 years agocommon/dpaax: fix short MAC-I IV calculation for ZUC
Gagandeep Singh [Thu, 28 Apr 2022 11:47:33 +0000 (17:17 +0530)]
common/dpaax: fix short MAC-I IV calculation for ZUC

Fixing the IV calculation for ZUC based short MAC-I
as per the HW security engine guidelines.

Fixes: 73a24060cd70 ("crypto/dpaa2_sec: add sample PDCP descriptor APIs")
Cc: stable@dpdk.org
Signed-off-by: Gagandeep Singh <g.singh@nxp.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
2 years agocrypto/dpaa_sec: move cdb preparation to session create
Gagandeep Singh [Thu, 28 Apr 2022 11:47:32 +0000 (17:17 +0530)]
crypto/dpaa_sec: move cdb preparation to session create

Driver is preparing the shared descriptor of session while
attaching the session to a queue pair.
It should be prepared on session create.

Signed-off-by: Gagandeep Singh <g.singh@nxp.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
2 years agobus/dpaa: remove unused thread-specific variables
Gagandeep Singh [Thu, 28 Apr 2022 11:47:31 +0000 (17:17 +0530)]
bus/dpaa: remove unused thread-specific variables

There are some crypto driver related thread specific
variables which are no longer used, so removing them.

Signed-off-by: Gagandeep Singh <g.singh@nxp.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
2 years agocrypto/dpaa2_sec: fix operation status for simple FD
Gagandeep Singh [Thu, 28 Apr 2022 11:47:30 +0000 (17:17 +0530)]
crypto/dpaa2_sec: fix operation status for simple FD

Driver is not filling the operation status on dequeue
in case the FD is simple.

So setting the status as per the results.

Fixes: 0a23d4b6f4c2 ("crypto/dpaa2_sec: support protocol offload IPsec")
Cc: stable@dpdk.org
Signed-off-by: Gagandeep Singh <g.singh@nxp.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
2 years agocrypto/dpaa2_sec: fix crypto operation pointer
Gagandeep Singh [Thu, 28 Apr 2022 11:47:29 +0000 (17:17 +0530)]
crypto/dpaa2_sec: fix crypto operation pointer

Driver is filling the crypto_op variable with an invalid value
for atomic and ordered events which can results into
segmentation fault.

This patch assigning the correct crypto_op and event buffer
pointers by extracting from FD.

Fixes: a77db24643b7 ("crypto/dpaa2_sec: support atomic queues")
Fixes: 4562de326d30 ("crypto/dpaa2_sec: support ordered queue")
Cc: stable@dpdk.org
Signed-off-by: Gagandeep Singh <g.singh@nxp.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
2 years agocrypto/dpaa2_sec: create fle pool per queue pair
Gagandeep Singh [Thu, 28 Apr 2022 11:47:28 +0000 (17:17 +0530)]
crypto/dpaa2_sec: create fle pool per queue pair

Driver is creating a fle pool with a fixed number of
buffers for all queue pairs of a DPSECI object.
These fle buffers are equivalent to the number of descriptors.

In this patch, creating the fle pool for each queue pair
so that user can control the number of descriptors of a
queue pair using API rte_cryptodev_queue_pair_setup().

Signed-off-by: Gagandeep Singh <g.singh@nxp.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
2 years agocrypto/dpaa_sec: fix secondary process probing
Vanshika Shukla [Thu, 28 Apr 2022 11:47:27 +0000 (17:17 +0530)]
crypto/dpaa_sec: fix secondary process probing

DPAA hardware supports non-i/o performing secondary
applications only. So we do not have to probe crypto
devices in secondary applications.

Fixes: c3e85bdcc6e6 ("crypto/dpaa_sec: add crypto driver for NXP DPAA platform")
Cc: stable@dpdk.org
Signed-off-by: Vanshika Shukla <vanshika.shukla@nxp.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
2 years agocommon/dpaax: remove obsolete code
Gagandeep Singh [Thu, 28 Apr 2022 11:47:26 +0000 (17:17 +0530)]
common/dpaax: remove obsolete code

Remove sec era 1 to 7 IPsec and caam operations code
as none of the NXP platform use it.

Signed-off-by: Gagandeep Singh <g.singh@nxp.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
2 years agocrypto/dpaa_sec: replace use of old build macros
Gagandeep Singh [Thu, 28 Apr 2022 11:47:25 +0000 (17:17 +0530)]
crypto/dpaa_sec: replace use of old build macros

Use the newer security macros defined by meson.

Signed-off-by: Gagandeep Singh <g.singh@nxp.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
2 years agocrypto/dpaa_sec: enable QI physically
Gagandeep Singh [Thu, 28 Apr 2022 11:47:24 +0000 (17:17 +0530)]
crypto/dpaa_sec: enable QI physically

To perform crypto operations on DPAA platform,
QI interface of HW must be enabled.
Earlier DPAA crypto driver was dependent on
kernel for QI enable. Now with this patch
there is no such dependency on kernel.

Signed-off-by: Gagandeep Singh <g.singh@nxp.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
2 years agocrypto/dpaa2_sec: fix chained FD length in raw datapath
Gagandeep Singh [Thu, 28 Apr 2022 11:47:23 +0000 (17:17 +0530)]
crypto/dpaa2_sec: fix chained FD length in raw datapath

DPAA2 sec raw driver is calculating the wrong lengths while
creating the FD for chain.
This patch fixes lengths for chain FD.

Fixes: aa6ec1fd8443 ("crypto/dpaa2_sec: support authenc with raw buffer API")
Cc: stable@dpdk.org
Signed-off-by: Gagandeep Singh <g.singh@nxp.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
2 years agocrypto/dpaa_sec: fix chained FD length in raw datapath
Gagandeep Singh [Thu, 28 Apr 2022 11:47:22 +0000 (17:17 +0530)]
crypto/dpaa_sec: fix chained FD length in raw datapath

DPAA sec raw driver is calculating the wrong lengths while
creating the FD for chain.
This patch fixes lengths for chain FD.

Fixes: 78156d38e112 ("crypto/dpaa_sec: support authonly and chain with raw API")
Cc: stable@dpdk.org
Signed-off-by: Gagandeep Singh <g.singh@nxp.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
2 years agocrypto/dpaa2_sec: fix buffer pool ID check
Gagandeep Singh [Thu, 28 Apr 2022 11:47:21 +0000 (17:17 +0530)]
crypto/dpaa2_sec: fix buffer pool ID check

Simple fd rely on bpid of the buffers whereas
other FD types can support buffers without bpid
of pool.

So moving the bpid check to simple fd to mbuf
conversion function.

Fixes: 8d1f3a5d751b ("crypto/dpaa2_sec: support crypto operation")
Cc: stable@dpdk.org
Signed-off-by: Gagandeep Singh <g.singh@nxp.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>