[PATCH net-next 10/10] net: microchip: sparx5: Add TC vlan action support for the ES0 VCAP
Steen Hegelund
steen.hegelund at microchip.com
Mon Feb 13 04:50:23 PST 2023
Hi Dan,
On Mon, 2023-02-13 at 14:03 +0300, Dan Carpenter wrote:
> EXTERNAL EMAIL: Do not click links or open attachments unless you know the
> content is safe
>
> On Mon, Feb 13, 2023 at 10:24:26AM +0100, Steen Hegelund wrote:
> > +static int sparx5_tc_action_vlan_modify(struct vcap_admin *admin,
> > + struct vcap_rule *vrule,
> > + struct flow_cls_offload *fco,
> > + struct flow_action_entry *act,
> > + u16 tpid)
> > +{
> > + int err = 0;
> > +
> > + switch (admin->vtype) {
> > + case VCAP_TYPE_ES0:
> > + err = vcap_rule_add_action_u32(vrule,
> > + VCAP_AF_PUSH_OUTER_TAG,
> > + SPX5_OTAG_TAG_A);
>
> This err assignment is never used.
Oops! I will update this.
>
> > + break;
> > + default:
> > + NL_SET_ERR_MSG_MOD(fco->common.extack,
> > + "VLAN modify action not supported in this
> > VCAP");
> > + return -EOPNOTSUPP;
> > + }
> > +
> > + switch (tpid) {
> > + case ETH_P_8021Q:
> > + err = vcap_rule_add_action_u32(vrule,
> > + VCAP_AF_TAG_A_TPID_SEL,
> > + SPX5_TPID_A_8100);
> > + break;
> > + case ETH_P_8021AD:
> > + err = vcap_rule_add_action_u32(vrule,
> > + VCAP_AF_TAG_A_TPID_SEL,
> > + SPX5_TPID_A_88A8);
> > + break;
> > + default:
> > + NL_SET_ERR_MSG_MOD(fco->common.extack,
> > + "Invalid vlan proto");
> > + err = -EINVAL;
> > + }
> > + if (err)
> > + return err;
> > +
> > + err = vcap_rule_add_action_u32(vrule,
> > + VCAP_AF_TAG_A_VID_SEL,
> > + SPX5_VID_A_VAL);
> > + if (err)
> > + return err;
>
> regards,
> dan carpenter
>
Thanks for your comments, as always very helpful.
BR
Steen
More information about the linux-arm-kernel
mailing list