Re: [PATCH net-next 10/10] net: microchip: sparx5: Add TC vlan action support for the ES0 VCAP

From: Dan Carpenter
Date: Mon Feb 13 2023 - 06:04:17 EST


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.

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