lkml.org 
[lkml]   [2021]   [Nov]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRE: [PATCH v6 net-next 5/8] net: dsa: felix: support psfp filter on vsc9959
Date
Hi Vladimir,

> -----Original Message-----
> From: Vladimir Oltean <vladimir.oltean@nxp.com>
> Sent: 2021年10月6日 21:13
> To: Xiaoliang Yang <xiaoliang.yang_1@nxp.com>
> Cc: davem@davemloft.net; linux-kernel@vger.kernel.org;
> netdev@vger.kernel.org; allan.nielsen@microchip.com;
> joergen.andreasen@microchip.com; UNGLinuxDriver@microchip.com;
> vinicius.gomes@intel.com; michael.chan@broadcom.com;
> vishal@chelsio.com; saeedm@mellanox.com; jiri@mellanox.com;
> idosch@mellanox.com; alexandre.belloni@bootlin.com; kuba@kernel.org; Po
> Liu <po.liu@nxp.com>; Leo Li <leoyang.li@nxp.com>; f.fainelli@gmail.com;
> andrew@lunn.ch; vivien.didelot@gmail.com; Claudiu Manoil
> <claudiu.manoil@nxp.com>; linux-mediatek@lists.infradead.org;
> linux-arm-kernel@lists.infradead.org; matthias.bgg@gmail.com;
> horatiu.vultur@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
\
 
 \ /
  Last update: 2021-11-10 11:44    [W:0.125 / U:0.296 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site