diff options
author | Russell King <rmk+kernel@armlinux.org.uk> | 2019-02-20 15:35:04 -0800 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2019-02-21 14:53:07 -0800 |
commit | 57652796aa979d5754406c8177f716cb2cf60616 (patch) | |
tree | 45f7bcc667916bc0e0f6e5f2c62225b3b4050741 /net/dsa/slave.c | |
parent | 08e71623c8223723b19d079933974645d52967c6 (diff) | |
download | linux-57652796aa979d5754406c8177f716cb2cf60616.tar.gz linux-57652796aa979d5754406c8177f716cb2cf60616.tar.bz2 linux-57652796aa979d5754406c8177f716cb2cf60616.zip |
net: dsa: add support for bridge flags
The Linux bridge implementation allows various properties of the bridge
to be controlled, such as flooding unknown unicast and multicast frames.
This patch adds the necessary DSA infrastructure to allow the Linux
bridge support to control these properties for DSA switches.
Reviewed-by: Vivien Didelot <vivien.didelot@gmail.com>
Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
[florian: Add missing dp and ds variables declaration to fix build]
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/dsa/slave.c')
-rw-r--r-- | net/dsa/slave.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/net/dsa/slave.c b/net/dsa/slave.c index 2e5e7c04821b..85dc68611002 100644 --- a/net/dsa/slave.c +++ b/net/dsa/slave.c @@ -295,6 +295,9 @@ static int dsa_slave_port_attr_set(struct net_device *dev, case SWITCHDEV_ATTR_ID_BRIDGE_AGEING_TIME: ret = dsa_port_ageing_time(dp, attr->u.ageing_time, trans); break; + case SWITCHDEV_ATTR_ID_PORT_BRIDGE_FLAGS: + ret = dsa_port_bridge_flags(dp, attr->u.brport_flags, trans); + break; default: ret = -EOPNOTSUPP; break; @@ -381,9 +384,15 @@ static int dsa_slave_get_port_parent_id(struct net_device *dev, static int dsa_slave_port_attr_get(struct net_device *dev, struct switchdev_attr *attr) { + struct dsa_port *dp = dsa_slave_to_port(dev); + struct dsa_switch *ds = dp->ds; + switch (attr->id) { case SWITCHDEV_ATTR_ID_PORT_BRIDGE_FLAGS_SUPPORT: attr->u.brport_flags_support = 0; + if (ds->ops->port_egress_floods) + attr->u.brport_flags_support |= BR_FLOOD | + BR_MCAST_FLOOD; break; default: return -EOPNOTSUPP; |