[PATCH net-next 0/8] Adding Sparx5 ES2 VCAP support

From: Steen Hegelund
Date: Fri Jan 27 2023 - 08:09:44 EST


This provides the Egress Stage 2 (ES2) VCAP (Versatile Content-Aware
Processor) support for the Sparx5 platform.

The ES2 VCAP is an Egress Access Control VCAP that uses frame keyfields and
previously classified keyfields to apply e.g. policing, trapping or
mirroring to frames.

The ES2 VCAP has 2 lookups and they are accessible with a TC chain id:

- chain 20000000: ES2 Lookup 0
- chain 20100000: ES2 Lookup 1

As the other Sparx5 VCAPs the ES2 VCAP has its own lookup/port keyset
configuration that decides which keys will be used for matching on which
traffic type.

The ES2 VCAP has these traffic classifications:

- IPv4 frames
- IPv6 frames
- Other frames

The ES2 VCAP can match on an ISDX key (Ingress Service Index) as one of the
frame metadata keyfields. The IS0 VCAP can update this key using its
actions, and this allows a IS0 VCAP rule to be linked to an ES2 rule.

This is similar to how the IS0 VCAP and the IS2 VCAP use the PAG
(Policy Association Group) keyfield to link rules.

>From user space this is exposed via "chain offsets", so an IS0 rule with a
"goto chain 20000015" action will use an ISDX key value of 15 to link to a
rule in the ES2 VCAP attached to the same chain id.

Steen Hegelund (8):
net: microchip: sparx5: Add support for getting keysets without a type
id
net: microchip: sparx5: Improve the IP frame key match for IPv6 frames
net: microchip: sparx5: Improve error message when parsing CVLAN
filter
net: microchip: sparx5: Add ES2 VCAP model and updated KUNIT VCAP
model
net: microchip: sparx5: Add ES2 VCAP keyset configuration for Sparx5
net: microchip: sparx5: Add ingress information to VCAP instance
net: microchip: sparx5: Add TC support for the ES2 VCAP
net: microchip: sparx5: Add KUNIT tests for enabling/disabling chains

.../ethernet/microchip/lan966x/lan966x_main.h | 3 +-
.../ethernet/microchip/lan966x/lan966x_tc.c | 2 +-
.../microchip/lan966x/lan966x_tc_flower.c | 16 +-
.../microchip/lan966x/lan966x_vcap_impl.c | 3 +
.../ethernet/microchip/sparx5/sparx5_main.c | 1 +
.../microchip/sparx5/sparx5_main_regs.h | 227 +++-
.../microchip/sparx5/sparx5_tc_flower.c | 57 +-
.../microchip/sparx5/sparx5_vcap_ag_api.c | 1166 ++++++++++++++++-
.../microchip/sparx5/sparx5_vcap_debugfs.c | 117 ++
.../microchip/sparx5/sparx5_vcap_impl.c | 786 +++++++++--
.../microchip/sparx5/sparx5_vcap_impl.h | 34 +
.../net/ethernet/microchip/vcap/vcap_ag_api.h | 11 +-
.../net/ethernet/microchip/vcap/vcap_api.c | 36 +-
.../net/ethernet/microchip/vcap/vcap_api.h | 1 +
.../ethernet/microchip/vcap/vcap_api_client.h | 2 +-
.../microchip/vcap/vcap_api_debugfs.c | 6 +-
.../microchip/vcap/vcap_api_debugfs_kunit.c | 4 +
.../ethernet/microchip/vcap/vcap_api_kunit.c | 66 +
.../microchip/vcap/vcap_model_kunit.c | 14 +-
19 files changed, 2390 insertions(+), 162 deletions(-)

--
2.39.1