net: microchip: sparx5: Adding initial tc flower support for VCAP API
authorSteen Hegelund <steen.hegelund@microchip.com>
Thu, 20 Oct 2022 13:08:59 +0000 (15:08 +0200)
committerDavid S. Miller <davem@davemloft.net>
Mon, 24 Oct 2022 09:37:43 +0000 (10:37 +0100)
commitc9da1ac1c21222ad04e78347a02b3ced393d1fb8
tree7d6975e229568ba0529838855fbce119e5f77b37
parent45c00ad0030ce94111a208c116d922c83645fc30
net: microchip: sparx5: Adding initial tc flower support for VCAP API

This adds initial TC flower filter support to Sparx5 for the IS2 VCAP.

The support consists of the source and destination MAC addresses,
and the trap and pass actions.

This is how you can create a rule that test the functionality:

tc qdisc add dev eth0 clsact
tc filter add dev eth0 ingress chain 8000000 prio 10 handle 10 \
      protocol all flower skip_sw \
      dst_mac 0a:0b:0c:0d:0e:0f \
      src_mac 2:0:0:0:0:1 \
      action trap

The IS2 chains in Sparx5 are assigned like this:

- chain 8000000: IS2 Lookup 0
- chain 8100000: IS2 Lookup 1
- chain 8200000: IS2 Lookup 2
- chain 8300000: IS2 Lookup 3

Signed-off-by: Steen Hegelund <steen.hegelund@microchip.com>
Tested-by: Casper Andersson <casper.casan@gmail.com>
Reviewed-by: Casper Andersson <casper.casan@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/microchip/Makefile
drivers/net/ethernet/microchip/sparx5/Makefile
drivers/net/ethernet/microchip/sparx5/sparx5_tc.c
drivers/net/ethernet/microchip/sparx5/sparx5_tc.h
drivers/net/ethernet/microchip/sparx5/sparx5_tc_flower.c [new file with mode: 0644]
drivers/net/ethernet/microchip/sparx5/sparx5_vcap_impl.c
drivers/net/ethernet/microchip/sparx5/sparx5_vcap_impl.h [new file with mode: 0644]
drivers/net/ethernet/microchip/vcap/Makefile [new file with mode: 0644]
drivers/net/ethernet/microchip/vcap/vcap_api.c [new file with mode: 0644]
drivers/net/ethernet/microchip/vcap/vcap_api_client.h [new file with mode: 0644]