[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Y+oZHpMpW6ODQQpY@kadam>
Date: Mon, 13 Feb 2023 14:03:58 +0300
From: Dan Carpenter <error27@...il.com>
To: Steen Hegelund <steen.hegelund@...rochip.com>
Cc: "David S . Miller" <davem@...emloft.net>,
Eric Dumazet <edumazet@...gle.com>,
Jakub Kicinski <kuba@...nel.org>,
Paolo Abeni <pabeni@...hat.com>, UNGLinuxDriver@...rochip.com,
Randy Dunlap <rdunlap@...radead.org>,
Casper Andersson <casper.casan@...il.com>,
Russell King <rmk+kernel@...linux.org.uk>,
Wan Jiabing <wanjiabing@...o.com>,
Nathan Huckleberry <nhuck@...gle.com>,
linux-kernel@...r.kernel.org, netdev@...r.kernel.org,
linux-arm-kernel@...ts.infradead.org,
Daniel Machon <daniel.machon@...rochip.com>,
Horatiu Vultur <horatiu.vultur@...rochip.com>,
Lars Povlsen <lars.povlsen@...rochip.com>,
Michael Walle <michael@...le.cc>
Subject: Re: [PATCH net-next 10/10] net: microchip: sparx5: Add TC vlan
action support for the ES0 VCAP
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
Powered by blists - more mailing lists