Thread (43 messages) 43 messages, 4 authors, 2023-04-06

Re: [PATCH v2 net-next 2/6] net: dsa: propagate flags down towards drivers

From: Vladimir Oltean <olteanv@gmail.com>
Date: 2023-03-30 15:45:23
Also in: bridge, linux-kselftest, linux-mediatek, linux-renesas-soc, lkml, netdev

On Thu, Mar 30, 2023 at 05:34:44PM +0200, Hans Schultz wrote:
On Thu, Mar 30, 2023 at 18:07, Vladimir Oltean [off-list ref] wrote:
quoted
Then, make DSA decide whether to handle the "added_by_user && !is_static"
combination or not, based on the presence of the DSA_FDB_FLAG_DYNAMIC
flag, which will be set in ds->supported_fdb_flags only for the mv88e6xxx
driver.
Okay, so this will require a new function in the DSA layer that sets
which flags are supported and that the driver will call on
initialization.

Where (in the DSA layer) should such a function be placed and what
should it be called?
Don't overthink it, no new function. It's okay to just set
ds->supported_fdb_flags = DSA_FDB_FLAG_DYNAMIC in
mv88e6xxx_register_switch(), near the place where it currently sets
ds->num_lag_ids. Either before dsa_register_switch(), or within the
ds->ops->setup(). Both are fine, since the user network interfaces
haven't been allocated just yet by dsa_slave_create() and so, the
switchdev code path is inaccessible.

Existing drivers will have ds->supported_fdb_flags = 0 by default, since
they allocate the struct dsa_switch with kzalloc(), and DSA will have to
do something sane with that.

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help