[PATCH v6 net-next 5/8] net: dsa: felix: support psfp filter on vsc9959

Xiaoliang Yang xiaoliang.yang_1 at nxp.com
Wed Nov 10 02:43:20 PST 2021


Hi Vladimir,

> -----Original Message-----
> From: Vladimir Oltean <vladimir.oltean at nxp.com>
> Sent: 2021年10月6日 21:13
> To: Xiaoliang Yang <xiaoliang.yang_1 at nxp.com>
> Cc: davem at davemloft.net; linux-kernel at vger.kernel.org;
> netdev at vger.kernel.org; allan.nielsen at microchip.com;
> joergen.andreasen at microchip.com; UNGLinuxDriver at microchip.com;
> vinicius.gomes at intel.com; michael.chan at broadcom.com;
> vishal at chelsio.com; saeedm at mellanox.com; jiri at mellanox.com;
> idosch at mellanox.com; alexandre.belloni at bootlin.com; kuba at kernel.org; Po
> Liu <po.liu at nxp.com>; Leo Li <leoyang.li at nxp.com>; f.fainelli at gmail.com;
> andrew at lunn.ch; vivien.didelot at gmail.com; Claudiu Manoil
> <claudiu.manoil at nxp.com>; linux-mediatek at lists.infradead.org;
> linux-arm-kernel at lists.infradead.org; matthias.bgg at gmail.com;
> horatiu.vultur at microchip.com
> Subject: Re: [PATCH v6 net-next 5/8] net: dsa: felix: support psfp filter on
> vsc9959
> 
> On Thu, Oct 6, 2021 at 21:13:45 +0300, Vladimir Oltean wrote:
> > +static int vsc9959_psfp_filter_add(struct ocelot *ocelot,
> > +				   struct flow_cls_offload *f)
> > +{
> 
> Neither the vsc9959_psfp_filter_add nor vsc9959_psfp_filter_del
> implementations take an "int port" as argument. Therefore, when the SFID is
> programmed in the MAC table, it matches on any ingress port that is in the
> same bridging domain as the port pointed towards by the MAC table (and the
> MAC table selects the _destination_ port).
> 
> Otherwise said, in this setup:
> 
>                      br0
>                    /  |  \
>                   /   |   \
>                  /    |    \
>               swp0   swp1   swp2
> 
> bridge vlan add dev swp0 vid 100
> bridge vlan add dev swp1 vid 100
> bridge vlan add dev swp2 vid 100
> bridge fdb add dev swp2 00:01:02:03:04:05 vlan 100 static master tc filter add
> dev swp0 ingress chain 0 pref 49152 flower \
> 	skip_sw action goto chain 30000
> tc filter add dev swp0 ingress chain 30000 pref 1 \
> 	protocol 802.1Q flower skip_sw \
> 	dst_mac 00:01:02:03:04:05 vlan_id 100 \
> 	action gate base-time 0.000000000 \
> 	sched-entry OPEN  5000000 -1 -1 \
> 	sched-entry CLOSE 5000000 -1 -1
> 
> The "filter" above will match not only on swp0, but also on packets ingressed
> from swp1.
> 
> The hardware provides IGR_SRCPORT_MATCH_ENA and IGR_PORT_MASK bits
> in the Stream Filter RAM (ANA:ANA_TABLES:SFID_MASK). Maybe you could
> program a SFID to match only on the ports on which the user intended?
> 
Yes, you are right. I have tested that use IGR_SRCPORT_MATCH_ENA and IGR_PORT_MASK bits can let a SFID to
match only on the designated ports. But this only can match to two ports for each SFID, two ports use the sfid,
sfid+1 as SFID index. I can try to add it in driver, but it will limit user only to match one or two ports for a same
stream.

Thanks,
Xiaoliang


More information about the linux-arm-kernel mailing list