[net-next,v4,0/8] Add support for two classes of VCAP rules

Message ID 20230114134242.3737446-1-steen.hegelund@microchip.com
Headers
Series Add support for two classes of VCAP rules |

Message

Steen Hegelund Jan. 14, 2023, 1:42 p.m. UTC
  This adds support for two classes of VCAP rules:

- Permanent rules (added e.g. for PTP support)
- TC user rules (added by the TC userspace tool)

For this to work the VCAP Loopups must be enabled from boot, so that the
"internal" clients like PTP can add rules that are always active.

When the TC tool add a flower filter the VCAP rule corresponding to this
filter will be disabled (kept in memory) until a TC matchall filter creates
a link from chain 0 to the chain (lookup) where the flower filter was
added.

When the flower filter is enabled it will be written to the appropriate
VCAP lookup and become active in HW.

Likewise the flower filter will be disabled if there is no link from chain
0 to the chain of the filter (lookup), and when that happens the
corresponding VCAP rule will be read from the VCAP instance and stored in
memory until it is deleted or enabled again.

Version History:
================
v4      Removed a leftover 'Fixes' tag from v2.  No functional changes.

v3      Removed the change that allowed rules to always be added in the
        LAN996x even though the lookups are not enabled (Horatiu Vultur).
        This was sent separately to net instead.

        Removed the 'Fixes' tags due to the patch sent to net by Horatiu
        Vultur.

        Added a check for validity of the chain source when enabling a
        lookup.

v2      Adding a missing goto exit in vcap_add_rule (Dan Carpenter).
        Added missing checks for error returns in vcap_enable_rule.

v1      Initial version


Steen Hegelund (8):
  net: microchip: vcap api: Erase VCAP cache before encoding rule
  net: microchip: sparx5: Reset VCAP counter for new rules
  net: microchip: vcap api: Always enable VCAP lookups
  net: microchip: vcap api: Convert multi-word keys/actions when
    encoding
  net: microchip: vcap api: Use src and dst chain id to chain VCAP
    lookups
  net: microchip: vcap api: Check chains when adding a tc flower filter
  net: microchip: vcap api: Add a storage state to a VCAP rule
  net: microchip: vcap api: Enable/Disable rules via chains in VCAP HW

 .../ethernet/microchip/lan966x/lan966x_goto.c |  10 +-
 .../ethernet/microchip/lan966x/lan966x_main.h |   3 +-
 .../microchip/lan966x/lan966x_tc_flower.c     |  30 +-
 .../microchip/lan966x/lan966x_tc_matchall.c   |  16 +-
 .../microchip/lan966x/lan966x_vcap_impl.c     |  21 +-
 .../microchip/sparx5/sparx5_tc_flower.c       |  28 +-
 .../microchip/sparx5/sparx5_tc_matchall.c     |  16 +-
 .../microchip/sparx5/sparx5_vcap_debugfs.c    |   2 +-
 .../microchip/sparx5/sparx5_vcap_impl.c       |  29 +-
 .../net/ethernet/microchip/vcap/vcap_api.c    | 767 +++++++++++++-----
 .../net/ethernet/microchip/vcap/vcap_api.h    |   5 -
 .../ethernet/microchip/vcap/vcap_api_client.h |   8 +-
 .../microchip/vcap/vcap_api_debugfs.c         |  57 +-
 .../microchip/vcap/vcap_api_debugfs_kunit.c   |  10 +-
 .../ethernet/microchip/vcap/vcap_api_kunit.c  |  32 +-
 .../microchip/vcap/vcap_api_private.h         |  12 +-
 16 files changed, 699 insertions(+), 347 deletions(-)
  

Comments

patchwork-bot+netdevbpf@kernel.org Jan. 16, 2023, 1:50 p.m. UTC | #1
Hello:

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

On Sat, 14 Jan 2023 14:42:34 +0100 you wrote:
> This adds support for two classes of VCAP rules:
> 
> - Permanent rules (added e.g. for PTP support)
> - TC user rules (added by the TC userspace tool)
> 
> For this to work the VCAP Loopups must be enabled from boot, so that the
> "internal" clients like PTP can add rules that are always active.
> 
> [...]

Here is the summary with links:
  - [net-next,v4,1/8] net: microchip: vcap api: Erase VCAP cache before encoding rule
    https://git.kernel.org/netdev/net-next/c/6573f71ae72f
  - [net-next,v4,2/8] net: microchip: sparx5: Reset VCAP counter for new rules
    https://git.kernel.org/netdev/net-next/c/95fa74148daa
  - [net-next,v4,3/8] net: microchip: vcap api: Always enable VCAP lookups
    https://git.kernel.org/netdev/net-next/c/01ef75a257fa
  - [net-next,v4,4/8] net: microchip: vcap api: Convert multi-word keys/actions when encoding
    https://git.kernel.org/netdev/net-next/c/33e3a273fd4f
  - [net-next,v4,5/8] net: microchip: vcap api: Use src and dst chain id to chain VCAP lookups
    https://git.kernel.org/netdev/net-next/c/cfd9e7b74a1e
  - [net-next,v4,6/8] net: microchip: vcap api: Check chains when adding a tc flower filter
    https://git.kernel.org/netdev/net-next/c/784c3067d094
  - [net-next,v4,7/8] net: microchip: vcap api: Add a storage state to a VCAP rule
    https://git.kernel.org/netdev/net-next/c/814e7693207f
  - [net-next,v4,8/8] net: microchip: vcap api: Enable/Disable rules via chains in VCAP HW
    https://git.kernel.org/netdev/net-next/c/18a15c769d4a

You are awesome, thank you!