net: microchip: sparx5: Add tc matchall filter and enable VCAP lookups
authorSteen Hegelund <steen.hegelund@microchip.com>
Wed, 9 Nov 2022 11:41:15 +0000 (12:41 +0100)
committerDavid S. Miller <davem@davemloft.net>
Fri, 11 Nov 2022 10:39:12 +0000 (10:39 +0000)
commit67456717012cac9aa952b308f71f0dd023998463
treefa8686a0c0bcba09c3b6203da6f8736ef7153759
parent242df4f7f2cd6d17a445d43852496ad706da344b
net: microchip: sparx5: Add tc matchall filter and enable VCAP lookups

Use a tc matchall rule with a goto action to the VCAP specific chain to
enable the VCAP lookups.
If the matchall rule is removed the VCAP lookups will be disabled
again using its cookie as lookup to find the VCAP instance.

To enable the Sparx5 IS2 VCAP on eth0 you would use this command:

    tc filter add dev eth0 ingress prio 5 handle 5 matchall \
        skip_sw action goto chain 8000000

as the first lookup in IS2 has chain id 8000000

Signed-off-by: Steen Hegelund <steen.hegelund@microchip.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
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_matchall.c [new file with mode: 0644]
drivers/net/ethernet/microchip/sparx5/sparx5_vcap_impl.c
drivers/net/ethernet/microchip/vcap/vcap_api.c
drivers/net/ethernet/microchip/vcap/vcap_api.h
drivers/net/ethernet/microchip/vcap/vcap_api_client.h