aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Ahern <dsahern@kernel.org>2022-03-12 08:59:03 -0700
committerDavid Ahern <dsahern@kernel.org>2022-03-12 08:59:03 -0700
commit4bff7017740a2dd0a1bcf299b31761b40d971586 (patch)
tree9a7ec4f28b0a745465eec0b1bd20b7279d106034
parentcd37d6037f64b52033a9f5ae5c97c40d5bfeadee (diff)
parent2dee2101f6e91643b97c96a184441df587f6abd6 (diff)
downloadiproute2-4bff7017740a2dd0a1bcf299b31761b40d971586.tar.gz
Merge branch 'bridge-broadcast-flooding' into next
Joachim Wiberg says: ==================== this patch set address a slight omission in controlling broadcast flooding per bridge port, which the bridge has had support for a good while now. v3: - Move bcast_flood option in manual files to before the mcast_flood option, instead of breaking the two mcast options. Unfortunately the other options are not alphabetically sorted, so this was the least worst option. (Stephen) - Add missing closing " for 'bridge mdb show' in bridge(8) SYNOPSIS v2: - Add bcast_flood also to ip/iplink_bridge_slave.c (Nik) - Update man page for ip-link(8) with new bcast_flood flag - Update mcast_flood in same man page slightly - Fix minor weird whitespace issues causing sudden line breaks v1: - Add bcast_flood to bridge/link.c - Update man page for bridge(8) with bcast_flood for brports ==================== Signed-off-by: David Ahern <dsahern@kernel.org>
-rw-r--r--bridge/link.c13
-rw-r--r--ip/iplink_bridge_slave.c9
-rw-r--r--man/man8/bridge.88
-rw-r--r--man/man8/ip-link.8.in20
4 files changed, 42 insertions, 8 deletions
diff --git a/bridge/link.c b/bridge/link.c
index dc3fc7adb..80b01f563 100644
--- a/bridge/link.c
+++ b/bridge/link.c
@@ -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]));
@@ -268,6 +271,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"
@@ -300,6 +304,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 locked = -1;
__s8 isolated = -1;
@@ -359,6 +364,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);
@@ -466,6 +476,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);
diff --git a/ip/iplink_bridge_slave.c b/ip/iplink_bridge_slave.c
index da14a95eb..98d172134 100644
--- a/ip/iplink_bridge_slave.c
+++ b/ip/iplink_bridge_slave.c
@@ -37,6 +37,7 @@ static void print_explain(FILE *f)
" [ mcast_router MULTICAST_ROUTER ]\n"
" [ mcast_fast_leave {on | off} ]\n"
" [ mcast_flood {on | off} ]\n"
+ " [ bcast_flood {on | off} ]\n"
" [ mcast_to_unicast {on | off} ]\n"
" [ group_fwd_mask MASK ]\n"
" [ neigh_suppress {on | off} ]\n"
@@ -251,6 +252,10 @@ static void bridge_slave_print_opt(struct link_util *lu, FILE *f,
print_on_off(PRINT_ANY, "mcast_flood", "mcast_flood %s ",
rta_getattr_u8(tb[IFLA_BRPORT_MCAST_FLOOD]));
+ if (tb[IFLA_BRPORT_BCAST_FLOOD])
+ print_on_off(PRINT_ANY, "bcast_flood", "bcast_flood %s ",
+ rta_getattr_u8(tb[IFLA_BRPORT_BCAST_FLOOD]));
+
if (tb[IFLA_BRPORT_MCAST_TO_UCAST])
print_on_off(PRINT_ANY, "mcast_to_unicast", "mcast_to_unicast %s ",
rta_getattr_u8(tb[IFLA_BRPORT_MCAST_TO_UCAST]));
@@ -355,6 +360,10 @@ static int bridge_slave_parse_opt(struct link_util *lu, int argc, char **argv,
NEXT_ARG();
bridge_slave_parse_on_off("mcast_flood", *argv, n,
IFLA_BRPORT_MCAST_FLOOD);
+ } else if (matches(*argv, "bcast_flood") == 0) {
+ NEXT_ARG();
+ bridge_slave_parse_on_off("bcast_flood", *argv, n,
+ IFLA_BRPORT_BCAST_FLOOD);
} else if (matches(*argv, "mcast_to_unicast") == 0) {
NEXT_ARG();
bridge_slave_parse_on_off("mcast_to_unicast", *argv, n,
diff --git a/man/man8/bridge.8 b/man/man8/bridge.8
index cb0ffc166..93852ed82 100644
--- a/man/man8/bridge.8
+++ b/man/man8/bridge.8
@@ -45,6 +45,7 @@ bridge \- show / manipulate bridge addresses and devices
.BR learning_sync " { " on " | " off " } ] [ "
.BR flood " { " on " | " off " } ] [ "
.BR hwmode " { " vepa " | " veb " } ] [ "
+.BR bcast_flood " { " on " | " off " } ] [ "
.BR mcast_flood " { " on " | " off " } ] [ "
.BR mcast_to_unicast " { " on " | " off " } ] [ "
.BR neigh_suppress " { " on " | " off " } ] [ "
@@ -124,7 +125,7 @@ bridge \- show / manipulate bridge addresses and devices
.IR VID " ] "
.ti -8
-.BR "bridge mdb show " [ "
+.BR "bridge mdb show" " [ "
.B dev
.IR DEV " ]"
@@ -463,6 +464,11 @@ switch.
- bridging happens in hardware.
.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_flood on " or " mcast_flood off "
Controls whether multicast traffic for which there is no MDB entry will be
flooded towards this given port. By default this flag is on.
diff --git a/man/man8/ip-link.8.in b/man/man8/ip-link.8.in
index 822904d0d..93106d7f7 100644
--- a/man/man8/ip-link.8.in
+++ b/man/man8/ip-link.8.in
@@ -496,11 +496,11 @@ where <phy_dev> is the physical device to which VLAN device is bound.
.BR gvrp " { " on " | " off " } "
- specifies whether this VLAN should be registered using GARP VLAN
- Registration Protocol.
+Registration Protocol.
.BR mvrp " { " on " | " off " } "
- specifies whether this VLAN should be registered using Multiple VLAN
- Registration Protocol.
+Registration Protocol.
.BR loose_binding " { " on " | " off " } "
- specifies whether the VLAN device state is bound to the physical device state.
@@ -2204,9 +2204,9 @@ parameter must be specified.
.sp
.BI query_rss " on|off"
- toggle the ability of querying the RSS configuration of a specific
- VF. VF RSS information like RSS hash key may be considered sensitive
- on some devices where this information is shared between VF and PF
- and thus its querying may be prohibited by default.
+VF. VF RSS information like RSS hash key may be considered sensitive
+on some devices where this information is shared between VF and PF
+and thus its querying may be prohibited by default.
.sp
.BI state " auto|enable|disable"
- set the virtual link state as seen by the specified VF. Setting to
@@ -2379,6 +2379,8 @@ the following additional arguments are supported:
] [
.BR mcast_fast_leave " { " on " | " off "}"
] [
+.BR bcast_flood " { " on " | " off " }"
+] [
.BR mcast_flood " { " on " | " off " }"
] [
.BR mcast_to_unicast " { " on " | " off " }"
@@ -2466,13 +2468,17 @@ queries.
.B fastleave
option above.
+.BR bcast_flood " { " on " | " off " }"
+- controls flooding of broadcast traffic on the given port. By default
+this flag is on.
+
.BR mcast_flood " { " on " | " off " }"
- controls whether a given port will flood multicast traffic for which
- there is no MDB entry.
+there is no MDB entry. By default this flag is on.
.BR mcast_to_unicast " { " on " | " off " }"
- controls whether a given port will replicate packets using unicast
- instead of multicast. By default this flag is off.
+instead of multicast. By default this flag is off.
.BI group_fwd_mask " MASK "
- set the group forward mask. This is the bitmask that is applied to