From: Ido Schimmel <idosch@nvidia.com>
To: cedric.jehasse@luminex.be
Cc: Nikolay Aleksandrov <razor@blackwall.org>,
"David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
Simon Horman <horms@kernel.org>,
bridge@lists.linux.dev, netdev@vger.kernel.org,
linux-kernel@vger.kernel.org,
Cedric Jehasse <cedric.jehasse@gmail.com>
Subject: Re: [PATCH RFC] net: bridge: mcast: don't clear L2 host_joined on port group deletion
Date: Sun, 14 Jun 2026 13:54:16 +0300 [thread overview]
Message-ID: <20260614105416.GA178336@shredder> (raw)
In-Reply-To: <20260610-mdb_l2_host_joined_fix-v1-1-19746b0b8a5d@luminex.be>
On Wed, Jun 10, 2026 at 10:31:23AM +0200, Cedric Jehasse via B4 Relay wrote:
> From: Cedric Jehasse <cedric.jehasse@luminex.be>
>
> For a static L2 multicast group that has both a host entry and a port
> entry, deleting the port entry also removes the host entry, and the
> whole group then disappears from "bridge mdb show".
>
> To reproduce:
> bridge mdb add dev br0 port br0 grp 01:02:03:04:05:06 permanent
> bridge mdb add dev br0 port swp1 grp 01:02:03:04:05:06 permanent
> bridge mdb del dev br0 port swp1 grp 01:02:03:04:05:06 permanent
> bridge mdb show # the "port br0" host entry is gone, too
Please show the output in the commit message and also show that this
differs from regular (*, G) entries where the host entry is not removed
following the deletion of the port entry.
>
> br_multicast_del_pg() processes every non-(*,G) entry through the S,G
> path, which removes the port group from br->sg_port_tbl and then calls
> br_multicast_sg_del_exclude_ports(). L2 entries are stored in
> sg_port_tbl as well, so they take this path too.
>
> When the last port is removed in br_multicast_sg_del_exclude_ports it
> sets "sgmp->host_joined = false", clearing the host membership directly
> and bypassing br_multicast_host_leave(). With host_joined now false and
> no ports left, br_multicast_del_pg() arms the group timer and
> br_multicast_group_expired() tears down the whole mdb entry -- even
> though the host membership was explicitly and permanently configured
> from user space.
>
> Keep removing L2 port groups from sg_port_tbl, but skip the S,G
> EXCLUDE-mode handling for them. The host membership of an L2 group is
> managed solely via br_multicast_host_join() / br_multicast_host_leave().
>
> Signed-off-by: Cedric Jehasse <cedric.jehasse@luminex.be>
The patch seems OK to me, but please add a test case in bridge_mdb.sh.
I checked the code and AFAICT this never worked, so target at net-next
without a fixes tag: Support for L2 multicast groups was added in
955062b03fa62, but at this point the mode handling already existed in
br_multicast_del_pg().
prev parent reply other threads:[~2026-06-14 10:54 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-10 8:31 [PATCH RFC] net: bridge: mcast: don't clear L2 host_joined on port group deletion Cedric Jehasse via B4 Relay
2026-06-10 8:31 ` Cedric Jehasse
2026-06-14 10:54 ` Ido Schimmel [this message]
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=20260614105416.GA178336@shredder \
--to=idosch@nvidia.com \
--cc=bridge@lists.linux.dev \
--cc=cedric.jehasse@gmail.com \
--cc=cedric.jehasse@luminex.be \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=horms@kernel.org \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=razor@blackwall.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.