From: Joseph Huang Date: Tue, 15 Apr 2025 14:43:06 +0000 (-0400) Subject: iplink_bridge: Add mdb_offload_fail_notification X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4f4e3bb5c3d38c25f6d7314c969549bd266efe38;p=thirdparty%2Fiproute2.git iplink_bridge: Add mdb_offload_fail_notification Add mdb_offload_fail_notification option support. Signed-off-by: Joseph Huang Acked-by: Nikolay Aleksandrov Signed-off-by: David Ahern --- diff --git a/ip/iplink_bridge.c b/ip/iplink_bridge.c index 1fe89551..d98bfa5a 100644 --- a/ip/iplink_bridge.c +++ b/ip/iplink_bridge.c @@ -62,6 +62,7 @@ static void print_explain(FILE *f) " [ nf_call_iptables NF_CALL_IPTABLES ]\n" " [ nf_call_ip6tables NF_CALL_IP6TABLES ]\n" " [ nf_call_arptables NF_CALL_ARPTABLES ]\n" + " [ mdb_offload_fail_notification MDB_OFFLOAD_FAIL_NOTIFICATION ]\n" "\n" "Where: VLAN_PROTOCOL := { 802.1Q | 802.1ad }\n" ); @@ -413,6 +414,18 @@ static int bridge_parse_opt(struct link_util *lu, int argc, char **argv, addattr8(n, 1024, IFLA_BR_NF_CALL_ARPTABLES, nf_call_arpt); + } else if (strcmp(*argv, "mdb_offload_fail_notification") == 0) { + __u32 mofn_bit = 1 << BR_BOOLOPT_MDB_OFFLOAD_FAIL_NOTIFICATION; + __u8 mofn; + + NEXT_ARG(); + if (get_u8(&mofn, *argv, 0)) + invarg("invalid mdb_offload_fail_notification", *argv); + bm.optmask |= 1 << BR_BOOLOPT_MDB_OFFLOAD_FAIL_NOTIFICATION; + if (mofn) + bm.optval |= mofn_bit; + else + bm.optval &= ~mofn_bit; } else if (matches(*argv, "help") == 0) { explain(); return -1; @@ -620,6 +633,7 @@ static void bridge_print_opt(struct link_util *lu, FILE *f, struct rtattr *tb[]) rta_getattr_u8(tb[IFLA_BR_MCAST_SNOOPING])); if (tb[IFLA_BR_MULTI_BOOLOPT]) { + __u32 mofn_bit = 1 << BR_BOOLOPT_MDB_OFFLOAD_FAIL_NOTIFICATION; __u32 mcvl_bit = 1 << BR_BOOLOPT_MCAST_VLAN_SNOOPING; __u32 no_ll_learn_bit = 1 << BR_BOOLOPT_NO_LL_LEARN; __u32 mst_bit = 1 << BR_BOOLOPT_MST_ENABLE; @@ -641,6 +655,11 @@ static void bridge_print_opt(struct link_util *lu, FILE *f, struct rtattr *tb[]) "mst_enabled", "mst_enabled %u ", !!(bm->optval & mst_bit)); + if (bm->optmask & mofn_bit) + print_uint(PRINT_ANY, + "mdb_offload_fail_notification", + "mdb_offload_fail_notification %u ", + !!(bm->optval & mofn_bit)); } if (tb[IFLA_BR_MCAST_ROUTER]) diff --git a/man/man8/ip-link.8.in b/man/man8/ip-link.8.in index d6e05d94..91fa0cf1 100644 --- a/man/man8/ip-link.8.in +++ b/man/man8/ip-link.8.in @@ -1768,6 +1768,8 @@ the following additional arguments are supported: .BI nf_call_ip6tables " NF_CALL_IP6TABLES " ] [ .BI nf_call_arptables " NF_CALL_ARPTABLES " +] [ +.BI mdb_offload_fail_notification " MDB_OFFLOAD_FAIL_NOTIFICATION " ] .in +8 @@ -1992,6 +1994,13 @@ or disable .RI ( NF_CALL_ARPTABLES " == 0) " arptables hooks on the bridge. +.BI mdb_offload_fail_notification " MDB_OFFLOAD_FAIL_NOTIFICATION " +- turn mdb offload fail notification on +.RI ( MDB_OFFLOAD_FAIL_NOTIFICATION " > 0) " +or off +.RI ( MDB_OFFLOAD_FAIL_NOTIFICATION " == 0). " +Default is +.BR 0 . .in -8