netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Hangbin Liu <liuhangbin@gmail.com>
To: Tobias Waldekranz <tobias@waldekranz.com>
Cc: stephen@networkplumber.org, dsahern@kernel.org, netdev@vger.kernel.org
Subject: Re: [PATCH v2 iproute2 1/3] ip: bridge: add support for mst_enabled
Date: Wed, 26 Jun 2024 10:04:13 +0800	[thread overview]
Message-ID: <Znt3HVpvOk8Ocpjg@Laptop-X1> (raw)
In-Reply-To: <20240624130035.3689606-2-tobias@waldekranz.com>

On Mon, Jun 24, 2024 at 03:00:33PM +0200, Tobias Waldekranz wrote:
> When enabled, the bridge's legacy per-VLAN STP facility is replaced
> with the Multiple Spanning Tree Protocol (MSTP) compatible version.
> 
> Signed-off-by: Tobias Waldekranz <tobias@waldekranz.com>
> ---
>  ip/iplink_bridge.c    | 19 +++++++++++++++++++
>  man/man8/ip-link.8.in | 14 ++++++++++++++
>  2 files changed, 33 insertions(+)
> 
> diff --git a/ip/iplink_bridge.c b/ip/iplink_bridge.c
> index 6b70ffbb..f01ffe15 100644
> --- a/ip/iplink_bridge.c
> +++ b/ip/iplink_bridge.c
> @@ -30,6 +30,7 @@ static void print_explain(FILE *f)
>  		"		  [ max_age MAX_AGE ]\n"
>  		"		  [ ageing_time AGEING_TIME ]\n"
>  		"		  [ stp_state STP_STATE ]\n"
> +		"		  [ mst_enabled MST_ENABLED ]\n"
>  		"		  [ priority PRIORITY ]\n"
>  		"		  [ group_fwd_mask MASK ]\n"
>  		"		  [ group_address ADDRESS ]\n"
> @@ -169,6 +170,18 @@ static int bridge_parse_opt(struct link_util *lu, int argc, char **argv,
>  				bm.optval |= no_ll_learn_bit;
>  			else
>  				bm.optval &= ~no_ll_learn_bit;
> +		} else if (strcmp(*argv, "mst_enabled") == 0) {
> +			__u32 mst_bit = 1 << BR_BOOLOPT_MST_ENABLE;
> +			__u8 mst_enabled;
> +
> +			NEXT_ARG();
> +			if (get_u8(&mst_enabled, *argv, 0))
> +				invarg("invalid mst_enabled", *argv);
> +			bm.optmask |= mst_bit;
> +			if (mst_enabled)
> +				bm.optval |= mst_bit;
> +			else
> +				bm.optval &= ~mst_bit;
>  		} else if (strcmp(*argv, "fdb_max_learned") == 0) {
>  			__u32 fdb_max_learned;
>  
> @@ -609,6 +622,7 @@ static void bridge_print_opt(struct link_util *lu, FILE *f, struct rtattr *tb[])
>  	if (tb[IFLA_BR_MULTI_BOOLOPT]) {
>  		__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;
>  		struct br_boolopt_multi *bm;
>  
>  		bm = RTA_DATA(tb[IFLA_BR_MULTI_BOOLOPT]);
> @@ -622,6 +636,11 @@ static void bridge_print_opt(struct link_util *lu, FILE *f, struct rtattr *tb[])
>  				   "mcast_vlan_snooping",
>  				   "mcast_vlan_snooping %u ",
>  				    !!(bm->optval & mcvl_bit));
> +		if (bm->optmask & mst_bit)
> +			print_uint(PRINT_ANY,
> +				   "mst_enabled",
> +				   "mst_enabled %u ",
> +				   !!(bm->optval & mst_bit));
>  	}
>  
>  	if (tb[IFLA_BR_MCAST_ROUTER])
> diff --git a/man/man8/ip-link.8.in b/man/man8/ip-link.8.in
> index c1984158..eabca490 100644
> --- a/man/man8/ip-link.8.in
> +++ b/man/man8/ip-link.8.in
> @@ -1685,6 +1685,8 @@ the following additional arguments are supported:
>  ] [
>  .BI stp_state " STP_STATE "
>  ] [
> +.BI mst_enabled " MST_ENABLED "
> +] [
>  .BI priority " PRIORITY "
>  ] [
>  .BI no_linklocal_learn " NO_LINKLOCAL_LEARN "
> @@ -1788,6 +1790,18 @@ or off
>  .RI ( STP_STATE " == 0). "
>  for this bridge.
>  
> +.BI mst_enabled " MST_ENABLED "
> +- turn multiple spanning tree (MST) support on
> +.RI ( MST_ENABLED " > 0) "
> +or off
> +.RI ( MST_ENABLED " == 0). "
> +When enabled, sets of VLANs can be associated with multiple spanning
> +tree instances (MSTIs), and STP states for each port can be controlled
> +on a per-MSTI basis. Note: no implementation of the MSTP protocol is
> +provided, only the primitives needed to implement it. To avoid
> +interfering with the legacy per-VLAN STP states, this setting can only
> +be changed when no bridge VLANs are configured.
> +
>  .BI priority " PRIORITY "
>  - set this bridge's spanning tree priority, used during STP root
>  bridge election.
> -- 
> 2.34.1
> 

Reviewed-by: Hangbin Liu <liuhangbin@gmail.com>

  reply	other threads:[~2024-06-26  2:04 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-06-24 13:00 [PATCH v2 iproute2 0/3] Multiple Spanning Tree (MST) Support Tobias Waldekranz
2024-06-24 13:00 ` [PATCH v2 iproute2 1/3] ip: bridge: add support for mst_enabled Tobias Waldekranz
2024-06-26  2:04   ` Hangbin Liu [this message]
2024-06-26  6:12   ` Nikolay Aleksandrov
2024-06-24 13:00 ` [PATCH v2 iproute2 2/3] bridge: vlan: Add support for setting a VLANs MSTI Tobias Waldekranz
2024-06-26  2:08   ` Hangbin Liu
2024-06-26  6:12   ` Nikolay Aleksandrov
2024-06-24 13:00 ` [PATCH v2 iproute2 3/3] bridge: mst: Add get/set support for MST states Tobias Waldekranz
2024-06-26  6:21   ` Nikolay Aleksandrov
2024-06-27 16:56   ` Stephen Hemminger
2024-06-26  6:11 ` [PATCH v2 iproute2 0/3] Multiple Spanning Tree (MST) Support Nikolay Aleksandrov
2024-06-26  6:33   ` Tobias Waldekranz
2024-06-26  6:47 ` Hangbin Liu
2024-06-26  6:50   ` Nikolay Aleksandrov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Znt3HVpvOk8Ocpjg@Laptop-X1 \
    --to=liuhangbin@gmail.com \
    --cc=dsahern@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=stephen@networkplumber.org \
    --cc=tobias@waldekranz.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).