netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ido Schimmel <idosch@nvidia.com>
To: "Linus Lüssing" <linus.luessing@c0d3.blue>
Cc: bridge@lists.linux.dev, netdev@vger.kernel.org,
	openwrt-devel@lists.openwrt.org, linux-kernel@vger.kernel.org,
	linux-doc@vger.kernel.org,
	"Nikolay Aleksandrov" <razor@blackwall.org>,
	"Ivan Vecera" <ivecera@redhat.com>,
	"Jiri Pirko" <jiri@resnulli.us>,
	"Vladimir Oltean" <olteanv@gmail.com>,
	"Andrew Lunn" <andrew@lunn.ch>,
	"Jonathan Corbet" <corbet@lwn.net>,
	"Simon Horman" <horms@kernel.org>,
	"Paolo Abeni" <pabeni@redhat.com>,
	"Jakub Kicinski" <kuba@kernel.org>,
	"Eric Dumazet" <edumazet@google.com>,
	"David S . Miller" <davem@davemloft.net>,
	"Kuniyuki Iwashima" <kuniyu@amazon.com>,
	"Stanislav Fomichev" <sdf@fomichev.me>,
	"Xiao Liang" <shaw.leon@gmail.com>,
	"Markus Stockhausen" <markus.stockhausen@gmx.de>,
	"Jan Hoffmann" <jan.christian.hoffmann@gmail.com>,
	"Birger Koblitz" <git@birger-koblitz.de>,
	"Bjørn Mork" <bjorn@mork.no>
Subject: Re: [PATCH net-next 2/5] net: bridge: mcast: export ip{4,6}_active state to netlink
Date: Sun, 25 May 2025 20:20:05 +0300	[thread overview]
Message-ID: <aDNRRReO3SufLNkb@shredder> (raw)
In-Reply-To: <20250522195952.29265-3-linus.luessing@c0d3.blue>

On Thu, May 22, 2025 at 09:17:04PM +0200, Linus Lüssing wrote:
> diff --git a/include/uapi/linux/if_link.h b/include/uapi/linux/if_link.h
> index 318386cc5b0d..41f6c461ab32 100644
> --- a/include/uapi/linux/if_link.h
> +++ b/include/uapi/linux/if_link.h
> @@ -742,6 +742,16 @@ enum in6_addr_gen_mode {
>   * @IFLA_BR_FDB_MAX_LEARNED
>   *   Set the number of max dynamically learned FDB entries for the current
>   *   bridge.
> + *
> + * @IFLA_BR_MCAST_ACTIVE_V4
> + *   Bridge IPv4 mcast active state, read only.
> + *
> + *   1 if an IGMP querier is present, 0 otherwise.
> + *
> + * @IFLA_BR_MCAST_ACTIVE_V6
> + *   Bridge IPv4 mcast active state, read only.
> + *
> + *   1 if an MLD querier is present, 0 otherwise.
>   */

[...]

> diff --git a/net/bridge/br_netlink.c b/net/bridge/br_netlink.c
> index 6e337937d0d7..7829d2842851 100644
> --- a/net/bridge/br_netlink.c
> +++ b/net/bridge/br_netlink.c
> @@ -1264,7 +1264,9 @@ static const struct nla_policy br_policy[IFLA_BR_MAX + 1] = {
>  	[IFLA_BR_VLAN_STATS_ENABLED] = { .type = NLA_U8 },
>  	[IFLA_BR_MCAST_STATS_ENABLED] = { .type = NLA_U8 },
>  	[IFLA_BR_MCAST_IGMP_VERSION] = { .type = NLA_U8 },
> +	[IFLA_BR_MCAST_ACTIVE_V4] = { .type = NLA_U8 },
>  	[IFLA_BR_MCAST_MLD_VERSION] = { .type = NLA_U8 },
> +	[IFLA_BR_MCAST_ACTIVE_V6] = { .type = NLA_U8 },

The new attributes should be set to 'NLA_REJECT' if they are meant to be
read only. They can also be removed from the policy, but being explicit
and using 'NLA_REJECT' is better IMO.

  reply	other threads:[~2025-05-25 17:20 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-05-22 19:17 [PATCH net-next 0/5] net: bridge: propagate safe mcast snooping to switchdev + DSA Linus Lüssing
2025-05-22 19:17 ` [PATCH net-next 1/5] net: bridge: mcast: explicitly track active state Linus Lüssing
2025-05-23  9:44   ` kernel test robot
2025-05-25 17:13   ` Ido Schimmel
2025-05-22 19:17 ` [PATCH net-next 2/5] net: bridge: mcast: export ip{4,6}_active state to netlink Linus Lüssing
2025-05-25 17:20   ` Ido Schimmel [this message]
2025-05-22 19:17 ` [PATCH net-next 3/5] net: bridge: mcast: check if snooping is enabled for active state Linus Lüssing
2025-05-23 13:02   ` Simon Horman
2025-05-22 19:17 ` [PATCH net-next 4/5] net: bridge: switchdev: notify on mcast active changes Linus Lüssing
2025-05-22 19:17 ` [PATCH net-next 5/5] net: dsa: forward bridge/switchdev mcast active notification Linus Lüssing
2025-05-23  9:24   ` kernel test robot
2025-05-23  9:44   ` kernel test robot

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=aDNRRReO3SufLNkb@shredder \
    --to=idosch@nvidia.com \
    --cc=andrew@lunn.ch \
    --cc=bjorn@mork.no \
    --cc=bridge@lists.linux.dev \
    --cc=corbet@lwn.net \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=git@birger-koblitz.de \
    --cc=horms@kernel.org \
    --cc=ivecera@redhat.com \
    --cc=jan.christian.hoffmann@gmail.com \
    --cc=jiri@resnulli.us \
    --cc=kuba@kernel.org \
    --cc=kuniyu@amazon.com \
    --cc=linus.luessing@c0d3.blue \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=markus.stockhausen@gmx.de \
    --cc=netdev@vger.kernel.org \
    --cc=olteanv@gmail.com \
    --cc=openwrt-devel@lists.openwrt.org \
    --cc=pabeni@redhat.com \
    --cc=razor@blackwall.org \
    --cc=sdf@fomichev.me \
    --cc=shaw.leon@gmail.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).