Commit 741af005 authored by Ido Schimmel's avatar Ido Schimmel Committed by David S. Miller

switchdev: Add support for flood control

Allow devices supporting this feature to control the flooding of unknown
unicast traffic, by making switchdev infrastructure propagate this setting
to the switch driver.
Signed-off-by: default avatarIdo Schimmel <idosch@mellanox.com>
Signed-off-by: default avatarJiri Pirko <jiri@mellanox.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 65bdc43d
...@@ -298,6 +298,9 @@ packets up to the bridge driver for flooding. This is not ideal as the number ...@@ -298,6 +298,9 @@ packets up to the bridge driver for flooding. This is not ideal as the number
of ports scale in the L2 domain as the device is much more efficient at of ports scale in the L2 domain as the device is much more efficient at
flooding packets that software. flooding packets that software.
If supported by the device, flood control can be offloaded to it, preventing
certain netdevs from flooding unicast traffic for which there is no FDB entry.
IGMP Snooping IGMP Snooping
^^^^^^^^^^^^^ ^^^^^^^^^^^^^
......
...@@ -746,7 +746,7 @@ int switchdev_port_bridge_getlink(struct sk_buff *skb, u32 pid, u32 seq, ...@@ -746,7 +746,7 @@ int switchdev_port_bridge_getlink(struct sk_buff *skb, u32 pid, u32 seq,
.id = SWITCHDEV_ATTR_ID_PORT_BRIDGE_FLAGS, .id = SWITCHDEV_ATTR_ID_PORT_BRIDGE_FLAGS,
}; };
u16 mode = BRIDGE_MODE_UNDEF; u16 mode = BRIDGE_MODE_UNDEF;
u32 mask = BR_LEARNING | BR_LEARNING_SYNC; u32 mask = BR_LEARNING | BR_LEARNING_SYNC | BR_FLOOD;
int err; int err;
err = switchdev_port_attr_get(dev, &attr); err = switchdev_port_attr_get(dev, &attr);
...@@ -817,6 +817,9 @@ static int switchdev_port_br_setlink_protinfo(struct net_device *dev, ...@@ -817,6 +817,9 @@ static int switchdev_port_br_setlink_protinfo(struct net_device *dev,
err = switchdev_port_br_setflag(dev, attr, err = switchdev_port_br_setflag(dev, attr,
BR_LEARNING_SYNC); BR_LEARNING_SYNC);
break; break;
case IFLA_BRPORT_UNICAST_FLOOD:
err = switchdev_port_br_setflag(dev, attr, BR_FLOOD);
break;
default: default:
err = -EOPNOTSUPP; err = -EOPNOTSUPP;
break; break;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment