RE: [EXT] Re: [ v2,net-next 4/4] net: enetc: add tc flower psfp offload driver

From: Po Liu
Date: Sat Apr 18 2020 - 21:44:33 EST


Hi Vladimir,

> -----Original Message-----
> From: Vladimir Oltean <olteanv@xxxxxxxxx>
> Sent: 2020å4æ19æ 6:53
> To: Po Liu <po.liu@xxxxxxx>
> Cc: David S. Miller <davem@xxxxxxxxxxxxx>; lkml <linux-
> kernel@xxxxxxxxxxxxxxx>; netdev <netdev@xxxxxxxxxxxxxxx>; Vinicius Costa
> Gomes <vinicius.gomes@xxxxxxxxx>; Claudiu Manoil
> <claudiu.manoil@xxxxxxx>; Vladimir Oltean <vladimir.oltean@xxxxxxx>;
> Alexandru Marginean <alexandru.marginean@xxxxxxx>;
> michael.chan@xxxxxxxxxxxx; vishal@xxxxxxxxxxx;
> saeedm@xxxxxxxxxxxx; leon@xxxxxxxxxx; Jiri Pirko <jiri@xxxxxxxxxxxx>;
> Ido Schimmel <idosch@xxxxxxxxxxxx>; Alexandre Belloni
> <alexandre.belloni@xxxxxxxxxxx>; Microchip Linux Driver Support
> <UNGLinuxDriver@xxxxxxxxxxxxx>; Jakub Kicinski <kuba@xxxxxxxxxx>;
> Jamal Hadi Salim <jhs@xxxxxxxxxxxx>; Cong Wang
> <xiyou.wangcong@xxxxxxxxx>; simon.horman@xxxxxxxxxxxxx;
> pablo@xxxxxxxxxxxxx; moshe@xxxxxxxxxxxx; Murali Karicheri <m-
> karicheri2@xxxxxx>; Andre Guedes <andre.guedes@xxxxxxxxxxxxxxx>;
> Stephen Hemminger <stephen@xxxxxxxxxxxxxxxxxx>
> Subject: [EXT] Re: [ v2,net-next 4/4] net: enetc: add tc flower psfp offload
> driver
>
> Caution: EXT Email
>
> Hi Po,
>
> On Sat, 18 Apr 2020 at 04:35, Po Liu <Po.Liu@xxxxxxx> wrote:
> >
> > + if (flow_rule_match_key(rule, FLOW_DISSECTOR_KEY_ETH_ADDRS))
> {
> > + struct flow_match_eth_addrs match;
> > +
> > + flow_rule_match_eth_addrs(rule, &match);
> > +
> > + if (!is_zero_ether_addr(match.mask->dst)) {
>
> Does ENETC support masked matching on MAC address? If not, you should
> error out if the mask is not ff:ff:ff:ff:ff:ff.

I get it. Thanks.

>
> > + ether_addr_copy(filter->sid.dst_mac, match.key->dst);
> > + filter->sid.filtertype = STREAMID_TYPE_NULL;
> > + }
> > +
> > + if (!is_zero_ether_addr(match.mask->src)) {
> > + ether_addr_copy(filter->sid.src_mac, match.key->src);
> > + filter->sid.filtertype = STREAMID_TYPE_SMAC;
> > + }
> > + } else {
> > + NL_SET_ERR_MSG_MOD(extack, "Unsupported, must
> ETH_ADDRS");
> > + return -EINVAL;
> > + }
> > +
> > + if (flow_rule_match_key(rule, FLOW_DISSECTOR_KEY_VLAN)) {
> > + struct flow_match_vlan match;
> > +
> > + flow_rule_match_vlan(rule, &match);
> > + if (match.mask->vlan_priority) {
> > + if (match.mask->vlan_priority !=
> > + (VLAN_PRIO_MASK >> VLAN_PRIO_SHIFT)) {
> > + NL_SET_ERR_MSG_MOD(extack, "Only full mask is
> supported for VLAN priority");
> > + err = -EINVAL;
> > + goto free_filter;
> > + }
> > + }
> > +
> > + if (match.mask->vlan_tpid) {
> > + if (match.mask->vlan_tpid != VLAN_VID_MASK) {
>
> I'm pretty sure that vlan_tpid is the EtherType (0x8100, etc), and
> that you actually meant vlan_id.
>

Yes, I'll correct it.

> > --
> > 2.17.1
> >
>
> Thanks,
> -Vladimir

Br,
Po Liu