Re: [PATCH net-next v2 4/9] net: microchip: sparx5: Adding initial tc flower support for VCAP API
From: Casper Andersson
Date: Thu Oct 20 2022 - 03:31:47 EST
Hi Steen,
It's a pretty big patch series, but overall I think it looks very good.
I've got some minor comments. I also tested it on the Microchip PCB135
switch and it works as described.
On 2022-10-19 13:42, Steen Hegelund wrote:
> +static void sparx5_tc_flower_set_exterr(struct net_device *ndev,
> + struct flow_cls_offload *fco,
> + struct vcap_rule *vrule)
> +{
> + switch (vrule->exterr) {
> + case VCAP_ERR_NONE:
> + break;
> + case VCAP_ERR_NO_ADMIN:
> + NL_SET_ERR_MSG_MOD(fco->common.extack,
> + "Missing VCAP instance");
> + break;
> + case VCAP_ERR_NO_NETDEV:
> + NL_SET_ERR_MSG_MOD(fco->common.extack,
> + "Missing network interface");
> + break;
> + case VCAP_ERR_NO_KEYSET_MATCH:
> + NL_SET_ERR_MSG_MOD(fco->common.extack,
> + "No keyset matched the filter keys");
> + break;
> + case VCAP_ERR_NO_ACTIONSET_MATCH:
> + NL_SET_ERR_MSG_MOD(fco->common.extack,
> + "No actionset matched the filter actions");
> + break;
> + case VCAP_ERR_NO_PORT_KEYSET_MATCH:
> + NL_SET_ERR_MSG_MOD(fco->common.extack,
> + "No port keyset matched the filter keys");
> + break;
> + }
> +}
Could this also be shared in the VCAP API? It currently doesn't use
anything Sparx5 specific. Though, net_device is unused so I'm guessing
you might have plans for this in the future. And it might fit better
here according to your design goals.
Tested-by: Casper Andersson <casper.casan@xxxxxxxxx>
Reviewed-by: Casper Andersson <casper.casan@xxxxxxxxx>