aboutsummaryrefslogtreecommitdiffstats
path: root/net/dsa/slave.c
diff options
context:
space:
mode:
authorTobias Waldekranz <tobias@waldekranz.com>2022-03-16 16:08:52 +0100
committerJakub Kicinski <kuba@kernel.org>2022-03-17 16:49:58 -0700
commit332afc4c8c0da3a451745c5d809f908006745c0d (patch)
tree32bae9abb5c33461fcf83b6a025533c1ef8f4ec7 /net/dsa/slave.c
parentnet: bridge: mst: Add helper to query a port's MST state (diff)
downloadlinux-dev-332afc4c8c0da3a451745c5d809f908006745c0d.tar.xz
linux-dev-332afc4c8c0da3a451745c5d809f908006745c0d.zip
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.c6
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;