mbox series

[net-next,v6,0/8] Extend TC key support for Sparx5 IS2 VCAP

Message ID 20221109114116.3612477-1-steen.hegelund@microchip.com (mailing list archive)
Headers show
Series Extend TC key support for Sparx5 IS2 VCAP | expand

Message

Steen Hegelund Nov. 9, 2022, 11:41 a.m. UTC
This provides extended tc flower filter key support for the Sparx5 VCAP
functionality.

It builds on top of the initial IS2 VCAP support found in this series:

https://lore.kernel.org/all/20221020130904.1215072-1-steen.hegelund@microchip.com/

Overview:
=========

The added flower filter key (dissector) support is this:

- ipv4_addr (sip and dip)
- ipv6_addr (sip and dip)
- control (IPv4 fragments)
- portnum (tcp and udp port numbers)
- basic (L3 and L4 protocol)
- vlan (outer vlan tag info)
- tcp (tcp flags)
- ip (tos field)

The IS2 VCAP supports classified VLAN information which amounts to the
outer VLAN info in case of multiple tags.

Functionality:
==============

Before frames can match IS2 VCAP rules with e.g an IPv4 source address, the
IS2 VCAPs keyset configuration must include keyset that contains a IPv4
source address and this must be configured for the lookup/port/traffic-type
that you want to match on.

The Sparx5 IS2 VCAP has the following traffic types:

- Non-Ethernet frames
- IPv4 Unicast frames
- IPv4 Multicast frames
- IPv6 Unicast frames
- IPv6 Multicast frames
- ARP frames

So to cover IPv4 traffic the two IPv4 categories must be configured with a
keyset that contains IPv4 address information such as the
VCAP_KFS_IP4_TCP_UDP keyset.

The IPv4 and IPv6 traffic types are configured with useful default keysets,
in later series we will use the tc template functionality when we want to
change these defaults.

The flower filter must contain a goto action as its last action and the
chain id must specify the chain id of the next lookup in a VCAP or a
destination outside the VCAP ranges.

To activate the VCAP lookups on a port you must add a TC matchall filter on
the port containing a single goto action that points to the chain id of the
first lookup in the IS2 VCAP.

From then on frames arriving on this port will be matched against the
rules in the IS2 VCAP lookups.

Removing the matchall filter will deactivate the IS2 lookups, but will
leave the VCAP rules in the memory of the VCAP instance, and from then in
frames will no longer be matched against the rules the in IS2 VCAP.

If the matchall rule is added back again the IS2 rules will be active
once more.

Delivery:
=========

This is current plan for delivering the full VCAP feature set of Sparx5:

- TC flower filter statistics and rule order by size and priority
- debugfs support for inspecting rules
- support for TC protocol all
- Sparx5 IS0 VCAP support
- add TC policer and drop action support (depends on the Sparx5 QoS support
  upstreamed separately)
- Sparx5 ES0 VCAP support
- TC flower template support
- TC matchall filter support for mirroring and policing ports
- TC flower filter mirror action support
- Sparx5 ES2 VCAP support


Version History:
================
v6      Rebased on the latest next-next master branch.
        No other implementation changes.

v5      Add support for a TC matchall filter with a single goto action
        which will activate the lookups of the VCAP.  Removing this filter
        will deactivate the VCAP lookups again.

v4      Add support for TC flower filter goto action and a check of the
        actions: check action combinations and the goto chain id.

v3      Add some more details to the explanation in the commit message
        about support for MAC_ETYPE keysets and "protocol all" as well as
        the classified VLAN information.  This is done to help testing the
        feature.
        No implementation changes in this version.

v2      Split one of the KUNIT tests into 3 tests to fix a kernel robot
        build warning.

v1      Initial version

Steen Hegelund (8):
  net: microchip: sparx5: Differentiate IPv4 and IPv6 traffic in keyset
    config
  net: microchip: sparx5: Adding more tc flower keys for the IS2 VCAP
  net: microchip: sparx5: Find VCAP lookup from chain id
  net: microchip: sparx5: Adding TC goto action and action checking
  net: microchip: sparx5: Match keys in configured port keysets
  net: microchip: sparx5: Let VCAP API validate added key- and
    actionfields
  net: microchip: sparx5: Add tc matchall filter and enable VCAP lookups
  net: microchip: sparx5: Adding KUNIT tests of key/action values in
    VCAP API

 .../net/ethernet/microchip/sparx5/Makefile    |   2 +-
 .../net/ethernet/microchip/sparx5/sparx5_tc.c |   9 +-
 .../net/ethernet/microchip/sparx5/sparx5_tc.h |   5 +
 .../microchip/sparx5/sparx5_tc_flower.c       | 480 +++++++++++++-
 .../microchip/sparx5/sparx5_tc_matchall.c     |  97 +++
 .../microchip/sparx5/sparx5_vcap_impl.c       | 197 +++++-
 .../net/ethernet/microchip/vcap/vcap_api.c    | 424 ++++++++++++-
 .../net/ethernet/microchip/vcap/vcap_api.h    |   6 +
 .../ethernet/microchip/vcap/vcap_api_client.h |  21 +
 .../ethernet/microchip/vcap/vcap_api_kunit.c  | 592 ++++++++++++++++++
 10 files changed, 1783 insertions(+), 50 deletions(-)
 create mode 100644 drivers/net/ethernet/microchip/sparx5/sparx5_tc_matchall.c

Comments

patchwork-bot+netdevbpf@kernel.org Nov. 11, 2022, 10:50 a.m. UTC | #1
Hello:

This series was applied to netdev/net-next.git (master)
by David S. Miller <davem@davemloft.net>:

On Wed, 9 Nov 2022 12:41:08 +0100 you wrote:
> This provides extended tc flower filter key support for the Sparx5 VCAP
> functionality.
> 
> It builds on top of the initial IS2 VCAP support found in this series:
> 
> https://lore.kernel.org/all/20221020130904.1215072-1-steen.hegelund@microchip.com/
> 
> [...]

Here is the summary with links:
  - [net-next,v6,1/8] net: microchip: sparx5: Differentiate IPv4 and IPv6 traffic in keyset config
    https://git.kernel.org/netdev/net-next/c/30172a7241f8
  - [net-next,v6,2/8] net: microchip: sparx5: Adding more tc flower keys for the IS2 VCAP
    https://git.kernel.org/netdev/net-next/c/d6c2964db3fe
  - [net-next,v6,3/8] net: microchip: sparx5: Find VCAP lookup from chain id
    https://git.kernel.org/netdev/net-next/c/7de1dcadfaf9
  - [net-next,v6,4/8] net: microchip: sparx5: Adding TC goto action and action checking
    https://git.kernel.org/netdev/net-next/c/392d0ab04827
  - [net-next,v6,5/8] net: microchip: sparx5: Match keys in configured port keysets
    https://git.kernel.org/netdev/net-next/c/abc4010d1f6e
  - [net-next,v6,6/8] net: microchip: sparx5: Let VCAP API validate added key- and actionfields
    https://git.kernel.org/netdev/net-next/c/242df4f7f2cd
  - [net-next,v6,7/8] net: microchip: sparx5: Add tc matchall filter and enable VCAP lookups
    https://git.kernel.org/netdev/net-next/c/67456717012c
  - [net-next,v6,8/8] net: microchip: sparx5: Adding KUNIT tests of key/action values in VCAP API
    https://git.kernel.org/netdev/net-next/c/c956b9b318d9

You are awesome, thank you!