diff options
author | Tobias Waldekranz <tobias@waldekranz.com> | 2022-03-16 18:08:52 +0300 |
---|---|---|
committer | Jakub Kicinski <kuba@kernel.org> | 2022-03-18 02:49:58 +0300 |
commit | 332afc4c8c0da3a451745c5d809f908006745c0d (patch) | |
tree | 32bae9abb5c33461fcf83b6a025533c1ef8f4ec7 /net/dsa/slave.c | |
parent | f54fd0e163068ced4d0d27db64cd3cbda95b74e4 (diff) | |
download | linux-332afc4c8c0da3a451745c5d809f908006745c0d.tar.xz |
net: dsa: Validate hardware support for MST
When joining a bridge where MST is enabled, we validate that the
proper offloading support is in place, otherwise we fallback to
software bridging.
When then mode is changed on a bridge in which we are members, we
refuse the change if offloading is not supported.
At the moment we only check for configurable learning, but this will
be further restricted as we support more MST related switchdev events.
Signed-off-by: Tobias Waldekranz <tobias@waldekranz.com>
Reviewed-by: Vladimir Oltean <olteanv@gmail.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'net/dsa/slave.c')
-rw-r--r-- | net/dsa/slave.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/net/dsa/slave.c b/net/dsa/slave.c index d24b6bf845c1..6393a35c5660 100644 --- a/net/dsa/slave.c +++ b/net/dsa/slave.c @@ -464,6 +464,12 @@ static int dsa_slave_port_attr_set(struct net_device *dev, const void *ctx, ret = dsa_port_ageing_time(dp, attr->u.ageing_time); break; + case SWITCHDEV_ATTR_ID_BRIDGE_MST: + if (!dsa_port_offloads_bridge_dev(dp, attr->orig_dev)) + return -EOPNOTSUPP; + + ret = dsa_port_mst_enable(dp, attr->u.mst, extack); + break; case SWITCHDEV_ATTR_ID_PORT_PRE_BRIDGE_FLAGS: if (!dsa_port_offloads_bridge_port(dp, attr->orig_dev)) return -EOPNOTSUPP; |