dpdk.git
2 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>
2 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>
2 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>
2 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>
2 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>
2 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>
2 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>
2 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>
2 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>
2 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>
2 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>
2 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>
2 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>
2 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>
2 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>
2 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>
2 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>
2 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>
2 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>
2 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>
2 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>
2 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>
2 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>
2 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>
2 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>
2 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>
2 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>
2 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>
2 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>
2 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>
2 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>
2 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>
2 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>
2 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>
2 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>
2 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>
2 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>
2 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>
2 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>
2 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>
2 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>
2 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>
2 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>
2 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>
2 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>
2 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>
2 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>
2 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>
2 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>
2 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>
2 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>
2 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>
2 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>
2 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>
2 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>
2 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>
2 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>
2 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>
2 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>
2 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>
2 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>
2 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>
2 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>
2 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>
2 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>
2 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>
2 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>
2 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>
2 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>
2 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>
2 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>
2 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>
2 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>
2 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>
2 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>
2 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>
2 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>
2 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>
2 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>
2 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>
2 years agopipeline: create inline functions for meter instructions
Cristian Dumitrescu [Mon, 13 Sep 2021 16:44:33 +0000 (17:44 +0100)]
pipeline: create inline functions for meter instructions

Create inline functions for the meter instructions.

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

Create inline functions for the register instructions.

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

Create inline functions for the ALU instructions.

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

Create inline functions for the DMA instruction.

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

Create inline functions for the move instruction.

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

Create inline functions for the extern instruction.

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

Create inline functions for the learn and forget instructions.

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

Create inline functions for the validate and invalidate instructions.

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

Create inline functions for the emit instruction.

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

Create inline functions for the extract instruction.

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

Create inline functions for the Tx instruction.

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

Create inline functions for the Rx instruction.

Signed-off-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
2 years agopipeline: move thread inline functions to header file
Cristian Dumitrescu [Mon, 13 Sep 2021 16:44:21 +0000 (17:44 +0100)]
pipeline: move thread inline functions to header file

Move the thread inline functions to the internal header file.

Signed-off-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
2 years agopipeline: move data structures to internal header file
Cristian Dumitrescu [Mon, 13 Sep 2021 16:44:20 +0000 (17:44 +0100)]
pipeline: move data structures to internal header file

Start to consolidate the data structures and inline functions required
by the pipeline instructions into an internal header file.

Signed-off-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
2 years agoexamples/pipeline: add learner table example
Cristian Dumitrescu [Mon, 20 Sep 2021 15:01:33 +0000 (16:01 +0100)]
examples/pipeline: add learner table example

Added the files to illustrate the learner table usage.

Signed-off-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
2 years agoexamples/pipeline: support learner tables
Cristian Dumitrescu [Mon, 20 Sep 2021 15:01:32 +0000 (16:01 +0100)]
examples/pipeline: support learner tables

Add application-level support for learner tables.

Signed-off-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
2 years agopipeline: support learner tables
Cristian Dumitrescu [Mon, 20 Sep 2021 15:01:31 +0000 (16:01 +0100)]
pipeline: support learner tables

Add pipeline level support for learner tables.

Signed-off-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
2 years agotable: support learner tables
Cristian Dumitrescu [Mon, 20 Sep 2021 15:01:30 +0000 (16:01 +0100)]
table: support learner tables

A learner table is typically used for learning or connection tracking,
where it allows for the implementation of the "add on miss" scenario:
whenever the lookup key is not found in the table (lookup miss), the
data plane can decide to add this key to the table with a given action
with no control plane intervention. Likewise, the table keys expire
based on a configurable timeout and are automatically deleted from the
table with no control plane intervention.

Signed-off-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
2 years agoexamples/pipeline: add variable size headers
Cristian Dumitrescu [Tue, 27 Jul 2021 17:43:40 +0000 (18:43 +0100)]
examples/pipeline: add variable size headers

Added the files to illustrate the variable size header usage.

Signed-off-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
2 years agopipeline: add header look-ahead instruction
Cristian Dumitrescu [Tue, 27 Jul 2021 17:43:39 +0000 (18:43 +0100)]
pipeline: add header look-ahead instruction

Added look-ahead instruction to read a header from the input packet
without advancing the extraction pointer. This is typically used in
correlation with the special extract instruction to extract variable
size headers from the input packet: the first few header fields are
read without advancing the extraction pointer, just enough to detect
the actual length of the header (e.g. IPv4 IHL field); then the full
header is extracted.

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