[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <edf8dbc4-7f6c-cf25-8b2b-f5dae8af0f0c@gmail.com>
Date: Wed, 20 Jan 2021 20:02:48 -0800
From: Florian Fainelli <f.fainelli@...il.com>
To: Vladimir Oltean <olteanv@...il.com>,
"David S . Miller" <davem@...emloft.net>,
Jakub Kicinski <kuba@...nel.org>, netdev@...r.kernel.org
Cc: Andrew Lunn <andrew@...n.ch>,
Vivien Didelot <vivien.didelot@...il.com>,
Richard Cochran <richardcochran@...il.com>,
Claudiu Manoil <claudiu.manoil@....com>,
Alexandru Marginean <alexandru.marginean@....com>,
Alexandre Belloni <alexandre.belloni@...tlin.com>,
Xiaoliang Yang <xiaoliang.yang_1@....com>,
Hongbo Wang <hongbo.wang@....com>,
Vladimir Oltean <vladimir.oltean@....com>,
Po Liu <po.liu@....com>, Yangbo Lu <yangbo.lu@....com>,
Maxim Kochetkov <fido_max@...ox.ru>,
Eldar Gasanov <eldargasanov2@...il.com>,
Andrey L <al@...omtech.com>,
Tobias Waldekranz <tobias@...dekranz.com>,
UNGLinuxDriver@...rochip.com
Subject: Re: [PATCH v5 net-next 08/10] net: dsa: felix: convert to the new
.{set,del}_tag_protocol DSA API
On 1/20/2021 6:36 PM, Vladimir Oltean wrote:
> From: Vladimir Oltean <vladimir.oltean@....com>
>
> In expectation of the new tag_ocelot_8021q tagger implementation, we
> need to be able to do runtime switchover between one tagger and another.
> So we must implement the .set_tag_protocol() and .del_tag_protocol() for
> the current NPI-based tagger.
>
> We move the felix_npi_port_init function in expectation of the future
> driver configuration necessary for tag_ocelot_8021q: we would like to
> not have the NPI-related bits interspersed with the tag_8021q bits.
>
> Note that the NPI port is no longer configured when the .setup() method
> concludes - aka when ocelot_init() and ocelot_init_port() are called.
> So we need to set the replicator groups - the PGIDs - again, when the
> NPI port is configured - in .set_tag_protocol(). So we export and call
> ocelot_apply_bridge_fwd_mask().
>
> The conversion from this:
>
> ocelot_write_rix(ocelot,
> ANA_PGID_PGID_PGID(GENMASK(ocelot->num_phys_ports, 0)),
> ANA_PGID_PGID, PGID_UC);
>
> to this:
>
> cpu_flood = ANA_PGID_PGID_PGID(BIT(ocelot->num_phys_ports));
> ocelot_rmw_rix(ocelot, cpu_flood, cpu_flood, ANA_PGID_PGID, PGID_UC);
>
> is perhaps non-trivial, but is nonetheless non-functional. The PGID_UC
> (replicator for unknown unicast) is already configured out of hardware
> reset to flood to all ports except ocelot->num_phys_ports (the CPU port
> module). All we change is that we use a read-modify-write to only add
> the CPU port module to the unknown unicast replicator, as opposed to
> doing a full write to the register.
>
> Signed-off-by: Vladimir Oltean <vladimir.oltean@....com>
Reviewed-by: Florian Fainelli <f.fainelli@...il.com>
--
Florian
Powered by blists - more mailing lists