net: microchip: sparx5: Add support for IS2 VCAP rule counters
authorSteen Hegelund <steen.hegelund@microchip.com>
Fri, 11 Nov 2022 13:05:17 +0000 (14:05 +0100)
committerDavid S. Miller <davem@davemloft.net>
Mon, 14 Nov 2022 11:24:17 +0000 (11:24 +0000)
commitf13230a474774f2b38dab61eb22b3e494d9f5dc7
treec6aad7d7f41fc8fbaa818d7af797fd5724f70bce
parent990e483981ea739b1064eadc426d986ab8880169
net: microchip: sparx5: Add support for IS2 VCAP rule counters

This adds API methods to set and get a rule counter.

A VCAP instance may contain the counter as part of the VCAP cache area, and
this counter may be one or more bits in width.  This type of counter
automatically increments it value when the rule is hit.

Other VCAP instances have a dedicated counter area outside of the VCAP and
in this case the rule must contain the counter id to be able to locate the
counter value.  In this case there must also be a rule action that updates
the counter using the rule id when the rule is hit.

The Sparx5 IS2 VCAP uses a dedicated counter area.

Signed-off-by: Steen Hegelund <steen.hegelund@microchip.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