Skip to contentSkip to conversation

bridge: support for controlling broadcast flooding per port

PATCH Superseded Joachim Wiberg 2 participants 5 messages Mar 8, 2022 – Mar 9, 2022

Subsystems (2)

v1 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

cover bridge: support for controlling broadcast flooding per port

Hi,

this patch set addresses a slight omission in controlling broadcast flooding per bridge port, which the bridge has had support for a good while now.

I've grouped the setting alongside it's cousin mcast_flood, but there could be a need for some rearrangement to also move unicast flooding to the same group.

Best regards
/Joachim

#1 lore raw

PATCH 1/2 bridge: support for controlling flooding of broadcast per port

Add per-port support for controlling flooding of broadcast traffic. Similar to unicast and multcast flooding that already exist.

---
 bridge/link.c | 13 +++++++++++++
 1 file changed, 13 insertions(+)
bridge/link.c +13 -0
index bc7837a9..407dc8ea 100644
@@ -153,6 +153,9 @@ static void print_protinfo(FILE *fp, struct rtattr *attr)
 		if (prtb[IFLA_BRPORT_MCAST_FLOOD])
 			print_on_off(PRINT_ANY, "mcast_flood", "mcast_flood %s ",
 				     rta_getattr_u8(prtb[IFLA_BRPORT_MCAST_FLOOD]));
+		if (prtb[IFLA_BRPORT_BCAST_FLOOD])
+			print_on_off(PRINT_ANY, "bcast_flood", "bcast_flood %s ",
+				     rta_getattr_u8(prtb[IFLA_BRPORT_BCAST_FLOOD]));
 		if (prtb[IFLA_BRPORT_MCAST_TO_UCAST])
 			print_on_off(PRINT_ANY, "mcast_to_unicast", "mcast_to_unicast %s ",
 				     rta_getattr_u8(prtb[IFLA_BRPORT_MCAST_TO_UCAST]));
@@ -265,6 +268,7 @@ static void usage(void)
 		"                               [ learning_sync {on | off} ]\n"
 		"                               [ flood {on | off} ]\n"
 		"                               [ mcast_flood {on | off} ]\n"
+		"                               [ bcast_flood {on | off} ]\n"
 		"                               [ mcast_to_unicast {on | off} ]\n"
 		"                               [ neigh_suppress {on | off} ]\n"
 		"                               [ vlan_tunnel {on | off} ]\n"
@@ -296,6 +300,7 @@ static int brlink_modify(int argc, char **argv)
 	__s8 flood = -1;
 	__s8 vlan_tunnel = -1;
 	__s8 mcast_flood = -1;
+	__s8 bcast_flood = -1;
 	__s8 mcast_to_unicast = -1;
 	__s8 isolated = -1;
 	__s8 hairpin = -1;
@@ -354,6 +359,11 @@ static int brlink_modify(int argc, char **argv)
 			mcast_flood = parse_on_off("mcast_flood", *argv, &ret);
 			if (ret)
 				return ret;
+		} else if (strcmp(*argv, "bcast_flood") == 0) {
+			NEXT_ARG();
+			bcast_flood = parse_on_off("bcast_flood", *argv, &ret);
+			if (ret)
+				return ret;
 		} else if (strcmp(*argv, "mcast_to_unicast") == 0) {
 			NEXT_ARG();
 			mcast_to_unicast = parse_on_off("mcast_to_unicast", *argv, &ret);
@@ -456,6 +466,9 @@ static int brlink_modify(int argc, char **argv)
 	if (mcast_flood >= 0)
 		addattr8(&req.n, sizeof(req), IFLA_BRPORT_MCAST_FLOOD,
 			 mcast_flood);
+	if (bcast_flood >= 0)
+		addattr8(&req.n, sizeof(req), IFLA_BRPORT_BCAST_FLOOD,
+			 bcast_flood);
 	if (mcast_to_unicast >= 0)
 		addattr8(&req.n, sizeof(req), IFLA_BRPORT_MCAST_TO_UCAST,
 			 mcast_to_unicast);
Signature · 1 line
2.25.1
#2 lore raw

Re: [PATCH iproute2-next 1/2] bridge: support for controlling flooding of broadcast per port

Quoted 8 lines · Joachim Wiberg

Add per-port support for controlling flooding of broadcast traffic. Similar to unicast and multcast flooding that already exist.

---
 bridge/link.c | 13 +++++++++++++
 1 file changed, 13 insertions(+)

Nice, thanks for adding this. Please also update ip/iplink_bridge_slave.c and the respective docs with the bcast flag, it already supports the other two.

#3 lore raw

Re: [PATCH iproute2-next 1/2] bridge: support for controlling flooding of broadcast per port

Quoted 5 lines · Nikolay Aleksandrov
Quoted 2 lines · Joachim Wiberg

Add per-port support for controlling flooding of broadcast traffic. Similar to unicast and multcast flooding that already exist.

Nice, thanks for adding this. Please also update ip/iplink_bridge_slave.c and the respective docs with the bcast flag, it already supports the other two.

Aha, there are knobs and levers over there too! OK, will do :-)

/J

#4 lore raw

PATCH 2/2 man: document new bcast_flood config/query support for bridge ports

In reply to Joachim Wiberg
---
 man/man8/bridge.8 | 6 ++++++
 1 file changed, 6 insertions(+)
man/man8/bridge.8 +6 -0
index 81ce9e6f..1d03eef1 100644
@@ -46,6 +46,7 @@ bridge \- show / manipulate bridge addresses and devices
 .BR flood " { " on " | " off " } ] [ "
 .BR hwmode " { " vepa " | " veb " } ] [ "
 .BR mcast_flood " { " on " | " off " } ] [ "
+.BR bcast_flood " { " on " | " off " } ] [ "
 .BR mcast_to_unicast " { " on " | " off " } ] [ "
 .BR neigh_suppress " { " on " | " off " } ] [ "
 .BR vlan_tunnel " { " on " | " off " } ] [ "
@@ -466,6 +467,11 @@ switch.
 Controls whether multicast traffic for which there is no MDB entry will be
 flooded towards this given port. By default this flag is on.
 
+.TP
+.BR "bcast_flood on " or " bcast_flood off "
+Controls flooding of broadcast traffic on the given port.
+By default this flag is on.
+
 .TP
 .BR "mcast_to_unicast on " or " mcast_to_unicast off "
 Controls whether a given port will replicate packets using unicast
Signature · 1 line
2.25.1