dpdk.git
2 years agonet/ixgbe: fix queue resource leak
Qiming Chen [Tue, 31 Aug 2021 13:40:17 +0000 (21:40 +0800)]
net/ixgbe: fix queue resource leak

In the ixgbevf_dev_start function, after initializing the rxtx queue, if
an exception occurs in the subsequent function, the rxtx queue needs to
be released. The patch solves the problem of queue resource leakage.

Fixes: 0eb609239efd ("ixgbe: enable Rx queue interrupts for PF and VF")
Cc: stable@dpdk.org
Signed-off-by: Qiming Chen <chenqiming_huawei@163.com>
Acked-by: Haiyue Wang <haiyue.wang@intel.com>
2 years agonet/ixgbe: fix hash handle leak
Qiming Chen [Tue, 31 Aug 2021 13:24:07 +0000 (21:24 +0800)]
net/ixgbe: fix hash handle leak

In the ixgbe_fdir_filter_init and ixgbe_l2_tn_filter_init functions,
after the hash handle is created, the handle is not released in
subsequent abnormal branches.

Fixes: 080e3c0ee989 ("net/ixgbe: store flow director filter")
Fixes: d0c0c416ef1f ("net/ixgbe: store L2 tunnel filter")
Cc: stable@dpdk.org
Signed-off-by: Qiming Chen <chenqiming_huawei@163.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
2 years agonet/ice: support DCF device reset
Dapeng Yu [Wed, 1 Sep 2021 05:26:04 +0000 (13:26 +0800)]
net/ice: support DCF device reset

DCF PMD needs to support rte_eth_dev_reset, the reason is when a DCF
instance is killed, all the flow rules still exists in hardware, when
DCF gets to reconnect, it already lost the flow context, and if the
application wants to create new rules, it may fail due to firmware
reports rules already exist.

The rte_eth_dev_reset API provides a more elegant way for the
application to reset DCF when reconnect happens.

Signed-off-by: Dapeng Yu <dapengx.yu@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
2 years agonet/sfc: set FDIR bit for flow mark in EF100 Rx
Ivan Malov [Mon, 30 Aug 2021 14:35:42 +0000 (17:35 +0300)]
net/sfc: set FDIR bit for flow mark in EF100 Rx

According to flow action MARK definition, PMDs must set both
PKT_RX_FDIR and PKT_RX_FDIR_ID if the packet contains a mark.

Fixes: 1aacc3d388d3 ("net/sfc: support user mark and flag Rx for EF100")
Cc: stable@dpdk.org
Signed-off-by: Ivan Malov <ivan.malov@oktetlabs.ru>
Reviewed-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
2 years agonet/hns3: fix Tx push capability
Min Hu (Connor) [Mon, 30 Aug 2021 08:26:51 +0000 (16:26 +0800)]
net/hns3: fix Tx push capability

This patch fixes Tx push capability to be compatible with Kunpeng 920,
as Tx push is only supported on Kunpeng 930.

Fixes: 23e317dd1fbf ("net/hns3: support Tx push quick doorbell for performance")
Cc: stable@dpdk.org
Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
2 years agonet/hns3: fix taskqueue pair reset command
Chengchang Tang [Mon, 30 Aug 2021 08:26:50 +0000 (16:26 +0800)]
net/hns3: fix taskqueue pair reset command

This new taskqueue pair reset command is used incorrectly, resulting in
the new command not taking effect.

This patch fixes the incorrect use.

Fixes: 6911e7c22c61 ("net/hns3: fix long task queue pairs reset time")
Cc: stable@dpdk.org
Signed-off-by: Chengchang Tang <tangchengchang@huawei.com>
Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
2 years agonet/hns3: fix queue flow action validation
Chengchang Tang [Mon, 30 Aug 2021 08:26:49 +0000 (16:26 +0800)]
net/hns3: fix queue flow action validation

The used_rx_queues only takes effect after device is started, and
its value is incorrect before the device is started. Therefore, it
is not suitable for flow action to use it to verify the queue index
before the device is started.

E.g. Enable dedicated queue in bonding device will configure a queue
flow action before start its slave devices. The above problem will
make this reasonable flow action configuration fail.

This patch use the nb_rx_queues from the configuration phase to
achieve verification.

Fixes: a951c1ed3ab5 ("net/hns3: support different numbers of Rx and Tx queues")
Fixes: f8e7fcbfd0b8 ("net/hns3: support flow action of queue region")
Cc: stable@dpdk.org
Signed-off-by: Chengchang Tang <tangchengchang@huawei.com>
Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
2 years agonet/pcap: improve Rx statistics
Qiming Chen [Thu, 9 Sep 2021 12:28:55 +0000 (20:28 +0800)]
net/pcap: improve Rx statistics

In the receiving direction, if alloc mbuf or jumbo process failed, there
is no err_pkts count, which makes it difficult to locate the problem.
Because alloc mbuf failed, the rx_nombuf field is counted.

Signed-off-by: Qiming Chen <chenqiming_huawei@163.com>
Acked-by: Ferruh Yigit <ferruh.yigit@intel.com>
2 years agonet/pcap: fix resource leakage on port probe
Qiming Chen [Mon, 30 Aug 2021 03:01:08 +0000 (11:01 +0800)]
net/pcap: fix resource leakage on port probe

When the port is probed, if the eth_from_pcaps function fails, the
previously opened pcap resources are not released, causing resource
leakage.

The patch solves the problem of resource leakage caused by abnormal
branch exit during the port probe process.

Fixes: 4c173302c307 ("pcap: add new driver")
Cc: stable@dpdk.org
Signed-off-by: Qiming Chen <chenqiming_huawei@163.com>
Acked-by: Ferruh Yigit <ferruh.yigit@intel.com>
2 years agonet/axgbe: fix unreleased lock in I2C transfer
Chengfeng Ye [Thu, 26 Aug 2021 18:55:59 +0000 (11:55 -0700)]
net/axgbe: fix unreleased lock in I2C transfer

The lock pdata->i2c_mutex is not released if the function return in
these two patched branches, which may lead to deadlock problem if
this lock is acquired again.

Bugzilla ID: 777
Fixes: 4ac7516b8b39 ("net/axgbe: add phy init and related APIs")
Cc: stable@dpdk.org
Signed-off-by: Chengfeng Ye <cyeaa@connect.ust.hk>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2 years agodoc: fix bonding driver name
Ben Magistro [Thu, 26 Aug 2021 23:10:44 +0000 (23:10 +0000)]
doc: fix bonding driver name

The documentation for the bond driver lists the name as `net/bond`
however the driver should be `net/bonding`.

Fixes: 89c67ae2cba7 ("doc: remove references to make from prog guide")
Cc: stable@dpdk.org
Signed-off-by: Ben Magistro <koncept1@gmail.com>
Acked-by: Min Hu (Connor) <humin29@huawei.com>
2 years agonet: add macro to extract MAC address bytes
Aman Deep Singh [Wed, 25 Aug 2021 17:27:34 +0000 (22:57 +0530)]
net: add macro to extract MAC address bytes

Added macros to simplify print of MAC address.
The six bytes of a MAC address are extracted in
a macro here, to improve code readablity.

Signed-off-by: Aman Deep Singh <aman.deep.singh@intel.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2 years agonet: add macro for MAC address print
Aman Deep Singh [Wed, 25 Aug 2021 17:27:33 +0000 (22:57 +0530)]
net: add macro for MAC address print

Added macro to print six bytes of MAC address.
The MAC addresses will be printed in upper case
hexadecimal format.
In case there is a specific check for lower case
MAC address, the user may need to make a change in
such test case after this patch.

Signed-off-by: Aman Deep Singh <aman.deep.singh@intel.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2 years agonet/af_xdp: fix zero-copy Tx queue drain
Baruch Siach [Wed, 25 Aug 2021 10:05:44 +0000 (13:05 +0300)]
net/af_xdp: fix zero-copy Tx queue drain

Call xsk_ring_prod__submit() before kick_tx() so that the kernel
consumer sees the updated state of Tx ring. Otherwise, Tx packets are
stuck in the ring until the next call to af_xdp_tx_zc().

Fixes: d8a210774e1d ("net/af_xdp: support unaligned umem chunks")
Cc: stable@dpdk.org
Signed-off-by: Baruch Siach <baruch@tkos.co.il>
Acked-by: Ciara Loftus <ciara.loftus@intel.com>
2 years agoapp/testpmd: support multi-process
Min Hu (Connor) [Wed, 25 Aug 2021 02:06:38 +0000 (10:06 +0800)]
app/testpmd: support multi-process

This patch adds multi-process support for testpmd.
For example the following commands run two testpmd
processes:

 * the primary process:

./dpdk-testpmd --proc-type=auto -l 0-1 -- -i \
   --rxq=4 --txq=4 --num-procs=2 --proc-id=0

 * the secondary process:

./dpdk-testpmd --proc-type=auto -l 2-3 -- -i \
   --rxq=4 --txq=4 --num-procs=2 --proc-id=1

Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
Signed-off-by: Lijun Ou <oulijun@huawei.com>
Signed-off-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
Acked-by: Xiaoyun Li <xiaoyun.li@intel.com>
Acked-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Aman Deep Singh <aman.deep.singh@intel.com>
2 years agonet/bnxt: fix double allocation of ring groups
Kalesh AP [Wed, 1 Sep 2021 04:00:01 +0000 (09:30 +0530)]
net/bnxt: fix double allocation of ring groups

After commit "d68249f88266", driver allocates ring groups in
bnxt_alloc_hwrm_rx_ring(). But during port start, driver invokes
bnxt_alloc_hwrm_rx_ring() followed by bnxt_alloc_all_hwrm_ring_grps().
This will cause the FW command failure in bnxt_alloc_all_hwrm_ring_grps()

To fix this, just don't create the ring group if it is already created.

Fixes: 9b63c6fd70e3 ("net/bnxt: support Rx/Tx queue start/stop")
Cc: stable@dpdk.org
Signed-off-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Reviewed-by: Lance Richardson <lance.richardson@broadcom.com>
2 years agonet/bnxt: fix ring group free
Kalesh AP [Mon, 30 Aug 2021 03:58:11 +0000 (09:28 +0530)]
net/bnxt: fix ring group free

Added an invalid fw_grp_id check inside bnxt_hwrm_ring_grp_free().
This will prevent invalid fw_grp_id to be passed to the FW which can
result in an error.
This fixes the following failure in the "port stop" -> "port start"
sequence:

bnxt_hwrm_ring_grp_free(): error 2:0:00000000:0204
bnxt_hwrm_ring_grp_free(): error 2:0:00000000:0204

Fixes: 9b63c6fd70e3 ("net/bnxt: support Rx/Tx queue start/stop")
Cc: stable@dpdk.org
Signed-off-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Reviewed-by: Lance Richardson <lance.richardson@broadcom.com>
Reviewed-by: Somnath Kotur <somnath.kotur@broadcom.com>
2 years agonet/bnxt: fix VLAN indication in Rx mbuf
Kalesh AP [Mon, 23 Aug 2021 08:12:14 +0000 (13:42 +0530)]
net/bnxt: fix VLAN indication in Rx mbuf

Fix to ignore the RX_PKT_CMPL_FLAGS2_META_FORMAT_VLAN
when the firmware doesn't support the VLAN strip offload.

Fixes: 2eb53b134aae ("net/bnxt: add initial Rx code")
Cc: stable@dpdk.org
Signed-off-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Reviewed-by: Somnath Kotur <somnath.kotur@broadcom.com>
Reviewed-by: Lance Richardson <lance.richardson@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
2 years agonet/bnxt: check FW capability for VLAN offloads
Kalesh AP [Mon, 23 Aug 2021 08:12:13 +0000 (13:42 +0530)]
net/bnxt: check FW capability for VLAN offloads

VLAN offload capability may be disabled in the FW. The driver
should not attempt to override or utilize this feature in such
scenarios since it will not work as expected.

Fixes: 0a6d2a720078 ("net/bnxt: get device infos")
Cc: stable@dpdk.org
Signed-off-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Reviewed-by: Somnath Kotur <somnath.kotur@broadcom.com>
Reviewed-by: Lance Richardson <lance.richardson@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
2 years agonet/bnxt: fix mbuf VLAN in scalar Rx
Kalesh AP [Mon, 23 Aug 2021 08:12:12 +0000 (13:42 +0530)]
net/bnxt: fix mbuf VLAN in scalar Rx

In the scalar Rx path, for the VLAN packet, TCI is not saved in
the "mbuf->vlan_tci", however the STRIPPED offload flag is set
along with PKT_RX_VLAN flag.

Fixes: c1b33d40315f ("net/bnxt: use table based mbuf flags handling")
Cc: stable@dpdk.org
Signed-off-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Reviewed-by: Somnath Kotur <somnath.kotur@broadcom.com>
Reviewed-by: Lance Richardson <lance.richardson@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
2 years agonet/ixgbe: fix Rx multicast statistics after reset
Qiming Chen [Mon, 30 Aug 2021 03:31:57 +0000 (11:31 +0800)]
net/ixgbe: fix Rx multicast statistics after reset

In the implementation of the VF driver ixgbevf_update_stats to obtain
statistics, the multicast count hw_stats->vfmprc has been obtained,
but it is not cleared in the corresponding ixgbevf_dev_stats_reset
interface.

Fixes: abf7275bbaa2 ("ixgbe: move to drivers/net/")
Cc: stable@dpdk.org
Signed-off-by: Qiming Chen <chenqiming_huawei@163.com>
Acked-by: Haiyue Wang <haiyue.wang@intel.com>
2 years agonet/iavf: fix overflow in maximum packet length config
Tudor Cornea [Thu, 5 Aug 2021 11:35:23 +0000 (14:35 +0300)]
net/iavf: fix overflow in maximum packet length config

The len variable, used in the computation of max_pkt_len could
overflow, if used to store the result of the following computation:

rxq->rx_buf_len * IAVF_MAX_CHAINED_RX_BUFFERS

Since, we could define the mbuf size to have a large value (i.e 13312),
and IAVF_MAX_CHAINED_RX_BUFFERS is defined as 5, the computation
mentioned above could potentially result in a value which might be
bigger than MAX_USHORT.

The result will be that Jumbo Frames will not work properly

Fixes: 69dd4c3d0898 ("net/avf: enable queue and device")
Cc: stable@dpdk.org
Signed-off-by: Tudor Cornea <tudor.cornea@gmail.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
2 years agonet/ice: fix queue config in DCF
Jie Wang [Tue, 24 Aug 2021 15:13:17 +0000 (15:13 +0000)]
net/ice: fix queue config in DCF

When DCF configures rx_queues, it may cause the pointer of
rx_queues to go out of bounds.

This patch expands the scope of the judgment condition to
fix this issue.

Fixes: 4b0d391f0eab ("net/ice: add queue config in DCF")
Cc: stable@dpdk.org
Signed-off-by: Jie Wang <jie1x.wang@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
2 years agonet/ice: fix deadlock on flow query
Yu Wenjun [Thu, 19 Aug 2021 12:10:02 +0000 (20:10 +0800)]
net/ice: fix deadlock on flow query

Default case of the switch statement causes deadlock because it returns
without unlocking the 'flow_ops_lock' lock. Fixing it.

Fixes: 0d6ef740e411 ("net/ice: support flow ops thread safe")
Cc: stable@dpdk.org
Signed-off-by: Yu Wenjun <yuwenjun0x@163.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
2 years agonet/ice: fix default RSS hash for IP fragments
Wenjun Wu [Tue, 17 Aug 2021 08:45:02 +0000 (16:45 +0800)]
net/ice: fix default RSS hash for IP fragments

Previously, hash value is calculated by src IP address, dst IP address
and IP ID. However, default RSS field only needs src and dst IP address.

This patch removes IP ID from default RSS field for IP fragment packets
to improve default RSS configuration.

Fixes: 4027fffe86f4 ("net/ice: support default RSS for IP fragment packet")
Cc: stable@dpdk.org
Signed-off-by: Wenjun Wu <wenjun1.wu@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
2 years agonet/iavf: fix default RSS hash for IP fragments
Wenjun Wu [Tue, 17 Aug 2021 08:44:01 +0000 (16:44 +0800)]
net/iavf: fix default RSS hash for IP fragments

Previously, hash value is calculated by src IP address, dst IP address
and IP ID. However, default RSS field only needs src and dst IP address.

This patch removes IP ID from default RSS field for IP fragment packets
to improve default RSS configuration.

Fixes: 9e29a278bc0c ("net/iavf: support default RSS for IP fragment")
Cc: stable@dpdk.org
Signed-off-by: Wenjun Wu <wenjun1.wu@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
2 years agonet/iavf: support flow director for IPv6 fragments
Wenjun Wu [Tue, 17 Aug 2021 06:50:14 +0000 (14:50 +0800)]
net/iavf: support flow director for IPv6 fragments

This patch adds L3 fields FDIR support for IPv6 fragment packets.

Signed-off-by: Wenjun Wu <wenjun1.wu@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
2 years agonet/iavf: fix flow director L3 field for IPv4 fragments
Wenjun Wu [Tue, 17 Aug 2021 06:49:55 +0000 (14:49 +0800)]
net/iavf: fix flow director L3 field for IPv4 fragments

Originally, the value of field_selector for IPV4_FRAG header hdr1 is
the same as the previous header hdr2. For IPv4 packets, field_selector
for hdr2 can be any value between 0 and 4, depending on the selected
field. Actually, this value for IPV4_FRAG should be constant 0,
which denotes the field packet ID.

This patch adds an assignment to hdr1->field_selector to make sure that
it is always 0.

Fixes: 3334513ef484 ("net/iavf: support flow director for IP fragment")
Cc: stable@dpdk.org
Signed-off-by: Wenjun Wu <wenjun1.wu@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
2 years agonet/ice: fix RXDID default value in DCF
Qi Zhang [Tue, 17 Aug 2021 03:41:23 +0000 (11:41 +0800)]
net/ice: fix RXDID default value in DCF

Since DPDK 20.11 the default rxdid is changed from 16 to 22, but the
DCF data path didn't change, the patch fix the gap.

Fixes: 12443386a0b0 ("net/ice: support flex Rx descriptor RxDID22")
Cc: stable@dpdk.org
Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Tested-by: Zhimin Huang <zhiminx.huang@intel.com>
2 years agonet/ice: fix memzone leak after device init failure
Haiyue Wang [Fri, 13 Aug 2021 06:21:54 +0000 (14:21 +0800)]
net/ice: fix memzone leak after device init failure

When flow engine initialization or FXP resource reset failed, it needs
to free the memory zone and unregister the interrupt callback.

Bugzilla ID: 752
Fixes: 84dc7a95a2d3 ("net/ice: enable flow director engine")
Fixes: 7615a6895009 ("net/ice: rework for generic flow enabling")
Fixes: 7edc7158d771 ("net/ice: cleanup RSS/FDIR profile on device init")
Cc: stable@dpdk.org
Reported-by: David Marchand <david.marchand@redhat.com>
Signed-off-by: Haiyue Wang <haiyue.wang@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
2 years agonet/ice/base: support flow director for IPv6 fragments
Wenjun Wu [Tue, 3 Aug 2021 07:23:54 +0000 (15:23 +0800)]
net/ice/base: support flow director for IPv6 fragments

Add L2 and L3 FDIR field support for IPv6 fragment packets.

Signed-off-by: Wenjun Wu <wenjun1.wu@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
2 years agomaintainers: update for mlx4/mlx5 net drivers
Viacheslav Ovsiienko [Mon, 23 Aug 2021 14:50:41 +0000 (17:50 +0300)]
maintainers: update for mlx4/mlx5 net drivers

For net/mlx4:
    - removing Shahaf Shuler
    - adding Viacheslav Ovsiienko

For net/mlx5:
    - removing Shahaf Shuler

Signed-off-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
2 years agonet/nfp: fix minimum descriptor sizes
Heinrich Kuhn [Mon, 23 Aug 2021 07:59:21 +0000 (09:59 +0200)]
net/nfp: fix minimum descriptor sizes

The NFP4000/6000 supports a minimum of 256 Tx/Rx descriptors and not 64.
Before this patch when a DPDK application configured < 256 Tx
descriptors the hardware read/write pointers would be unmasked and not
wrapped at the expected size of the ring. The PMD logic to determine the
amount of free space in the Tx ring is incompatible with the unmasked
hwqueue pointers and this will result in the PMD not updating the
read pointer at all.The knock-on effect is that under high load the
PMD will potentially re-use a Tx descriptor before the hw has had a
chance to process that particular descriptor. This issue can manifest as
a DMA error when the hardware tries to perform a DMA with info from a
partially populated descriptor.

Fixes: defb9a5dd156 ("nfp: introduce driver initialization")
Cc: stable@dpdk.org
Signed-off-by: Heinrich Kuhn <heinrich.kuhn@corigine.com>
Signed-off-by: Simon Horman <simon.horman@corigine.com>
2 years agomaintainers: update for NFP
Heinrich Kuhn [Mon, 23 Aug 2021 08:29:19 +0000 (10:29 +0200)]
maintainers: update for NFP

Some of Netronome's activities and people have moved over to Corigine,
including NFP PMD maintenance and myself.

Signed-off-by: Heinrich Kuhn <heinrich.kuhn@corigine.com>
2 years agoapp/testpmd: add option for number of flows in flowgen
Zhihong Wang [Thu, 19 Aug 2021 12:35:41 +0000 (20:35 +0800)]
app/testpmd: add option for number of flows in flowgen

Make number of flows in flowgen configurable by setting parameter
--flowgen-flows=N.

Signed-off-by: Zhihong Wang <wangzhihong.wzh@bytedance.com>
Acked-by: Xiaoyun Li <xiaoyun.li@intel.com>
2 years agonet/ipn3ke: change experimental symbol to internal
Rosen Xu [Thu, 19 Aug 2021 06:05:05 +0000 (14:05 +0800)]
net/ipn3ke: change experimental symbol to internal

'ipn3ke_bridge_func' is a global variable and it used in net & raw
drivers.
It's only used for drivers, so change it from EXPERIMENTAL to INTERNAL.

Signed-off-by: Rosen Xu <rosen.xu@intel.com>
Acked-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Ray Kinsella <mdr@ashroe.eu>
2 years agocrypto/dpaa_sec: support PDCP short MAC-I
Gagandeep Singh [Wed, 8 Sep 2021 12:51:27 +0000 (18:21 +0530)]
crypto/dpaa_sec: support PDCP short MAC-I

This patch add PDCP security short MAC-I support for
dpaa_sec driver.

Signed-off-by: Gagandeep Singh <g.singh@nxp.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
2 years agocrypto/dpaa2_sec: support PDCP short MAC-I
Gagandeep Singh [Wed, 8 Sep 2021 12:51:26 +0000 (18:21 +0530)]
crypto/dpaa2_sec: support PDCP short MAC-I

This patch add PDCP short mac support in dpaa2_sec driver.

Signed-off-by: Gagandeep Singh <g.singh@nxp.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
2 years agotest/crypto: support PDCP short MAC-I
Gagandeep Singh [Wed, 8 Sep 2021 12:51:25 +0000 (18:21 +0530)]
test/crypto: support PDCP short MAC-I

This patch add support to test the PDCP short MAC
packets in crypto.

Signed-off-by: Gagandeep Singh <g.singh@nxp.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
2 years agosecurity: support PDCP short MAC-I
Hemant Agrawal [Wed, 8 Sep 2021 12:51:24 +0000 (18:21 +0530)]
security: support PDCP short MAC-I

This patch add support to handle PDCP short MAC-I domain
along with standard control and data domains as it has to
be treaty as special case with PDCP protocol offload support.

ShortMAC-I is the 16 least significant bits of calculated MAC-I. Usually
when a RRC message is exchanged between UE and eNodeB it is integrity &
ciphered protected.

MAC-I = f(key, varShortMAC-I, count, bearer, direction).
Here varShortMAC-I is prepared by using (current cellId, pci of source cell
and C-RNTI of old cell). Other parameters like count, bearer and
direction set to all 1.

crypto-perf app is updated to take short MAC as input mode.

Signed-off-by: Gagandeep Singh <g.singh@nxp.com>
Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
2 years agocrypto/dpaa2_sec: support integrity only PDCP
Hemant Agrawal [Wed, 8 Sep 2021 12:51:23 +0000 (18:21 +0530)]
crypto/dpaa2_sec: support integrity only PDCP

To support short MAC-I, integrity only case is required
to be supported for PDCP.

Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
Signed-off-by: Gagandeep Singh <g.singh@nxp.com>
2 years agocommon/cnxk: fix attaching NPA LF to CPT VF
Srujana Challa [Wed, 18 Aug 2021 11:56:35 +0000 (17:26 +0530)]
common/cnxk: fix attaching NPA LF to CPT VF

ATTACH_RESOURCES mailbox for CPT LFs is being called without
setting modify bit. Because of this previously attached NPA LF
to the CPT VF is getting removed, when only CPT VF is whitelisted.
This patch fixes the same.

Fixes: c045d2e5cbbc ("common/cnxk: add CPT configuration")
Cc: stable@dpdk.org
Signed-off-by: Srujana Challa <schalla@marvell.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
2 years agocrypto/dpaa2_sec: add error packet counters
Hemant Agrawal [Wed, 8 Sep 2021 06:59:53 +0000 (12:29 +0530)]
crypto/dpaa2_sec: add error packet counters

This patch add support to also counter err pkt counter per queue.
This also enhances few related debug prints.

Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
2 years agocrypto/dpaa_sec: force inline keys to save space
Franck Lenormand [Wed, 8 Sep 2021 06:59:52 +0000 (12:29 +0530)]
crypto/dpaa_sec: force inline keys to save space

This patch improve storage and performance by force inline
of the keys.

Signed-off-by: Franck Lenormand <franck.lenormand@nxp.com>
Signed-off-by: Gagandeep Singh <g.singh@nxp.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
2 years agocommon/dpaax/caamflib: fix IV for short MAC-I in SNOW3G
Gagandeep Singh [Wed, 8 Sep 2021 06:59:51 +0000 (12:29 +0530)]
common/dpaax/caamflib: fix IV for short MAC-I in SNOW3G

The logic was incorrectly doing conditional swap. It need to
be bit swap always.

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 agocommon/dpaax/caamflib: remove some inline keys
Franck Lenormand [Wed, 8 Sep 2021 06:59:50 +0000 (12:29 +0530)]
common/dpaax/caamflib: remove some inline keys

The space in descriptor buffer is scarce as it is limited to
64 words for platforms except ERA10 (which has 128).

As the descriptors are processed with QI, it adds some words
to the descriptor which is passed.

Some descriptors used for SDAP were using too much words reaching
the limit.

This patch reduces the number of words used by removing the inlining
of some keys (done for performance) in order to have working
descriptors.

Signed-off-by: Franck Lenormand <franck.lenormand@nxp.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
2 years agocommon/dpaax/caamflib: remove DPOVRD clear for SDAP
Franck Lenormand [Wed, 8 Sep 2021 06:59:49 +0000 (12:29 +0530)]
common/dpaax/caamflib: remove DPOVRD clear for SDAP

For SDAP, we are not using the protocol operation to perform
4G/LTE operation so the DPOVRD option is not used.

Removing it save some space in the descriptor buffer and
execution time.

Signed-off-by: Franck Lenormand <franck.lenormand@nxp.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
2 years agocommon/dpaax/caamflib: load correct HFN from desc buffer
Franck Lenormand [Wed, 8 Sep 2021 06:59:48 +0000 (12:29 +0530)]
common/dpaax/caamflib: load correct HFN from desc buffer

The offset of the HFN word and Bearer/Dir word is different
depending on type of PDB.

The wrong value was used.

This patch address this issue

Signed-off-by: Franck Lenormand <franck.lenormand@nxp.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
2 years agocrypto/dpaa_sec: support AES-CMAC integrity check
Gagandeep Singh [Wed, 8 Sep 2021 06:59:47 +0000 (12:29 +0530)]
crypto/dpaa_sec: support AES-CMAC integrity check

This patch adds support for AES_CMAC integrity
in non-security mode.

Signed-off-by: Gagandeep Singh <g.singh@nxp.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
2 years agocrypto/dpaa_sec: support AES-XCBC-MAC
Gagandeep Singh [Wed, 8 Sep 2021 06:59:46 +0000 (12:29 +0530)]
crypto/dpaa_sec: support AES-XCBC-MAC

This patch adds support for AES-XCBC-MAC algo.

Signed-off-by: Gagandeep Singh <g.singh@nxp.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
2 years agocrypto/dpaa_sec: support non-HMAC auth algos
Gagandeep Singh [Wed, 8 Sep 2021 06:59:45 +0000 (12:29 +0530)]
crypto/dpaa_sec: support non-HMAC auth algos

This patch add support for non-HMAC, md5, shax algos.

Signed-off-by: Gagandeep Singh <g.singh@nxp.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
2 years agocrypto/dpaa_sec: support DES-CBC
Gagandeep Singh [Wed, 8 Sep 2021 06:59:44 +0000 (12:29 +0530)]
crypto/dpaa_sec: support DES-CBC

add DES-CBC support and enable available cipher-only
test cases.

Signed-off-by: Gagandeep Singh <g.singh@nxp.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
2 years agocryptodev: expose driver interface as internal
Akhil Goyal [Tue, 10 Aug 2021 19:50:20 +0000 (01:20 +0530)]
cryptodev: expose driver interface as internal

The rte_cryptodev_pmd.* files are for drivers only and should be
private to DPDK, and not installed for app use.

Signed-off-by: Akhil Goyal <gakhil@marvell.com>
Acked-by: Matan Azrad <matan@nvidia.com>
Acked-by: Fan Zhang <roy.fan.zhang@intel.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
2 years agoexamples/fips_validation: remove illegal usage of API
Akhil Goyal [Tue, 10 Aug 2021 19:50:19 +0000 (01:20 +0530)]
examples/fips_validation: remove illegal usage of API

Some of the cryptodev APIs are not allowed to be used
by application directly. Hence removing the usage of
1. queue_pair_release: it is not required, as configure
   of queue pair release the previous queue pairs and the
   dev is not directly exposed to application, hence cannot
   use its ops from app.
2. rte_cryptodev_stop: it can be used directly without
   checking if the device is started or not.
3. rte_cryptodev_pmd_destroy: application should use
   rte_cryptodev_close instead.

Signed-off-by: Akhil Goyal <gakhil@marvell.com>
Acked-by: Matan Azrad <matan@nvidia.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
2 years agocryptodev: rename function to check device validity
Akhil Goyal [Tue, 10 Aug 2021 19:50:18 +0000 (01:20 +0530)]
cryptodev: rename function to check device validity

The API rte_cryptodev_pmd_is_valid_dev, can be used
by the application as well as PMD to check whether
the device is valid or not. Hence, _pmd is removed
from the API.
The applications and drivers which use this API are
also updated.

Signed-off-by: Akhil Goyal <gakhil@marvell.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
2 years agotest/crypto: remove illegal PMD header include
Akhil Goyal [Tue, 10 Aug 2021 19:50:17 +0000 (01:20 +0530)]
test/crypto: remove illegal PMD header include

rte_cryptodev_pmd.h is an interface between
driver and library and it is mentioned in the
file that application cannot use it directly.
Hence, removing the include.

Signed-off-by: Akhil Goyal <gakhil@marvell.com>
Acked-by: Matan Azrad <matan@nvidia.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
2 years agocrypto/cnxk: add feature flag for cn9k lookaside IPsec
Archana Muniganti [Tue, 7 Sep 2021 14:21:03 +0000 (19:51 +0530)]
crypto/cnxk: add feature flag for cn9k lookaside IPsec

Update device feature flag to support lookaside IPsec for
cn9k.

Signed-off-by: Ankur Dwivedi <adwivedi@marvell.com>
Signed-off-by: Archana Muniganti <marchana@marvell.com>
Signed-off-by: Tejasree Kondoj <ktejasree@marvell.com>
Signed-off-by: Vamsi Attunuru <vattunuru@marvell.com>
Acked-by: Anoob Joseph <anoobj@marvell.com>
2 years agocrypto/cnxk: update tailroom requirement
Archana Muniganti [Tue, 7 Sep 2021 14:21:02 +0000 (19:51 +0530)]
crypto/cnxk: update tailroom requirement

Update min tailroom to reflect IPsec additions.
PMD crypto_cn9k & crypto_cn10k would have packet
grow into tailroom post IPsec processing.

Signed-off-by: Archana Muniganti <marchana@marvell.com>
Acked-by: Anoob Joseph <anoobj@marvell.com>
2 years agocrypto/cnxk: add cn9k lookaside IPsec datapath
Archana Muniganti [Tue, 7 Sep 2021 14:21:01 +0000 (19:51 +0530)]
crypto/cnxk: add cn9k lookaside IPsec datapath

Adds support for cn9k lookaside enqueue and dequeue
operations.

Signed-off-by: Archana Muniganti <marchana@marvell.com>
Signed-off-by: Tejasree Kondoj <ktejasree@marvell.com>
Signed-off-by: Vamsi Attunuru <vattunuru@marvell.com>
Acked-by: Anoob Joseph <anoobj@marvell.com>
2 years agocrypto/cnxk: add cn9k security session operations
Archana Muniganti [Tue, 7 Sep 2021 14:21:00 +0000 (19:51 +0530)]
crypto/cnxk: add cn9k security session operations

Add security session ops.

Signed-off-by: Ankur Dwivedi <adwivedi@marvell.com>
Signed-off-by: Archana Muniganti <marchana@marvell.com>
Signed-off-by: Tejasree Kondoj <ktejasree@marvell.com>
Signed-off-by: Vamsi Attunuru <vattunuru@marvell.com>
Acked-by: Anoob Joseph <anoobj@marvell.com>
2 years agocommon/cnxk: add cn9k IPsec microcode defines
Archana Muniganti [Tue, 7 Sep 2021 14:20:59 +0000 (19:50 +0530)]
common/cnxk: add cn9k IPsec microcode defines

Microcode IE opcodes support IPsec operations. Add defines
and structs defined by microcode.

Signed-off-by: Ankur Dwivedi <adwivedi@marvell.com>
Signed-off-by: Archana Muniganti <marchana@marvell.com>
Signed-off-by: Tejasree Kondoj <ktejasree@marvell.com>
Signed-off-by: Vamsi Attunuru <vattunuru@marvell.com>
Acked-by: Anoob Joseph <anoobj@marvell.com>
2 years agocrypto/cnxk: add cn9k security context
Archana Muniganti [Tue, 7 Sep 2021 14:20:58 +0000 (19:50 +0530)]
crypto/cnxk: add cn9k security context

Add security ctx in cn9k crypto PMD.

Signed-off-by: Archana Muniganti <marchana@marvell.com>
Signed-off-by: Vamsi Attunuru <vattunuru@marvell.com>
Signed-off-by: Tejasree Kondoj <ktejasree@marvell.com>
Acked-by: Anoob Joseph <anoobj@marvell.com>
2 years agocrypto/openssl: fix CCM processing 0 length source
Ciara Power [Mon, 23 Aug 2021 12:47:14 +0000 (12:47 +0000)]
crypto/openssl: fix CCM processing 0 length source

When given a source length 0 for CCM, the encryption and decryption
functions did not call the EVP_ENCRYPTUPDATE/EVP_DECRYPTUPDATE functions
with a src and dst, causing some FIPS validation failures for testcases
with PLen=0:

process_openssl_auth_encryption_ccm() line 1131:
Process openssl auth encryption ccm failed

Fixes: 1a4998dc4d94 ("crypto/openssl: support AES-CCM")
Cc: stable@dpdk.org
Signed-off-by: Ciara Power <ciara.power@intel.com>
Acked-by: Fan Zhang <roy.fan.zhang@intel.com>
2 years agotest/crypto: refactor scheduler workers init
Rebecca Troy [Thu, 2 Sep 2021 11:54:16 +0000 (11:54 +0000)]
test/crypto: refactor scheduler workers init

Previously, the scheduler unit test only created and attached 1 or 2
AESNI-MB cryptodev PMDs as workers if less than 2 AESNI-MB PMDs had
already been initialized.

This commit changes this to always create and attach 2 new AESNI-MB
cryptodev PMDs, regardless of previously initialized AESNI-MB PMDs.

Signed-off-by: Rebecca Troy <rebecca.troy@intel.com>
Acked-by: Fan Zhang <roy.fan.zhang@intel.com>
2 years agoconfig/ppc: ignore GCC 11 psabi warnings
David Christensen [Thu, 2 Sep 2021 23:53:26 +0000 (16:53 -0700)]
config/ppc: ignore GCC 11 psabi warnings

Suppress the gcc warning "note: the layout of aggregates containing
vectors with 4-byte alignment has changed in GCC 5" on POWER systems
by setting "-Wno-psabi".  Warning was originally added to gcc in
commit https://gcc.gnu.org/git/gitweb.cgi?p=gcc.git;h=9832651 to warn
of the vector alignment changes introduced in GCC 5.  Older gcc
versions forced vector alignment to 16 bytes due to requirements for
POWER 6 and earlier CPUs, but these restrictions don't apply to CPUs
supported by DPDK.

Bugzilla ID: 739
Cc: stable@dpdk.org
Signed-off-by: David Christensen <drc@linux.vnet.ibm.com>
2 years agoeal/ppc: ignore GCC 10 stringop-overflow warnings
David Christensen [Thu, 2 Sep 2021 22:15:14 +0000 (15:15 -0700)]
eal/ppc: ignore GCC 10 stringop-overflow warnings

Suppress gcc warning "warning: writing 16 bytes into a region of
size 0" for users of the POWER rte_memcpy() function.  Existing
rte_memcpy() code takes different code paths based on the actual
size of the move so the warning is already addressed. See also
commit b5b3ea803e47 ("eal/x86: ignore gcc 10 stringop-overflow warnings")

Cc: stable@dpdk.org
Signed-off-by: David Christensen <drc@linux.vnet.ibm.com>
2 years agocrypto/cnxk: add dual submission in cn9k
Anoob Joseph [Thu, 2 Sep 2021 12:22:34 +0000 (17:52 +0530)]
crypto/cnxk: add dual submission in cn9k

Submit two instructions with one LMTST operation.
Also updated dequeue path to have local var for constants.

Signed-off-by: Anoob Joseph <anoobj@marvell.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
2 years agocrypto/cnxk: support ucode API change
Vidya Sagar Velumuri [Thu, 2 Sep 2021 12:22:33 +0000 (17:52 +0530)]
crypto/cnxk: support ucode API change

Add support for API changes in ucode 1.13

Signed-off-by: Vidya Sagar Velumuri <vvelumuri@marvell.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
2 years agocrypto/cnxk: remove redundant assignment
Anoob Joseph [Thu, 2 Sep 2021 12:22:32 +0000 (17:52 +0530)]
crypto/cnxk: remove redundant assignment

The assignment to -1 is not required. Remove the same.

Signed-off-by: Anoob Joseph <anoobj@marvell.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
2 years agocrypto/cnxk: remove redundant memcpy of IV for ZUC
Anoob Joseph [Thu, 2 Sep 2021 12:22:31 +0000 (17:52 +0530)]
crypto/cnxk: remove redundant memcpy of IV for ZUC

Swap is not required for ZUC. Update IV updation
sequence to remove the redundant swap in case of ZUC.

Signed-off-by: Anoob Joseph <anoobj@marvell.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
2 years agocrypto/cnxk: remove redundant SNOW3G decrypt
Anoob Joseph [Thu, 2 Sep 2021 12:22:30 +0000 (17:52 +0530)]
crypto/cnxk: remove redundant SNOW3G decrypt

The opcode for encryption & decryption is the
same and single routine would be able to handle
both encryption and decryption operations.

Signed-off-by: Anoob Joseph <anoobj@marvell.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
2 years agocommon/cnxk: update to v1.16 ucc codes
Anoob Joseph [Thu, 2 Sep 2021 12:22:29 +0000 (17:52 +0530)]
common/cnxk: update to v1.16 ucc codes

Update to v1.16 microcode completion codes.

Signed-off-by: Anoob Joseph <anoobj@marvell.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
2 years agocommon/cnxk: update to v1.13 ZUC API
Vidya Sagar Velumuri [Thu, 2 Sep 2021 12:22:28 +0000 (17:52 +0530)]
common/cnxk: update to v1.13 ZUC API

Add support for ZUC API change in ucode 1.13

Signed-off-by: Anoob Joseph <anoobj@marvell.com>
Signed-off-by: Vidya Sagar Velumuri <vvelumuri@marvell.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
2 years agocrypto/mlx5: fix timestamp format configuration
Michael Baum [Sun, 5 Sep 2021 08:04:15 +0000 (11:04 +0300)]
crypto/mlx5: fix timestamp format configuration

This patch adds support for the timestamp format settings for
the receive and send queues. If the firmware version x.30.1000
or above is installed and the NIC timestamps are configured
with the real-time format, the default zero values for newly
added fields cause the queue creation to fail.

The patch queries the timestamp formats supported by the hardware
and sets the configuration values in queue context accordingly.

Fixes: 6152534e211e ("crypto/mlx5: support queue pairs operations")
Cc: stable@dpdk.org
Signed-off-by: Michael Baum <michaelba@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
2 years agoevent/cnxk: add cn10k crypto adapter fast path
Shijith Thotton [Thu, 2 Sep 2021 14:41:56 +0000 (20:11 +0530)]
event/cnxk: add cn10k crypto adapter fast path

Set crypto adapter enqueue and dequeue operations for CN10K.

Signed-off-by: Shijith Thotton <sthotton@marvell.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
2 years agocrypto/cnxk: add cn10k crypto adapter fast path
Shijith Thotton [Thu, 2 Sep 2021 14:41:55 +0000 (20:11 +0530)]
crypto/cnxk: add cn10k crypto adapter fast path

Added crypto adapter enqueue and dequeue operations for CN10K.

Signed-off-by: Shijith Thotton <sthotton@marvell.com>
Acked-by: Ray Kinsella <mdr@ashroe.eu>
Acked-by: Anoob Joseph <anoobj@marvell.com>
2 years agoevent/cnxk: add cn9k crypto adapter fast path
Shijith Thotton [Thu, 2 Sep 2021 14:41:54 +0000 (20:11 +0530)]
event/cnxk: add cn9k crypto adapter fast path

Set crypto adapter enqueue and dequeue operations for CN9K.

Signed-off-by: Shijith Thotton <sthotton@marvell.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
2 years agocrypto/cnxk: add cn9k crypto adapter fast path
Shijith Thotton [Thu, 2 Sep 2021 14:41:53 +0000 (20:11 +0530)]
crypto/cnxk: add cn9k crypto adapter fast path

Added crypto adapter enqueue and dequeue operations for CN9K.

Signed-off-by: Shijith Thotton <sthotton@marvell.com>
Acked-by: Ray Kinsella <mdr@ashroe.eu>
Acked-by: Anoob Joseph <anoobj@marvell.com>
2 years agoevent/cnxk: add crypto adapter operations
Shijith Thotton [Thu, 2 Sep 2021 14:41:52 +0000 (20:11 +0530)]
event/cnxk: add crypto adapter operations

Added eventdev ops required to initialize crypto adapter.

Signed-off-by: Shijith Thotton <sthotton@marvell.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
2 years agocommon/cnxk: add function to check CPT IQ is full
Shijith Thotton [Thu, 2 Sep 2021 14:41:51 +0000 (20:11 +0530)]
common/cnxk: add function to check CPT IQ is full

Added flow control based check to determine CPT IQ is full.

Signed-off-by: Shijith Thotton <sthotton@marvell.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
2 years agoevent/cnxk: add macros to set eventdev operations
Shijith Thotton [Thu, 2 Sep 2021 14:41:50 +0000 (20:11 +0530)]
event/cnxk: add macros to set eventdev operations

Added a common macro to set eventdev enqueue and
dequeue operations to reduce code.

Signed-off-by: Shijith Thotton <sthotton@marvell.com>
Signed-off-by: Nithin Dabilpuram <ndabilpuram@marvell.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
2 years agonet/cnxk: add flag to show CPT can enqueue events
Shijith Thotton [Thu, 2 Sep 2021 14:41:49 +0000 (20:11 +0530)]
net/cnxk: add flag to show CPT can enqueue events

CPT can be told to submit events to SSO upon completion.
Crypto adapter uses this feature and the new flag can be
used to optimize receive path in those cases.

Signed-off-by: Shijith Thotton <sthotton@marvell.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
2 years agocrypto/octeontx2: fix unaligned access to device memory
Danny Patel [Fri, 27 Aug 2021 05:33:58 +0000 (11:03 +0530)]
crypto/octeontx2: fix unaligned access to device memory

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

Fixes: a0645ed0d6ef ("crypto/octeontx2: discover capabilities")
Cc: stable@dpdk.org
Signed-off-by: Danny Patel <dannyp@marvell.com>
Signed-off-by: Anoob Joseph <anoobj@marvell.com>
2 years agocompress/mlx5: fix leak on QP setup failure
Michael Baum [Tue, 31 Aug 2021 20:39:41 +0000 (23:39 +0300)]
compress/mlx5: fix leak on QP setup failure

The QP setup function allocates buffer for its
opaque MR and register it into MR structure.

After buffer allocation and before MR registration,
it tries allocate MR Btree.
When the MR Btree allocation fails, the buffer was
not freed what caused a memory leak.

Allocate the MR Btree before buffer alloction.

Fixes: 0165bccdb45f ("compress/mlx5: add memory region management")
Cc: stable@dpdk.org
Signed-off-by: Michael Baum <michaelba@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
2 years agocommon/cnxk: make IPsec defines common
Archana Muniganti [Wed, 1 Sep 2021 10:19:30 +0000 (15:49 +0530)]
common/cnxk: make IPsec defines common

Make IPsec defines common and remove redundant macros.

Signed-off-by: Archana Muniganti <marchana@marvell.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
2 years agocrypto/cnxk: support cn10k transport mode
Tejasree Kondoj [Wed, 1 Sep 2021 10:19:28 +0000 (15:49 +0530)]
crypto/cnxk: support cn10k transport mode

Adding support for cn10k lookaside IPsec transport mode.

Signed-off-by: Tejasree Kondoj <ktejasree@marvell.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
2 years agocrypto/cnxk: make IPsec verify functions common
Archana Muniganti [Wed, 1 Sep 2021 10:19:27 +0000 (15:49 +0530)]
crypto/cnxk: make IPsec verify functions common

IPsec verify functions can be made common which can
be used for both cn9k and cn10k

Signed-off-by: Archana Muniganti <marchana@marvell.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
2 years agocrypto/cnxk: use rlen from CPT result with lookaside
Tejasree Kondoj [Wed, 1 Sep 2021 10:19:26 +0000 (15:49 +0530)]
crypto/cnxk: use rlen from CPT result with lookaside

Use rlen from CPT result with lookaside operations

Signed-off-by: Tejasree Kondoj <ktejasree@marvell.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
2 years agocrypto/cnxk: remove redundant code
Tejasree Kondoj [Wed, 1 Sep 2021 10:19:25 +0000 (15:49 +0530)]
crypto/cnxk: remove redundant code

Removing redundant code in cn10k lookaside IPsec.

Signed-off-by: Tejasree Kondoj <ktejasree@marvell.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
2 years agocrypto/cnxk: support lookaside IPsec
Tejasree Kondoj [Wed, 1 Sep 2021 10:19:24 +0000 (15:49 +0530)]
crypto/cnxk: support lookaside IPsec

Added lookaside IPsec AES-CBC-HMAC-SHA1
support to cnxk driver.

Signed-off-by: Tejasree Kondoj <ktejasree@marvell.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
2 years agocommon/cnxk: add hash generation API
Tejasree Kondoj [Wed, 1 Sep 2021 10:19:23 +0000 (15:49 +0530)]
common/cnxk: add hash generation API

Adding functions for hash generation that can be used
in hmac opad/ipad calculation.

Signed-off-by: Tejasree Kondoj <ktejasree@marvell.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
2 years agodevargs: parse global device syntax
Xueming Li [Tue, 13 Apr 2021 03:14:12 +0000 (03:14 +0000)]
devargs: parse global device syntax

When parsing a devargs, try to parse using the global device syntax
first. Fallback on legacy syntax on error.

Example of new global device syntax:
 -a bus=pci,addr=82:00.0/class=eth/driver=mlx5,dv_flow_en=1

Signed-off-by: Xueming Li <xuemingl@nvidia.com>
Reviewed-by: Gaetan Rivet <grive@u256.net>
2 years agobus: add device arguments name parsing
Xueming Li [Tue, 13 Apr 2021 03:14:11 +0000 (03:14 +0000)]
bus: add device arguments name parsing

For device probe and iterator, devargs name was key information,
parsed by rte_devargs_parse. In legacy parser, devargs name was
extracted after bus name:
  bus:name,kv_arguments,,,
Example:
  pci:83:00.0,arguments,...
  vdev:pcap0,...

To be compatible with legacy parser, this patch introduces new
bus driver API devargs_parse to parse devargs and update devargs name.
If devargs_parse not implemented by bus driver, the new syntax parser
rte_devargs_layers_parse default will resolve devargs name from bus's
"name" argument.

Different bus driver might choose different keys from arguments with
unified format. The PCI bus implementation fills the devargs name with
the "addr" argument, example:
 -a bus=pci,addr=83:00.0/class=eth/driver=mlx5,...
    name: 0000:03:00.0
 -a bus=vdev,name=pcap0/class=eth/driver=pcap,...
    name:pcap0

Signed-off-by: Xueming Li <xuemingl@nvidia.com>
Reviewed-by: Gaetan Rivet <grive@u256.net>
2 years agoapp/testpmd: fix dump of Tx offload flags
Nithin Dabilpuram [Mon, 16 Aug 2021 07:09:42 +0000 (12:39 +0530)]
app/testpmd: fix dump of Tx offload flags

Fix verbose mode dump for Tx to dump tx offload flags instead of
Rx offload flags.

Fixes: d862c45b5955 ("app/testpmd: move dumping packets to a separate function")
Cc: stable@dpdk.org
Signed-off-by: Nithin Dabilpuram <ndabilpuram@marvell.com>
Acked-by: Xiaoyun Li <xiaoyun.li@intel.com>
Acked-by: Raslan Darawsheh <rasland@nvidia.com>
2 years agoapp/testpmd: fix check without outer checksum
Nithin Dabilpuram [Mon, 16 Aug 2021 07:09:41 +0000 (12:39 +0530)]
app/testpmd: fix check without outer checksum

Donot use outer metadata when neither outer ip checksum nor
outer udp checksum is enabled. PMD's will ignore the
outer_l2_len and outer_l3_len in cases where none of
the outer checksum is enabled and hence only l2_len and
l3_len will be used to calculate the offsets for L2 or L3
header.

Fixes: 3c32113a1aac ("app/testpmd: fix IPv6 tunnel checksum")
Cc: stable@dpdk.org
Signed-off-by: Nithin Dabilpuram <ndabilpuram@marvell.com>
Acked-by: Xiaoyun Li <xiaoyun.li@intel.com>
2 years agonet/bnxt: fix VNIC config error in Rx queue start
Ajit Khaparde [Tue, 24 Aug 2021 01:58:20 +0000 (18:58 -0700)]
net/bnxt: fix VNIC config error in Rx queue start

During port stop/start sequence the Thor FW is returning an error.
This is because we are deriving incorrect active Rx ring and using
that wrong information in the bnxt_vnic_rss_cfg HWRM command.

Fix it by using the rx_queue_state from eth_dev.

Fixes: 0105ea1296c9 ("net/bnxt: support runtime queue setup")
Cc: stable@dpdk.org
Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Reviewed-by: Somnath Kotur <somnath.kotur@broadcom.com>
2 years agonet/bnxt: fix crash after port stop/start
Somnath Kotur [Mon, 23 Aug 2021 15:44:53 +0000 (21:14 +0530)]
net/bnxt: fix crash after port stop/start

On chips like Thor, port stop/start sequence could result in a crash
in the application. This is because of false detection of a bad
opaque in the Rx completion and the subsequent kicking-in of the ring
reset code to recover from the condition.
The root cause being that the port stop/start would result in the HW
starting with fresh values, while the driver internal tracker variable
`rx_next_cons` is still pointing to a stale value.
Fix this by resetting rx_next_cons to 0 in bnxt_init_one_rx_ring()

Fixes: 03c8f2fe111c ("net/bnxt: detect bad opaque in Rx completion")
Cc: stable@dpdk.org
Signed-off-by: Somnath Kotur <somnath.kotur@broadcom.com>
Reviewed-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
2 years agoapp/testpmd: use per-core variable in flowgen
Zhihong Wang [Fri, 13 Aug 2021 08:05:48 +0000 (16:05 +0800)]
app/testpmd: use per-core variable in flowgen

Use per-core variable for flow indexing to solve cache contention in
multi-core scenarios.

Signed-off-by: Zhihong Wang <wangzhihong.wzh@bytedance.com>
Acked-by: Xiaoyun Li <xiaoyun.li@intel.com>
2 years agoapp/testpmd: record Rx and dropped stats in flowgen
Zhihong Wang [Fri, 13 Aug 2021 08:05:47 +0000 (16:05 +0800)]
app/testpmd: record Rx and dropped stats in flowgen

Call inc_rx_burst_stats for rx operation, and record fwd_dropped.

Signed-off-by: Zhihong Wang <wangzhihong.wzh@bytedance.com>
Acked-by: Xiaoyun Li <xiaoyun.li@intel.com>
2 years agoapp/testpmd: use existing checksum API in flowgen engine
Zhihong Wang [Fri, 13 Aug 2021 08:05:46 +0000 (16:05 +0800)]
app/testpmd: use existing checksum API in flowgen engine

Use the rte_ipv4_cksum API to replace local ip_sum implementation.

Signed-off-by: Zhihong Wang <wangzhihong.wzh@bytedance.com>
Acked-by: Xiaoyun Li <xiaoyun.li@intel.com>