aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIdo Schimmel <idosch@mellanox.com>2015-10-28 05:16:54 -0400
committerDavid S. Miller <davem@davemloft.net>2015-10-29 23:26:38 -0400
commit741af0053b43d8b9a688a12c57ece62338616ae8 (patch)
tree2fa4b203e94bbc4ea74be2a3f417679ce6eea5df
parent65bdc43d2220bc97af037c87aba2407b46f13c2a (diff)
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: Ido Schimmel <idosch@mellanox.com> Signed-off-by: Jiri Pirko <jiri@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--Documentation/networking/switchdev.txt3
-rw-r--r--net/switchdev/switchdev.c5
2 files changed, 7 insertions, 1 deletions
diff --git a/Documentation/networking/switchdev.txt b/Documentation/networking/switchdev.txt
index 0714fe555016..ce510e1a3e87 100644
--- a/Documentation/networking/switchdev.txt
+++ b/Documentation/networking/switchdev.txt
@@ -298,6 +298,9 @@ packets up to the bridge driver for flooding. This is not ideal as the number
298of ports scale in the L2 domain as the device is much more efficient at 298of ports scale in the L2 domain as the device is much more efficient at
299flooding packets that software. 299flooding packets that software.
300 300
301If supported by the device, flood control can be offloaded to it, preventing
302certain netdevs from flooding unicast traffic for which there is no FDB entry.
303
301IGMP Snooping 304IGMP Snooping
302^^^^^^^^^^^^^ 305^^^^^^^^^^^^^
303 306
diff --git a/net/switchdev/switchdev.c b/net/switchdev/switchdev.c
index 1eb76956b439..8950d39af341 100644
--- a/net/switchdev/switchdev.c
+++ b/net/switchdev/switchdev.c
@@ -746,7 +746,7 @@ int switchdev_port_bridge_getlink(struct sk_buff *skb, u32 pid, u32 seq,
746 .id = SWITCHDEV_ATTR_ID_PORT_BRIDGE_FLAGS, 746 .id = SWITCHDEV_ATTR_ID_PORT_BRIDGE_FLAGS,
747 }; 747 };
748 u16 mode = BRIDGE_MODE_UNDEF; 748 u16 mode = BRIDGE_MODE_UNDEF;
749 u32 mask = BR_LEARNING | BR_LEARNING_SYNC; 749 u32 mask = BR_LEARNING | BR_LEARNING_SYNC | BR_FLOOD;
750 int err; 750 int err;
751 751
752 err = switchdev_port_attr_get(dev, &attr); 752 err = switchdev_port_attr_get(dev, &attr);
@@ -817,6 +817,9 @@ static int switchdev_port_br_setlink_protinfo(struct net_device *dev,
817 err = switchdev_port_br_setflag(dev, attr, 817 err = switchdev_port_br_setflag(dev, attr,
818 BR_LEARNING_SYNC); 818 BR_LEARNING_SYNC);
819 break; 819 break;
820 case IFLA_BRPORT_UNICAST_FLOOD:
821 err = switchdev_port_br_setflag(dev, attr, BR_FLOOD);
822 break;
820 default: 823 default:
821 err = -EOPNOTSUPP; 824 err = -EOPNOTSUPP;
822 break; 825 break;