dpdk.git
3 years agonet/bnxt: support flow template for Thor
Kishore Padmanabha [Mon, 20 Sep 2021 07:42:06 +0000 (13:12 +0530)]
net/bnxt: support flow template for Thor

Template adds non-VFR based support for testpmd with:
matches to include
- DMAC, SIP, DIP, Proto, Sport, Dport
- SIP, DIP, Proto, Sport, Dport
actions:
- count, drop

Signed-off-by: Kishore Padmanabha <kishore.padmanabha@broadcom.com>
Signed-off-by: Venkat Duvvuru <venkatkumar.duvvuru@broadcom.com>
Reviewed-by: Mike Baucom <michael.baucom@broadcom.com>
Acked-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
3 years agonet/bnxt: add SRAM manager model
Farah Smith [Mon, 20 Sep 2021 07:42:05 +0000 (13:12 +0530)]
net/bnxt: add SRAM manager model

The SRAM manager supports allocation and free of variable sized
records within SRAM memory.  These record sizes are 8, 16, 32, or
64B. The SRAM manager algorithm will not fragment memory during
run time. Previous implementation only included fixed size 64B
records regardless of the size required.

Signed-off-by: Farah Smith <farah.smith@broadcom.com>
Reviewed-by: Shahaji Bhosle <sbhosle@broadcom.com>
Reviewed-by: Peter Spreadborough <peter.spreadborough@broadcom.com>
Acked-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
3 years agonet/bnxt: support flow meter drop counter
Jay Ding [Mon, 20 Sep 2021 07:42:04 +0000 (13:12 +0530)]
net/bnxt: support flow meter drop counter

This patch adds flow meter drop counter support for Thor.

Signed-off-by: Jay Ding <jay.ding@broadcom.com>
Reviewed-by: Farah Smith <farah.smith@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
3 years agonet/bnxt: enable dynamic pool allocator
Peter Spreadborough [Mon, 20 Sep 2021 07:42:03 +0000 (13:12 +0530)]
net/bnxt: enable dynamic pool allocator

Enable dynamic entry allocator for Exact Match SRAM entries.
Deprecate static entry allocator code.

Signed-off-by: Peter Spreadborough <peter.spreadborough@broadcom.com>
Reviewed-by: Randy Schacher <stuart.schacher@broadcom.com>
Acked-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
3 years agonet/bnxt: update TruFlow core index table
Farah Smith [Mon, 20 Sep 2021 07:42:02 +0000 (13:12 +0530)]
net/bnxt: update TruFlow core index table

Update the TruFlow core index table and
remove unused shadow table functionality.

Signed-off-by: Farah Smith <farah.smith@broadcom.com>
Reviewed-by: Peter Spreadborough <peter.spreadborough@broadcom.com>
Acked-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
3 years agocommon/cnxk: align NPA stack to ROC cache line size
Ashwin Sekhar T K [Fri, 17 Sep 2021 11:23:09 +0000 (16:53 +0530)]
common/cnxk: align NPA stack to ROC cache line size

Network Pool accelerator (NPA) is part of ROC (Rest Of Chip). So
NPA structures should be aligned to ROC Cache line size and not
CPU cache line size.

Non alignment of NPA stack to ROC cache line will result in
undefined runtime NPA behaviour.

Fixes: f765f5611240 ("common/cnxk: add NPA pool HW operations")
Cc: stable@dpdk.org
Signed-off-by: Ashwin Sekhar T K <asekhar@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
3 years agonet/octeontx: fix access to indirect buffers
Harman Kalra [Mon, 20 Sep 2021 14:49:25 +0000 (20:19 +0530)]
net/octeontx: fix access to indirect buffers

Issue has been observed where fields of indirect buffers are
accessed after being set free by the diver. Also fixing freeing
of direct buffers to correct aura.

Fixes: 5cbe184802aa ("net/octeontx: support fast mbuf free")
Cc: stable@dpdk.org
Signed-off-by: David George <david.george@sophos.com>
Signed-off-by: Harman Kalra <hkalra@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
3 years agocommon/cnxk: avoid using stashing option of stype
Ashwin Sekhar T K [Fri, 17 Sep 2021 09:34:37 +0000 (15:04 +0530)]
common/cnxk: avoid using stashing option of stype

Avoid using stashing option of stype in NPA in cn10k-a0 stepping.

This is a workaround for a HW Errata due to which NPA stashing operations
will never result in writing the data into L2 cache. But instead, it will
be written into LLC.

Signed-off-by: Ashwin Sekhar T K <asekhar@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
3 years agocommon/cnxk: update ROC models
Ashwin Sekhar T K [Fri, 17 Sep 2021 09:34:36 +0000 (15:04 +0530)]
common/cnxk: update ROC models

Made following updates to ROC (Rest of Chip) models.
- Use consistent upper/lower case in macros defining different
  ROC models.
- Add API to detect cn96 Cx stepping.
- Make all current cn10k models as A0 stepping.

Signed-off-by: Ashwin Sekhar T K <asekhar@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
3 years agonet/ice: fix flow priority support in non-pipeline mode
Yuying Zhang [Sat, 18 Sep 2021 06:49:30 +0000 (06:49 +0000)]
net/ice: fix flow priority support in non-pipeline mode

Lower values denote higher priority with 0 as the maximum.
The usage of priority in non-pipeline mode is wrong.

This patch fixed this issue in switch filter and added input
validation of priority in FDIR, RSS and ACL filter which
only support one priority level.

Fixes: 2321e34c23b3 ("net/ice: support flow priority for DCF switch filter")
Cc: stable@dpdk.org
Signed-off-by: Yuying Zhang <yuying.zhang@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
3 years agonet/iavf: enable interrupt polling
Robin Zhang [Wed, 25 Aug 2021 08:34:35 +0000 (08:34 +0000)]
net/iavf: enable interrupt polling

For VF hosted by Intel 700 series NICs, internal Rx interrupt and adminq
interrupt share the same source, that cause a lot CPU cycles be wasted on
interrupt handler on Rx path.

The patch disable PCI interrupt and remove the interrupt handler, replace
it with a low frequency(50ms) interrupt polling daemon which is
implemented by registering an alarm callback periodically.

The virtual channel capability bit VIRTCHNL_VF_OFFLOAD_WB_ON_ITR can be
used to negotiate if iavf PMD needs to enable background alarm or not, so
ideally this change will not impact the case hosted by Intel 800 series
NICS.

This patch implements the same logic with an early i40e commit:
commit 864a800d706d ("net/i40e: remove VF interrupt handler")

Signed-off-by: Robin Zhang <robinx.zhang@intel.com>
Acked-by: Pallavi Kadam <pallavi.kadam@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
3 years agonet/iavf: remove support for IP fragment default RSS
Wenjun Wu [Thu, 16 Sep 2021 05:04:27 +0000 (13:04 +0800)]
net/iavf: remove support for IP fragment default RSS

To support independent IP fragment default RSS, considerable
additional work need to be done, so we decide to remove this
feature to avoid some unexpected behavior we have observed,
meanwhile user always can use rte_flow to create RSS for IP
fragment packet explicitly.

Signed-off-by: Wenjun Wu <wenjun1.wu@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
3 years agonet/ice: remove support for IP fragment default RSS
Wenjun Wu [Thu, 16 Sep 2021 05:03:51 +0000 (13:03 +0800)]
net/ice: remove support for IP fragment default RSS

To support independent IP fragment default RSS, considerable
additional work need to be done, so we decide to remove this
feature to avoid some unexpected behavior we have observed,
meanwhile user always can use rte_flow to create RSS for IP
fragment packet explicitly.

Signed-off-by: Wenjun Wu <wenjun1.wu@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
3 years agonet/iavf: fix QFI fields of GTPU UL/DL for flow director
Lingyu Liu [Mon, 13 Sep 2021 15:34:02 +0000 (15:34 +0000)]
net/iavf: fix QFI fields of GTPU UL/DL for flow director

Fix QFI (QoS Flow Identifier) fields matching of GTPU UL/DL for FDIR.

Fixes: 78e8a87f6324 ("net/iavf: fix GTPU UL and DL support for flow director")
Cc: stable@dpdk.org
Signed-off-by: Junfeng Guo <junfeng.guo@intel.com>
Signed-off-by: Lingyu Liu <lingyu.liu@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
3 years agonet/iavf: fix mbuf leak
Qiming Chen [Thu, 16 Sep 2021 14:04:00 +0000 (22:04 +0800)]
net/iavf: fix mbuf leak

In the iavf_dev_rx_queue_start function, if the iavf_switch_queue
or iavf_switch_queue_lv function fails, the previously applied mbuf
is not released, resulting in leakage. The patch fixes the problem.

Fixes: 9cf9c02bf6ee ("net/iavf: add enable/disable queues for large VF")
Cc: stable@dpdk.org
Signed-off-by: Qiming Chen <chenqiming_huawei@163.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
3 years agonet/ice: support 1PPS
Simei Su [Wed, 15 Sep 2021 05:34:22 +0000 (13:34 +0800)]
net/ice: support 1PPS

The E810 supports four single-ended GPIO signals (SDP[20:23]). The 1PPS
signal outputs via SDP[20:23], which is measured by an oscilloscope.
This feature can be turned by a devargs which can select GPIO pin index
flexibly. Pin index 0 means SDP20, pin index 1 means SDP21 and so on.

The example for test command is as below:
./build/app/dpdk-testpmd -a af:00.0,pps_out='[pin:2]' -c f -n 4 -- -i

Signed-off-by: Simei Su <simei.su@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
3 years agonet/ice/base: add API for parser profile initialization
Qi Zhang [Fri, 17 Sep 2021 14:43:22 +0000 (22:43 +0800)]
net/ice/base: add API for parser profile initialization

Add API ice_parser_profile_init to init a parser profile base on
a parser result and a mask buffer. The ice_parser_profile can feed to
low level FXP engine to create HW profile / field vector directly.

Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Junfeng Guo <junfeng.guo@intel.com>
3 years agonet/ice/base: support tunnel port for parser
Qi Zhang [Fri, 17 Sep 2021 14:43:21 +0000 (22:43 +0800)]
net/ice/base: support tunnel port for parser

UDP tunnel can be added/deleted for vxlan, geneve, ecpri through
below APIs:
ice_parser_vxlan_tunnel_set
ice_parser_geneve_tunnel_set
ice_parser_ecpri_tunnel_set

Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Junfeng Guo <junfeng.guo@intel.com>
3 years agonet/ice/base: support double VLAN mode configure for parser
Qi Zhang [Fri, 17 Sep 2021 14:43:20 +0000 (22:43 +0800)]
net/ice/base: support double VLAN mode configure for parser

Add API ice_parser_dvm_set to support turn on/off parser's
double vlan mode.

Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Junfeng Guo <junfeng.guo@intel.com>
3 years agonet/ice/base: add parser execution main loop
Qi Zhang [Fri, 17 Sep 2021 14:43:19 +0000 (22:43 +0800)]
net/ice/base: add parser execution main loop

Implement function ice_parser_rt_execute which perform the main
loop of the parser.

Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Junfeng Guo <junfeng.guo@intel.com>
3 years agonet/ice/base: add helper function to aggregate flags
Qi Zhang [Fri, 17 Sep 2021 14:43:18 +0000 (22:43 +0800)]
net/ice/base: add helper function to aggregate flags

Add internal helper function ice_xlt_kb_flg_get to aggregate 64 bit
packet flag into 16 bit key builder flags.

Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Junfeng Guo <junfeng.guo@intel.com>
3 years agonet/ice/base: add helper function to redirect flags
Qi Zhang [Fri, 17 Sep 2021 14:43:17 +0000 (22:43 +0800)]
net/ice/base: add helper function to redirect flags

Add internal helper function ice_flg_redirect to redirect parser flags
to packet flags.

Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Junfeng Guo <junfeng.guo@intel.com>
3 years agonet/ice/base: add helper for ptype markers match
Qi Zhang [Fri, 17 Sep 2021 14:43:16 +0000 (22:43 +0800)]
net/ice/base: add helper for ptype markers match

Add internal helper function ice_ptype_mk_tcam_match for ptype markers
matching in tcam table.

Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Junfeng Guo <junfeng.guo@intel.com>
3 years agonet/ice/base: add helper for parse graph key matching
Qi Zhang [Fri, 17 Sep 2021 14:43:15 +0000 (22:43 +0800)]
net/ice/base: add helper for parse graph key matching

Add below two internal helper functions for parse graph key matching
in cam table:

ice_pg_cam_match
ice_pg_nm_cam_match

Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Junfeng Guo <junfeng.guo@intel.com>
3 years agonet/ice/base: add helper function for boost TCAM match
Qi Zhang [Fri, 17 Sep 2021 14:43:14 +0000 (22:43 +0800)]
net/ice/base: add helper function for boost TCAM match

Add internal helper function ice_bst_tcam_match to perform ternary
match on boost TCAM.

Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Junfeng Guo <junfeng.guo@intel.com>
3 years agonet/ice/base: add parser runtime skeleton
Qi Zhang [Fri, 17 Sep 2021 14:43:13 +0000 (22:43 +0800)]
net/ice/base: add parser runtime skeleton

Add parser runtime data struct ice_parser_rt.

Add below APIs for parser runtime preparation:
ice_parser_rt_reset
ice_parser_rt_pkt_buf_set

Add below API skeleton for parser runtime execution:
ice_parser_rt_execute

Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Junfeng Guo <junfeng.guo@intel.com>
3 years agonet/ice/base: init XLT key builder for parser
Qi Zhang [Fri, 17 Sep 2021 14:43:12 +0000 (22:43 +0800)]
net/ice/base: init XLT key builder for parser

Parse below DDP section into struct ice_xlt_kb:
ICE_SID_XLT_KEY_BUILDER_SW
ICE_SID_XLT_KEY_BUILDER_FD
ICE_SID_XLT_KEY_BUILDER_RSS

Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Junfeng Guo <junfeng.guo@intel.com>
3 years agonet/ice/base: init flag redirect table for parser
Qi Zhang [Fri, 17 Sep 2021 14:43:11 +0000 (22:43 +0800)]
net/ice/base: init flag redirect table for parser

Parse DDP section ICE_SID_RXPARSER_FLAG_REDIR into an array of
ice_flag_rd_item.

Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Junfeng Guo <junfeng.guo@intel.com>
3 years agonet/ice/base: init protocol group table for parser
Qi Zhang [Fri, 17 Sep 2021 14:43:10 +0000 (22:43 +0800)]
net/ice/base: init protocol group table for parser

Parse DDP section ICE_SID_RXPARSER_PROTO_GRP into an array of
ice_proto_grp_item.

Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Junfeng Guo <junfeng.guo@intel.com>
3 years agonet/ice/base: init marker group table for parser
Qi Zhang [Fri, 17 Sep 2021 14:43:09 +0000 (22:43 +0800)]
net/ice/base: init marker group table for parser

Parse DDP section ICE_SID_RXPARSER_MARKER_GRP into an array of
ice_mk_grp_item.

Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Junfeng Guo <junfeng.guo@intel.com>
3 years agonet/ice/base: init ptype marker TCAM table for parser
Qi Zhang [Fri, 17 Sep 2021 14:43:08 +0000 (22:43 +0800)]
net/ice/base: init ptype marker TCAM table for parser

Parse DDP section ICE_SID_RXPARSER_MARKER_PTYPE into an array of
ice_ptype_mk_tcam_item.

Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Junfeng Guo <junfeng.guo@intel.com>
3 years agonet/ice/base: init boost TCAM table for parser
Qi Zhang [Fri, 17 Sep 2021 14:43:07 +0000 (22:43 +0800)]
net/ice/base: init boost TCAM table for parser

Parse DDP section ICE_SID_RXPARSER_CAM into an array of
ice_bst_tcam_item.
Parse DDP section ICE_SID_LBL_RXPARSER_TMEM into an array of
ice_lbl_item.

Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Junfeng Guo <junfeng.guo@intel.com>
3 years agonet/ice/base: init parse graph CAM table for parser
Qi Zhang [Fri, 17 Sep 2021 14:43:06 +0000 (22:43 +0800)]
net/ice/base: init parse graph CAM table for parser

Parse DDP section ICE_SID_RXPARSER_CAM or ICE_SID_RXPARSER_PG_SPILL
into an array of struct ice_pg_cam_item.
Parse DDP section ICE_SID_RXPARSER_NOMATCH_CAM or
ICE_SID_RXPARSER_NOMATCH_SPILL into an array of struct ice_pg_nm_cam_item.

Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Junfeng Guo <junfeng.guo@intel.com>
3 years agonet/ice/base: init metainit table for parser
Qi Zhang [Fri, 17 Sep 2021 14:43:05 +0000 (22:43 +0800)]
net/ice/base: init metainit table for parser

Parse DDP section ICE_SID_RXPARSER_METADATA_INIT into an array of
struct ice_metainit_item.

Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Junfeng Guo <junfeng.guo@intel.com>
3 years agonet/ice/base: init IMEM table for parser
Qi Zhang [Fri, 17 Sep 2021 14:43:04 +0000 (22:43 +0800)]
net/ice/base: init IMEM table for parser

Parse DDP section ICE_SID_RXPARSER_IMEM into an array of
struct ice_imem_item.

The Instruction Memory (IMEM) section contains three VLIW instructions
for the ALUs, a key extraction instruction for the Parse Graph CAM, and
several other fields.

Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Junfeng Guo <junfeng.guo@intel.com>
3 years agonet/ice/base: add parser create and destroy skeleton
Qi Zhang [Fri, 17 Sep 2021 14:43:03 +0000 (22:43 +0800)]
net/ice/base: add parser create and destroy skeleton

Add new parser module which can parse a packet in binary
and generate information like ptype, protocol/offset pairs
and flags which can be used to feed the FXP profile creation
directly.

The patch added skeleton of the parser instance create and
destroy APIs:
ice_parser_create
ice_parser_destroy

Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Junfeng Guo <junfeng.guo@intel.com>
3 years agonet/ice/base: update auto-generated hardware register
Qi Zhang [Thu, 16 Sep 2021 09:53:04 +0000 (17:53 +0800)]
net/ice/base: update auto-generated hardware register

Update ice_hw_autogen.h.
Remove duplicated one in ice_nvm.h.
Replace ICE_NVM_ACCESS_GL_HIBA_MAX with GL_HIBA_MAX_INDEX.

Signed-off-by: Scott W Taylor <scott.w.taylor@intel.com>
Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Junfeng Guo <junfeng.guo@intel.com>
3 years agonet/ice/base: support SMA controller
Qi Zhang [Thu, 16 Sep 2021 09:53:03 +0000 (17:53 +0800)]
net/ice/base: support SMA controller

Add support for controlling SMA (SubMiniature version A) connectors
using GPIO get/set AQs.

Signed-off-by: Maciej Machnikowski <maciej.machnikowski@intel.com>
Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Junfeng Guo <junfeng.guo@intel.com>
3 years agonet/ice/base: add get/set functions for shared parameters
Qi Zhang [Thu, 16 Sep 2021 09:53:02 +0000 (17:53 +0800)]
net/ice/base: add get/set functions for shared parameters

Add functions used by the driver for setting and getting the shared
driver parameters. These will be used by the driver in order to share
the PTP clock index identifier between PF drivers.

Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Junfeng Guo <junfeng.guo@intel.com>
3 years agonet/ice/base: add GCO defines and GCO flex descriptor
Qi Zhang [Thu, 16 Sep 2021 09:53:01 +0000 (17:53 +0800)]
net/ice/base: add GCO defines and GCO flex descriptor

Added the memory needed for the generic checksum offload (GCO)
feature, including the new flex descriptor ICE_RXDID_GSC.

Signed-off-by: Alice Michael <alice.michael@intel.com>
Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Junfeng Guo <junfeng.guo@intel.com>
3 years agonet/ice/base: add helper to check for 100M speed support
Qi Zhang [Thu, 16 Sep 2021 09:53:00 +0000 (17:53 +0800)]
net/ice/base: add helper to check for 100M speed support

Add a helper function to check if the underlying part can
support 100M speeds.

Signed-off-by: Anirudh Venkataramanan <anirudh.venkataramanan@intel.com>
Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Junfeng Guo <junfeng.guo@intel.com>
3 years agonet/ice/base: add package segment ID
Qi Zhang [Thu, 16 Sep 2021 09:52:59 +0000 (17:52 +0800)]
net/ice/base: add package segment ID

DDP package format is shared with different devices, for E810 device
we only support SEGMENT_TYPE_ICE_810.

Signed-off-by: Dan Nowlin <dan.nowlin@intel.com>
Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Junfeng Guo <junfeng.guo@intel.com>
3 years agonet/ice/base: allow tool access to manageability register
Qi Zhang [Thu, 16 Sep 2021 09:52:58 +0000 (17:52 +0800)]
net/ice/base: allow tool access to manageability register

E810-T supports signed netlists and to support this, the NVM update
tool needs to be able to read the GL_MNG_DEF_DEVID register. Add
said register to the allowlist in ice_validate_nvm_rw_reg.

Signed-off-by: Anirudh Venkataramanan <anirudh.venkataramanan@intel.com>
Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Junfeng Guo <junfeng.guo@intel.com>
3 years agonet/ice/base: change address parameter to 16-bit
Qi Zhang [Thu, 16 Sep 2021 09:52:57 +0000 (17:52 +0800)]
net/ice/base: change address parameter to 16-bit

Change one of the input parameter (addr) in ice_read_cgu_reg_e822 and
ice_write_cgu_reg_e822 functions. This will avoid the shrink down
conversion from addr to cgu_msg.msg_addr_low.

Signed-off-by: Chinh T Cao <chinh.t.cao@intel.com>
Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Junfeng Guo <junfeng.guo@intel.com>
3 years agonet/ice/base: allow to enable LAN and loopback in switch
Qi Zhang [Thu, 16 Sep 2021 09:52:56 +0000 (17:52 +0800)]
net/ice/base: allow to enable LAN and loopback in switch

Currently shared code API does not allow to set/unset lb_en
and lan_en flags for advanced rules during their creation.
Because of that we have to use a workaround in switchdev
which is to update rule immediately after its creation.
This change will allow us to set/unset those flags right
away.

Signed-off-by: Wojciech Drewek <wojciech.drewek@intel.com>
Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Junfeng Guo <junfeng.guo@intel.com>
3 years agonet/ice/base: use macro instead of open-coded division
Qi Zhang [Thu, 16 Sep 2021 09:52:55 +0000 (17:52 +0800)]
net/ice/base: use macro instead of open-coded division

For some operating systems, 64-bit division requires using specific
implementations. Use the DIV_64BIT macro to replace open-coded division
so that the driver may convert this to the appropriate operating-system
specific implementation when necessary.

Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Junfeng Guo <junfeng.guo@intel.com>
3 years agonet/ice/base: include more E810T adapters
Qi Zhang [Thu, 16 Sep 2021 09:52:54 +0000 (17:52 +0800)]
net/ice/base: include more E810T adapters

Expand the ice_is_e810t to include:
- Intel(R) Ethernet Network Adapter E810-C-Q2T
- Intel(R) Ethernet 25G 4P E810-XXV-st

Signed-off-by: Maciej Machnikowski <maciej.machnikowski@intel.com>
Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Junfeng Guo <junfeng.guo@intel.com>
3 years agonet/ice/base: calculate logical PF ID
Qi Zhang [Thu, 16 Sep 2021 09:52:53 +0000 (17:52 +0800)]
net/ice/base: calculate logical PF ID

In some devices, the function numbers used are non-contiguous. For
example, some two port devices will report as functions 0 and 2.

When distributing RSS and FDIR masks, which are global resources across
the active devices, it is required to have a contiguous PF id, which can
be described as a logical PF id. In the case above, function 0 would
have a logical PF id of 0, and function 2 would have a logical PF id of
1.

Using logical PF id can properly describe which slice of resources can
be used by a particular PF.

Cc: stable@dpdk.org
Signed-off-by: Dan Nowlin <dan.nowlin@intel.com>
Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Junfeng Guo <junfeng.guo@intel.com>
3 years agonet/sfc: fix getting accumulative SW xstat
Ivan Ilchenko [Wed, 15 Sep 2021 10:40:17 +0000 (13:40 +0300)]
net/sfc: fix getting accumulative SW xstat

Add missing initialisation of the accumulative SW xstat to
zero since it is sum of per-queue xstats.

Fixes: fdd7719eb3c1 ("net/sfc: add xstats for Rx/Tx doorbells")
Cc: stable@dpdk.org
Signed-off-by: Ivan Ilchenko <ivan.ilchenko@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
3 years agoethdev: add IPv4 and L4 checksum RSS offload types
Alvin Zhang [Wed, 15 Sep 2021 05:47:04 +0000 (13:47 +0800)]
ethdev: add IPv4 and L4 checksum RSS offload types

This patch defines new RSS offload types for IPv4 and
L4(TCP/UDP/SCTP) checksum, which are required when users want
to distribute packets based on the IPv4 or L4 checksum field.

For example "flow create 0 ingress pattern eth / ipv4 / end
actions rss types ipv4-chksum end queues end / end", this flow
causes all matching packets to be distributed to queues on
basis of IPv4 checksum.

Signed-off-by: Alvin Zhang <alvinx.zhang@intel.com>
Reviewed-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Acked-by: Aman Deep Singh <aman.deep.singh@intel.com>
Acked-by: Ferruh Yigit <ferruh.yigit@intel.com>
3 years agonet/bonding: fix memory leak on closing device
Dapeng Yu [Wed, 15 Sep 2021 05:08:02 +0000 (13:08 +0800)]
net/bonding: fix memory leak on closing device

If the bond device was created by vdev mode, the kvlist was not free
after the bond device was closed.

This patch fixes it.

Fixes: 144dc4739975 ("net/bonding: fix leak on remove")
Cc: stable@dpdk.org
Signed-off-by: Dapeng Yu <dapengx.yu@intel.com>
Acked-by: Min Hu (Connor) <humin29@huawei.com>
3 years agomem: promote some shared memory config API to stable
Anatoly Burakov [Fri, 10 Sep 2021 12:30:09 +0000 (12:30 +0000)]
mem: promote some shared memory config API to stable

As per ABI policy, move the formerly experimental API's to the stable
section.

Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
Acked-by: Ray Kinsella <mdr@ashroe.eu>
3 years agomem: promote DMA mask API to stable
Anatoly Burakov [Fri, 10 Sep 2021 12:30:08 +0000 (12:30 +0000)]
mem: promote DMA mask API to stable

As per ABI policy, move the formerly experimental API's to the stable
section.

Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
Acked-by: Ray Kinsella <mdr@ashroe.eu>
3 years agomem: promote external memory API to stable
Anatoly Burakov [Fri, 10 Sep 2021 12:30:07 +0000 (12:30 +0000)]
mem: promote external memory API to stable

As per ABI policy, move the formerly experimental API's to the stable
section.

Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
Acked-by: Ray Kinsella <mdr@ashroe.eu>
3 years agomem: promote memseg API to stable
Anatoly Burakov [Fri, 10 Sep 2021 12:30:06 +0000 (12:30 +0000)]
mem: promote memseg API to stable

As per ABI policy, move the formerly experimental API's to the stable
section.

Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
Acked-by: Ray Kinsella <mdr@ashroe.eu>
3 years agomalloc: promote some experimental API to stable
Anatoly Burakov [Fri, 10 Sep 2021 12:30:05 +0000 (12:30 +0000)]
malloc: promote some experimental API to stable

As per ABI policy, move the formerly experimental API's to the stable
section.

Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
Acked-by: Ray Kinsella <mdr@ashroe.eu>
3 years agofbarray: promote experimental API to stable
Anatoly Burakov [Fri, 10 Sep 2021 12:30:04 +0000 (12:30 +0000)]
fbarray: promote experimental API to stable

As per ABI policy, move the formerly experimental API's to the stable
section.

Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
Acked-by: Ray Kinsella <mdr@ashroe.eu>
3 years agoipc: promote experimental API to stable
Anatoly Burakov [Fri, 10 Sep 2021 12:30:03 +0000 (12:30 +0000)]
ipc: promote experimental API to stable

As per ABI policy, move the formerly experimental API's to the stable
section.

Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
Acked-by: Ray Kinsella <mdr@ashroe.eu>
3 years agotest/crypto: add tunnel header verification cases
Tejasree Kondoj [Tue, 28 Sep 2021 12:07:41 +0000 (17:37 +0530)]
test/crypto: add tunnel header verification cases

Added test cases to verify tunnel header in IPsec inbound.

Signed-off-by: Tejasree Kondoj <ktejasree@marvell.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
3 years agocommon/cnxk: support tunnel header verification
Tejasree Kondoj [Tue, 28 Sep 2021 12:07:40 +0000 (17:37 +0530)]
common/cnxk: support tunnel header verification

Added support to verify tunnel header in IPsec inbound.

Signed-off-by: Tejasree Kondoj <ktejasree@marvell.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
3 years agosecurity: add option to configure tunnel header verification
Tejasree Kondoj [Tue, 28 Sep 2021 12:07:39 +0000 (17:37 +0530)]
security: add option to configure tunnel header verification

Add option to indicate whether outer header verification
need to be done as part of inbound IPsec processing.

With inline IPsec processing, SA lookup would be happening
in the Rx path of rte_ethdev. When rte_flow is configured to
support more than one SA, SPI would be used to lookup SA.
In such cases, additional verification would be required to
ensure duplicate SPIs are not getting processed in the inline path.

For lookaside cases, the same option can be used by application
to offload tunnel verification to the PMD.

These verifications would help in averting possible DoS attacks.

Signed-off-by: Tejasree Kondoj <ktejasree@marvell.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
3 years agoexamples/ipsec-secgw: clear soft expiry configuration
Anoob Joseph [Tue, 28 Sep 2021 10:59:59 +0000 (16:29 +0530)]
examples/ipsec-secgw: clear soft expiry configuration

Soft expiry is not a mandatory IPsec feature. It is verified separately
with IPsec unit tests. So configuration of the same is not required.
Also, soft expiry tracking can cause perf degradation with some PMDs.
Since a separate UT is available and the same setting in ipsec-secgw is
not verifying the functionality, remove the same by clearing life
configuration.

Signed-off-by: Anoob Joseph <anoobj@marvell.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
3 years agotest/crypto: add packet hard expiry cases
Anoob Joseph [Tue, 28 Sep 2021 10:59:58 +0000 (16:29 +0530)]
test/crypto: add packet hard expiry cases

Add tests to validate packets hard expiry handling.

Signed-off-by: Anoob Joseph <anoobj@marvell.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
3 years agotest/crypto: add packet soft expiry cases
Anoob Joseph [Tue, 28 Sep 2021 10:59:57 +0000 (16:29 +0530)]
test/crypto: add packet soft expiry cases

Add tests to validate packets soft expiry handling.

Signed-off-by: Anoob Joseph <anoobj@marvell.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
3 years agocrypto/octeontx2: add checks for life configuration
Anoob Joseph [Tue, 28 Sep 2021 10:59:56 +0000 (16:29 +0530)]
crypto/octeontx2: add checks for life configuration

Lifetime tracking is not supported by hardware and is not implemented in
software either. Return failure when lifetime is configured.

Signed-off-by: Anoob Joseph <anoobj@marvell.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
3 years agocommon/cnxk: support lifetime configuration
Anoob Joseph [Tue, 28 Sep 2021 10:59:55 +0000 (16:29 +0530)]
common/cnxk: support lifetime configuration

Add support for SA lifetime configuration. Expiry can
be either in units of octets or packets.

Also, updated cryptodev dequeue path to update crypto op result to
indicate soft expiry.

Signed-off-by: Anoob Joseph <anoobj@marvell.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
3 years agosecurity: add SA lifetime configuration
Anoob Joseph [Tue, 28 Sep 2021 10:59:54 +0000 (16:29 +0530)]
security: add SA lifetime configuration

Add SA lifetime configuration to register soft and hard expiry limits.
Expiry can be in units of number of packets or bytes. Crypto op
status is also updated to include new field, aux_flags, which can be
used to indicate cases such as soft expiry in case of lookaside
protocol operations.

In case of soft expiry, the packets are successfully IPsec processed but
the soft expiry would indicate that SA needs to be reconfigured. For
inline protocol capable ethdev, this would result in an eth event while
for lookaside protocol capable cryptodev, this can be communicated via
`rte_crypto_op.aux_flags` field.

In case of hard expiry, the packets will not be IPsec processed and
would result in error.

Signed-off-by: Anoob Joseph <anoobj@marvell.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
3 years agotest/crypto: add outbound known vector cases for IV
Anoob Joseph [Tue, 7 Sep 2021 16:17:42 +0000 (21:47 +0530)]
test/crypto: add outbound known vector cases for IV

Added outbound known vector test cases for IV generated
by app. The tests would be skipped on PMDs which do not
support IV provided by application.

Signed-off-by: Anoob Joseph <anoobj@marvell.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
3 years agocrypto/cnxk: add IV in SA in lookaside IPsec debug mode
Tejasree Kondoj [Tue, 7 Sep 2021 16:17:41 +0000 (21:47 +0530)]
crypto/cnxk: add IV in SA in lookaside IPsec debug mode

Adding IV in SA in lookaside IPsec debug mode. It helps
to verify lookaside PMD using known outbound vectors in
lookaside autotest.

Signed-off-by: Anoob Joseph <anoobj@marvell.com>
Signed-off-by: Tejasree Kondoj <ktejasree@marvell.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
3 years agosecurity: support user-specified IV
Anoob Joseph [Tue, 7 Sep 2021 16:17:40 +0000 (21:47 +0530)]
security: support user-specified IV

Enabled user to provide IV to be used per security
operation. This would be used with lookaside protocol
offload for comparing against known vectors.

By default, PMD would internally generate random IV.

Signed-off-by: Anoob Joseph <anoobj@marvell.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
3 years agotest/crypto: add UDP-encapsulated IPsec cases
Tejasree Kondoj [Sat, 25 Sep 2021 15:35:32 +0000 (21:05 +0530)]
test/crypto: add UDP-encapsulated IPsec cases

Added tests to verify UDP encapsulation with IPsec.
The tests have IPsec packets generated from plain packets
and verifies that UDP header is added. Subsequently, the
packets are decapsulated and then resultant packet is
verified by comparing against original packet.

Signed-off-by: Anoob Joseph <anoobj@marvell.com>
Signed-off-by: Tejasree Kondoj <ktejasree@marvell.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
Acked-by: Ciara Power <ciara.power@intel.com>
3 years agotest/crypto: add IV gen cases for IPsec
Tejasree Kondoj [Sat, 25 Sep 2021 15:35:31 +0000 (21:05 +0530)]
test/crypto: add IV gen cases for IPsec

Added cases to verify IV generated by PMD for lookaside IPsec.

The tests compare IV generated for a batch of packets and ensures that
IV is not getting repeated in the batch.

Signed-off-by: Anoob Joseph <anoobj@marvell.com>
Signed-off-by: Tejasree Kondoj <ktejasree@marvell.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
Acked-by: Ciara Power <ciara.power@intel.com>
3 years agotest/crypto: add lookaside IPsec ICV corrupt case
Tejasree Kondoj [Sat, 25 Sep 2021 15:35:30 +0000 (21:05 +0530)]
test/crypto: add lookaside IPsec ICV corrupt case

Add negative test to validate IPsec inbound processing failure with ICV
corruption. The tests would first do IPsec encapsulation and corrupt
ICV of the generated IPsec packet. Then the packet is submitted to IPsec
outbound processing for decapsulation. Test case would validate that PMD
returns an error in such cases.

Signed-off-by: Anoob Joseph <anoobj@marvell.com>
Signed-off-by: Tejasree Kondoj <ktejasree@marvell.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
Acked-by: Ciara Power <ciara.power@intel.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
3 years agotest/crypto: add combined mode IPsec cases
Anoob Joseph [Sat, 25 Sep 2021 15:35:29 +0000 (21:05 +0530)]
test/crypto: add combined mode IPsec cases

Add framework to test IPsec features with all supported
combinations of ciphers.

Combined mode tests are used to test all IPsec features against all
ciphers supported by the PMD. The framework is introduced to avoid
testing with any specific algo, thereby making it mandatory to be
supported. Also, testing with all supported combinations will help with
increasing coverage as well.

The tests would first do IPsec encapsulation and do sanity checks. Based
on flags, packet would be updated or additional checks are done,
followed by IPsec decapsulation. Since the encrypted packet is generated
by the test, known vectors are not required.

Signed-off-by: Anoob Joseph <anoobj@marvell.com>
Signed-off-by: Tejasree Kondoj <ktejasree@marvell.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
Acked-by: Ciara Power <ciara.power@intel.com>
3 years agotest/crypto: add lookaside IPsec cases
Anoob Joseph [Sat, 25 Sep 2021 15:35:28 +0000 (21:05 +0530)]
test/crypto: add lookaside IPsec cases

Added test case for lookaside IPsec. Inbound known vector
tests are added.

Cipher list: AES-GCM 128, 192 & 256

Signed-off-by: Anoob Joseph <anoobj@marvell.com>
Signed-off-by: Tejasree Kondoj <ktejasree@marvell.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
Acked-by: Ciara Power <ciara.power@intel.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
3 years agotest/compress: fix buffer overflow
Rebecca Troy [Fri, 17 Sep 2021 15:12:07 +0000 (15:12 +0000)]
test/compress: fix buffer overflow

Fixes stack buffer overflow bug in compressdev autotest, which
was caused by the use of buf_idx in the debug logs. Originally, buf_idx
was treated as an array instead of the reference of an integer.
This was fixed by replacing the use of buf_idx[priv_data->orig_idx] with
the variable i.

Fixes: 466a2c4bb5f4 ("test/compress: improve debug logs")
Fixes: 6bbc5a923625 ("test/compress: refactor unit tests")
Cc: stable@dpdk.org
Signed-off-by: Rebecca Troy <rebecca.troy@intel.com>
Acked-by: Fan Zhang <roy.fan.zhang@intel.com>
3 years agocrypto/mlx5: fix indirect mkey cleaning
Michael Baum [Mon, 13 Sep 2021 19:16:46 +0000 (22:16 +0300)]
crypto/mlx5: fix indirect mkey cleaning

The driver creates an indirect mkey per entry in the queue to manage the
crypto operation using the BSF fields.

The indirect mkeys were never released neither while error occurs in the
creation phase nor when the queue is released.

Clean the indirect mkeys in the above cases.

Fixes: c2a42d19d967 ("crypto/mlx5: add WQE set initialization")
Cc: stable@dpdk.org
Signed-off-by: Michael Baum <michaelba@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
3 years agocrypto/mlx5: fix queue indexing
Tal Shnaiderman [Mon, 13 Sep 2021 14:02:24 +0000 (17:02 +0300)]
crypto/mlx5: fix queue indexing

The crypto QP consumer (ci) and producer (pi) indexes are increased
with each successful enqueue/dequeue operations.

However the QP pi index is calculated with a wraparound the number
of elements while the QP ci does not.

This is causing incorrect engine calculation for encqueued WQ values
(wq->pi - wq->ci) and eventually the device stops accepting new enqueue
operations.

Fixed by removing the wraparound on QP pi and using a temp calculation
where wraparound values are needed.

Fixes: 8e196c08ab53 ("crypto/mlx5: support enqueue/dequeue operations")
Cc: stable@dpdk.org
Signed-off-by: Tal Shnaiderman <talshn@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
3 years agocommon/cpt: rework pending queue
David George [Fri, 24 Sep 2021 11:20:36 +0000 (16:50 +0530)]
common/cpt: rework pending queue

Replace pending queue with one that allows concurrent single producer and
single consumer. This relaxes the restriction of only allowing a single
lcore to operate on a given queue pair.

Signed-off-by: David George <david.george@sophos.com>
Signed-off-by: Anoob Joseph <anoobj@marvell.com>
3 years agoexamples/ipsec-secgw: fix parsing of flow queue
Anoob Joseph [Thu, 16 Sep 2021 06:07:51 +0000 (11:37 +0530)]
examples/ipsec-secgw: fix parsing of flow queue

Documentation specifies that flow port & queue is provided as,

<...> port 0 queue 0

But code is expecting the same as,

<...> port 0 0

Fix the above to match documentation.

Fixes: 8e693616fcb2 ("examples/ipsec-secgw: enable flow based distribution")
Cc: stable@dpdk.org
Signed-off-by: Anoob Joseph <anoobj@marvell.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
3 years agotest/crypto-perf: test asymmetric crypto throughput
Kiran Kumar K [Thu, 16 Sep 2021 08:38:38 +0000 (14:08 +0530)]
test/crypto-perf: test asymmetric crypto throughput

Added support for asymmetric crypto perf throughput test.
Only modex is supported for now.

One new optype has been added.
--optype modex

./dpdk-test-crypto-perf -c 0x3 -- --devtype crypto_cn9k --optype modex
 --ptest throughput

Signed-off-by: Kiran Kumar K <kirankumark@marvell.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
3 years agotest/crypto: fix PDCP short MAC-I case
Fan Zhang [Thu, 16 Sep 2021 13:02:42 +0000 (14:02 +0100)]
test/crypto: fix PDCP short MAC-I case

This patch fixes the PDCP short MAC-I test by removing them
from snow3g and kasumi test suite and move to PDCP test suite.
This is to prevent incorrect failure for crypto device not
support PDCP.

Fixes: c24489e479fd ("test/crypto: support PDCP short MAC-I")

Signed-off-by: Fan Zhang <roy.fan.zhang@intel.com>
Acked-by: Anoob Joseph <anoobj@marvell.com>
3 years agoexamples/ipsec-secgw: update event mode inline path
Nithin Dabilpuram [Wed, 15 Sep 2021 16:30:01 +0000 (22:00 +0530)]
examples/ipsec-secgw: update event mode inline path

Update mbuf.l2_len with L2 header size for outbound
inline processing.

This patch also fixes a bug in arg parsing.

Signed-off-by: Nithin Dabilpuram <ndabilpuram@marvell.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
3 years agosecurity: add option for faster user/meta data access
Nithin Dabilpuram [Wed, 15 Sep 2021 16:30:00 +0000 (22:00 +0530)]
security: add option for faster user/meta data access

Currently rte_security_set_pkt_metadata() and rte_security_get_userdata()
methods to set pkt metadata on Inline outbound and get userdata
after Inline inbound processing is always driver specific callbacks.

For drivers that do not have much to do in the callbacks but just
to update metadata in rte_security dynamic field and get userdata
from rte_security dynamic field, having to just to PMD specific
callback is costly per packet operation. This patch provides
a mechanism to do the same in inline function and avoid function
pointer jump if a driver supports the same.

Signed-off-by: Nithin Dabilpuram <ndabilpuram@marvell.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
3 years agombuf: enforce semantics for Tx inline IPsec processing
Nithin Dabilpuram [Wed, 15 Sep 2021 16:29:59 +0000 (21:59 +0530)]
mbuf: enforce semantics for Tx inline IPsec processing

Not all net PMD's/HW can parse packet and identify L2 header and
L3 header locations on Tx. This is inline with other Tx offloads
requirements such as L3 checksum, L4 checksum offload, etc,
where mbuf.l2_len, mbuf.l3_len etc, needs to be set for HW to be
able to generate checksum. Since Inline IPsec is also such a Tx
offload, some PMD's at least need mbuf.l2_len to be valid to
find L3 header and perform Outbound IPSec processing.

Hence, this patch updates documentation to enforce setting
mbuf.l2_len while setting PKT_TX_SEC_OFFLOAD in mbuf.ol_flags
for Inline IPsec Crypto / Protocol offload processing to
work on Tx.

Signed-off-by: Nithin Dabilpuram <ndabilpuram@marvell.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
3 years agoeal: add macro to swap two variables
Shijith Thotton [Wed, 28 Jul 2021 15:21:42 +0000 (20:51 +0530)]
eal: add macro to swap two variables

Add a macro to swap two variables
and updat common autotest for the same.

Signed-off-by: Shijith Thotton <sthotton@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
3 years agostack: fix reload head when pop fails
Julien Meunier [Tue, 21 Sep 2021 16:17:24 +0000 (18:17 +0200)]
stack: fix reload head when pop fails

The previous commit 18effad9cfa7 ("stack: reload head when pop fails")
only changed C11 implementation, not generic implementation.

List head must be loaded right before continue (when failed to find the
new head). Without this, one thread might keep trying and failing to pop
items without ever loading the new correct head.

Fixes: 3340202f5954 ("stack: add lock-free implementation")
Cc: stable@dpdk.org
Signed-off-by: Julien Meunier <julien.meunier@nokia.com>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
3 years agovdpa/mlx5: fix large VM memory region registration
Xueming Li [Thu, 23 Sep 2021 08:11:22 +0000 (16:11 +0800)]
vdpa/mlx5: fix large VM memory region registration

When VM size is larger than 4G (u32) and memory region is larger than 4G,
the 32-bit GCD function overflowed and returned wrong value
that resulted in memory registration failure.

This patch calls 64-bit GCD function to avoid overflow.

Fixes: cc07a42da250 ("vdpa/mlx5: prepare memory regions")
Cc: stable@dpdk.org
Signed-off-by: Xueming Li <xuemingl@nvidia.com>
Reviewed-by: Matan Azrad <matan@nvidia.com>
3 years agosched: get 64-bit greatest common divisor
Xueming Li [Thu, 23 Sep 2021 08:11:21 +0000 (16:11 +0800)]
sched: get 64-bit greatest common divisor

This patch adds new function that compute the greatest common
divisor of 64 bits, also changes the original 32 bits function
to call this new 64-bit version.

Cc: stable@dpdk.org
Signed-off-by: Xueming Li <xuemingl@nvidia.com>
Acked-by: Kevin Traynor <ktraynor@redhat.com>
3 years agopipeline: improve handling of learner action arguments
Cristian Dumitrescu [Tue, 14 Sep 2021 19:00:05 +0000 (20:00 +0100)]
pipeline: improve handling of learner action arguments

The arguments of actions that are learned are now specified as part of
the learn instruction as opposed to being statically specified as part
of the learner table configuration.

Signed-off-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
3 years agopipeline: enable pipeline compilation
Cristian Dumitrescu [Mon, 13 Sep 2021 16:44:43 +0000 (17:44 +0100)]
pipeline: enable pipeline compilation

Commit the pipeline changes when the compilation process is
successful: change the table lookup instructions to execute the action
function for each action, replace the regular pipeline instructions
with the custom instructions.

Signed-off-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
3 years agopipeline: build shared object for pipeline
Cristian Dumitrescu [Mon, 13 Sep 2021 16:44:42 +0000 (17:44 +0100)]
pipeline: build shared object for pipeline

Build the generated C file into a shared object library.

Signed-off-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
Signed-off-by: Cunming Liang <cunming.liang@intel.com>
3 years agopipeline: generate custom instruction functions
Cristian Dumitrescu [Mon, 13 Sep 2021 16:44:41 +0000 (17:44 +0100)]
pipeline: generate custom instruction functions

Generate a C function for each custom instruction, which essentially
consolidate multiple regular instructions into a single function call.
The pipeline program is split into groups of instructions, and a
custom instruction is generated for each group that has more than one
instruction. Special care is taken the instructions that can do thread
yield (RX, extern) and for those that can change the instruction
pointer (TX, near/far jump).

Signed-off-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
3 years agopipeline: generate action functions
Cristian Dumitrescu [Mon, 13 Sep 2021 16:44:40 +0000 (17:44 +0100)]
pipeline: generate action functions

Generate a C function for each action. For most instructions, the
associated inline function is called directly. Special care is taken
for TX, jump and return instructions.

Signed-off-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
3 years agopipeline: export pipeline instructions to file
Cristian Dumitrescu [Mon, 13 Sep 2021 16:44:39 +0000 (17:44 +0100)]
pipeline: export pipeline instructions to file

Export the array of translated instructions to a C file. There is one
such array per action and one for the pipeline.

Signed-off-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
3 years agopipeline: introduce pipeline compilation
Cristian Dumitrescu [Mon, 13 Sep 2021 16:44:38 +0000 (17:44 +0100)]
pipeline: introduce pipeline compilation

Lay the foundation to generate C code for the pipeline: C functions
for actions and custom instructions are generated, built as shared
object library and loaded into the pipeline.

Signed-off-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
3 years agopipeline: introduce custom instructions
Cristian Dumitrescu [Mon, 13 Sep 2021 16:44:37 +0000 (17:44 +0100)]
pipeline: introduce custom instructions

For better performance, the option to create custom instructions when
the program is translated and add them on-the-fly to the pipeline is
now provided. Multiple regular instructions can now be consolidated
into a single C function optimized by the C compiler directly.

Signed-off-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
3 years agopipeline: introduce action functions
Cristian Dumitrescu [Mon, 13 Sep 2021 16:44:36 +0000 (17:44 +0100)]
pipeline: introduce action functions

For better performance, the option to run a single function per action
is now provided, which requires a single function call per action that
can be better optimized by the C compiler, as opposed to one function
call per instruction. Special table lookup instructions are added to
to support this feature.

Signed-off-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
3 years agopipeline: enable persistent instruction meta-data
Cristian Dumitrescu [Mon, 13 Sep 2021 16:44:35 +0000 (17:44 +0100)]
pipeline: enable persistent instruction meta-data

Save the instruction meta-data for later use instead of freeing it up
once the instruction translation is completed.

Signed-off-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
3 years agopipeline: create inline functions for instruction operands
Cristian Dumitrescu [Mon, 13 Sep 2021 16:44:34 +0000 (17:44 +0100)]
pipeline: create inline functions for instruction operands

Create inline functions to get the instruction operands.

Signed-off-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>