Re: [PATCH net-next v2 4/9] net: microchip: sparx5: Adding initial tc flower support for VCAP API

From: Steen Hegelund
Date: Thu Oct 20 2022 - 05:09:14 EST


Hi Casper,

On Thu, 2022-10-20 at 09:31 +0200, Casper Andersson wrote:
> EXTERNAL EMAIL: Do not click links or open attachments unless you know the content is safe
>
> 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.

Really good that you could find time to do this!

>
> 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.

Yes this is not Sparx5 specific so it could be added to the API (where the enums are defined
anyway).

>
> Tested-by: Casper Andersson <casper.casan@xxxxxxxxx>
> Reviewed-by: Casper Andersson <casper.casan@xxxxxxxxx>
>

Thanks for the review.

BR
Steen