Netdev List
 help / color / mirror / Atom feed
From: Nikolay Aleksandrov <nikolay@nvidia.com>
To: Andy Roulin <aroulin@nvidia.com>, netdev@vger.kernel.org
Cc: stephen@networkplumber.org, bridge@lists.linux.dev,
	razor@blackwall.org, idosch@nvidia.com, petrm@nvidia.com,
	danieller@nvidia.com, dsahern@kernel.org
Subject: Re: [PATCH iproute2-next v2] iplink: bridge: add stp_mode support
Date: Wed, 3 Jun 2026 20:41:06 +0300	[thread overview]
Message-ID: <ae5396bb-2305-441e-ac5a-d53a20e150aa@nvidia.com> (raw)
In-Reply-To: <20260603173304.564055-1-aroulin@nvidia.com>

On 03/06/2026 20:33, Andy Roulin wrote:
> Add support for the IFLA_BR_STP_MODE bridge attribute that allows
> userspace to explicitly select the STP mode:
> 
>    - auto (0): default, try /sbin/bridge-stp helper in init_net
>    - user (1): directly enable userspace STP without the helper,
>      works in any network namespace
>    - kernel (2): directly enable kernel STP without the helper
> 
> A shared file-scope stp_modes[] table indexed by BR_STP_MODE_* drives
> both directions: parsing uses parse_one_of(), printing goes through a
> stp_mode_to_str() helper that returns "(unknown)" for modes not yet
> known to iproute2, keeping the JSON type of stp_mode consistently a
> string.
> 
> Example usage:
>    ip link set br0 type bridge stp_mode user
>    ip link set br0 type bridge stp_state 1
> 
> Link: https://lore.kernel.org/netdev/20260405205224.3163000-1-aroulin@nvidia.com/
> Assisted-by: Claude:claude-opus-4-7
> Reviewed-by: Ido Schimmel <idosch@nvidia.com>
> Signed-off-by: Andy Roulin <aroulin@nvidia.com>
> ---
> 
> Notes:
>      v2:
>              * Use a single file-scope stp_modes[] table indexed by
>                BR_STP_MODE_* for both parse and show, instead of an ad-hoc
>                strcmp ladder in parse and a separate local table in show
>                (David Ahern).
>              * Switch parsing to the shared parse_one_of() helper. Drop the
>                fallback that accepted numeric values on the parse side.
>              * Print path always returns a string: keep the JSON type of
>                stp_mode stable and fall back to "(unknown)" for unrecognized
>                values via a stp_mode_to_str() helper matching the style of
>                validate_to_str() in ip/ipmacsec.c (Ido Schimmel).
>      
>      v1: https://lore.kernel.org/netdev/20260518163647.1935156-1-aroulin@nvidia.com/
> 
>   ip/iplink_bridge.c    | 33 +++++++++++++++++++++++++++++++++
>   man/man8/ip-link.8.in | 32 ++++++++++++++++++++++++++++++++
>   2 files changed, 65 insertions(+)
> 

Reviewed-by: Nikolay Aleksandrov <nikolay@nvidia.com>


  reply	other threads:[~2026-06-03 17:41 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-03 17:33 [PATCH iproute2-next v2] iplink: bridge: add stp_mode support Andy Roulin
2026-06-03 17:41 ` Nikolay Aleksandrov [this message]
2026-06-04 15:30 ` patchwork-bot+netdevbpf

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=ae5396bb-2305-441e-ac5a-d53a20e150aa@nvidia.com \
    --to=nikolay@nvidia.com \
    --cc=aroulin@nvidia.com \
    --cc=bridge@lists.linux.dev \
    --cc=danieller@nvidia.com \
    --cc=dsahern@kernel.org \
    --cc=idosch@nvidia.com \
    --cc=netdev@vger.kernel.org \
    --cc=petrm@nvidia.com \
    --cc=razor@blackwall.org \
    --cc=stephen@networkplumber.org \
    /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