OSDN Git Service

net: microchip: sparx5: Adding basic rule management in VCAP API
authorSteen Hegelund <steen.hegelund@microchip.com>
Thu, 20 Oct 2022 13:09:01 +0000 (15:09 +0200)
committerDavid S. Miller <davem@davemloft.net>
Mon, 24 Oct 2022 09:37:43 +0000 (10:37 +0100)
commit8e10490b006477c42874d43a2ab4d4c6d51ccb63
tree36c5b8376f39f60876d8f83b36eda1e8eee89a34
parent46be056ee0fc516b7591d549dd5fbb1e93df9c7e
net: microchip: sparx5: Adding basic rule management in VCAP API

This provides most of the rule handling needed to add a new rule to a VCAP.
To add a rule a client must follow these steps:

1) Allocate a new rule (provide an id or get one automatically assigned)
2) Add keys to the rule
3) Add actions to the rule
4) Optionally set a keyset on the rule
5) Optionally set an actionset on the rule
6) Validate the rule (this will add keyset and actionset if not specified
   in the previous steps)
7) Add the rule (if the validation was successful)
8) Free the rule instance (a copy has been added to the VCAP)

The validation step will fail if there are no keysets with the requested
keys, or there are no actionsets with the requested actions.
The validation will also fail if the keyset is not configured for the port
for the requested protocol).

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