net: microchip: sparx5: Adding port keyset config and callback interface
authorSteen Hegelund <steen.hegelund@microchip.com>
Thu, 20 Oct 2022 13:09:00 +0000 (15:09 +0200)
committerDavid S. Miller <davem@davemloft.net>
Mon, 24 Oct 2022 09:37:43 +0000 (10:37 +0100)
commit46be056ee0fc516b7591d549dd5fbb1e93df9c7e
treea1f52c3976732f8390b6d0b97ced510c81f5c48a
parentc9da1ac1c21222ad04e78347a02b3ced393d1fb8
net: microchip: sparx5: Adding port keyset config and callback interface

This provides a default port keyset configuration for the Sparx5 IS2 VCAP
where all ports and all lookups in IS2 use the same keyset (MAC_ETYPE) for
all types of traffic.

This means that no matter what frame type is received on any front port it
will generate the MAC_ETYPE keyset in the IS VCAP and any rule in the IS2
VCAP that uses this keyset will be matched against the keys in the
MAC_ETYPE keyset.

The callback interface used by the VCAP API is populated with Sparx5
specific handler functions that takes care of the actual reading and
writing to data to the Sparx5 IS2 VCAP instance.

A few functions are also added to the VCAP API to support addition of rule
fields such as the ingress port mask and the lookup bit.

The IS2 VCAP in Sparx5 is really divided in two instances with lookup 0
and 1 in the first instance and lookup 2 and 3 in the second instance.
The lookup bit selects lookup 0 or 3 in the respective instance when it is
set.

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/sparx5/sparx5_vcap_impl.c
drivers/net/ethernet/microchip/vcap/vcap_api.c
drivers/net/ethernet/microchip/vcap/vcap_api_client.h