Nikolay Aleksandrov
2021-Oct-15 08:57 UTC
[Bridge] [PATCH net-next v4 10/15] net: bridge: mcast: support for IGMPv3/MLDv2 ALLOW_NEW_SOURCES report
On 15/10/2021 09:36, Hangbin Liu wrote:> On Fri, Oct 15, 2021 at 10:52:00AM +0800, Hangbin Liu wrote: >>> - mod_timer(&p->timer, now + br->multicast_membership_interval); >>> + if (igmpv2_mldv1) >>> + mod_timer(&p->timer, now + br->multicast_membership_interval); >> >> Hi Nikolay, >> >> Our engineer found that the multicast_membership_interval will not work with >> IGMPv3. Is it intend as you said "IGMPv3/MLDv2 handling is not yet >> implemented" ? > > Ah, I saw in br_multicast_group_expired() it wait for mp->ports be freed > before delete the mdb entry. > > And in br_multicast_port_group_expired() it wait for src entry freed first. > > But when mod group src timer, we use > __grp_src_mod_timer(ent, now + br_multicast_gmi(brmctx)); > > instead of user configured multicast_membership_interval. I think we should > fix it. WDYT? > > Thanks > Hangbin >Hi, I did that intentionally because of how RFC 3376 defines the GMI: " 8.4. Group Membership Interval The Group Membership Interval is the amount of time that must pass before a multicast router decides there are no more members of a group or a particular source on a network. This value MUST be ((the Robustness Variable) times (the Query Interval)) plus (one Query Response Interval)." So it is computed properly and the RFC says "MUST" be. The only thing that is not configurable is the QRV currently, if that is added then the GMI will be automatically correctly computed as per the RFC. I get the inconsistency though as we don't compute all timers as the RFC mandates, I'm inclined to revert the GMI computation as it was before and possibly fix how all timers are computed in the future as that may require more work. In addition this could've changed user-expected behaviour when switching to v3 queries which were supported before IGMPv3 was added, so yeah going forward looks like it'd be better to switch to the old GMI behaviour. I'll send the patch in a minute. Thanks, Nik
Nikolay Aleksandrov
2021-Oct-15 09:05 UTC
[Bridge] [PATCH net] net: bridge: mcast: use multicast_membership_interval for IGMPv3
From: Nikolay Aleksandrov <nikolay at nvidia.com> When I added IGMPv3 support I decided to follow the RFC for computing the GMI dynamically: " 8.4. Group Membership Interval The Group Membership Interval is the amount of time that must pass before a multicast router decides there are no more members of a group or a particular source on a network. This value MUST be ((the Robustness Variable) times (the Query Interval)) plus (one Query Response Interval)." But that actually is inconsistent with how the bridge used to compute it for IGMPv2, where it was user-configurable that has a correct default value but it is up to user-space to maintain it. This would make it consistent with the other timer values which are also maintained correct by the user instead of being dynamically computed. It also changes back to the previous user-expected GMI behaviour for IGMPv3 queries which were supported before IGMPv3 was added. Note that to properly compute it dynamically we would need to add support for "Robustness Variable" which is currently missing. Reported-by: Hangbin Liu <liuhangbin at gmail.com> Fixes: 0436862e417e ("net: bridge: mcast: support for IGMPv3/MLDv2 ALLOW_NEW_SOURCES report") Signed-off-by: Nikolay Aleksandrov <nikolay at nvidia.com> --- net/bridge/br_private.h | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/net/bridge/br_private.h b/net/bridge/br_private.h index b4cef3a97f12..5c68052466a0 100644 --- a/net/bridge/br_private.h +++ b/net/bridge/br_private.h @@ -1125,9 +1125,7 @@ static inline unsigned long br_multicast_lmqt(const struct net_bridge_mcast *brm static inline unsigned long br_multicast_gmi(const struct net_bridge_mcast *brmctx) { - /* use the RFC default of 2 for QRV */ - return 2 * brmctx->multicast_query_interval + - brmctx->multicast_query_response_interval; + return brmctx->multicast_membership_interval; } static inline bool -- 2.31.1