Messages in this thread | | | From | Po Liu <> | Subject | RE: [EXT] Re: [ v2,net-next 4/4] net: enetc: add tc flower psfp offload driver | Date | Sun, 19 Apr 2020 01:44:23 +0000 |
| |
Hi Vladimir,
> -----Original Message----- > From: Vladimir Oltean <olteanv@gmail.com> > Sent: 2020年4月19日 6:53 > To: Po Liu <po.liu@nxp.com> > Cc: David S. Miller <davem@davemloft.net>; lkml <linux- > kernel@vger.kernel.org>; netdev <netdev@vger.kernel.org>; Vinicius Costa > Gomes <vinicius.gomes@intel.com>; Claudiu Manoil > <claudiu.manoil@nxp.com>; Vladimir Oltean <vladimir.oltean@nxp.com>; > Alexandru Marginean <alexandru.marginean@nxp.com>; > michael.chan@broadcom.com; vishal@chelsio.com; > saeedm@mellanox.com; leon@kernel.org; Jiri Pirko <jiri@mellanox.com>; > Ido Schimmel <idosch@mellanox.com>; Alexandre Belloni > <alexandre.belloni@bootlin.com>; Microchip Linux Driver Support > <UNGLinuxDriver@microchip.com>; Jakub Kicinski <kuba@kernel.org>; > Jamal Hadi Salim <jhs@mojatatu.com>; Cong Wang > <xiyou.wangcong@gmail.com>; simon.horman@netronome.com; > pablo@netfilter.org; moshe@mellanox.com; Murali Karicheri <m- > karicheri2@ti.com>; Andre Guedes <andre.guedes@linux.intel.com>; > Stephen Hemminger <stephen@networkplumber.org> > 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@nxp.com> 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
| |