From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-ed1-f54.google.com (mail-ed1-f54.google.com [209.85.208.54]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0B659399354 for ; Mon, 30 Mar 2026 19:39:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=pass smtp.client-ip=209.85.208.54 ARC-Seal:i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774899571; cv=pass; b=dBSa61Kl9s8suR8VQhWjGOeDFQ6JyZYWzqII0PI90zntdiq6bPHfPAMSAyE+jpmqmFKQQ59eAeCy0DCucXPYV+o17yDm43LBsL8JIw3+w6f4GKlKmP+6NlDvWByh4vEOqz1XDgRGjB2ozOAL4U1KEHA4JF8PeoeR6xfUfCwPHoQ= ARC-Message-Signature:i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774899571; c=relaxed/simple; bh=raOnWdkwciR774nemG5W5s7l+qsio7cSR6A3+T7p82Y=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=W5xewQ6CLIG/8r/bSUdUXqIrwhPkuB1KcIs5aVb8naUCWH+8NAKaDETxq8NAQVPqhP5m7rXxhNnIwbceG2okOBQghpcw7uJ5WYRnKJe2F4NZ2NlyvYwjkcR7a/W1LMBuPsAiSGTw7gOLVzfHBFYBxFy/wkFwXH9OWH8rsdp1UHE= ARC-Authentication-Results:i=2; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=gM7jqwdh; arc=pass smtp.client-ip=209.85.208.54 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="gM7jqwdh" Received: by mail-ed1-f54.google.com with SMTP id 4fb4d7f45d1cf-66bb7e098b1so1675265a12.3 for ; Mon, 30 Mar 2026 12:39:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1774899567; cv=none; d=google.com; s=arc-20240605; b=M8dEMGba52ZMQIJ6yhxhDw0ZfKF8hVIgVkt+E0RN/Aikh7O6kK8cr8Nwv4AIM9X2Rg 8w0xbe6Nl8Vfb9Y3A3ceimDy2Lf1DDHeKh1zQ1yVJpyI1y2jwmt+QcGRmvIYjnbyxgmZ QGZzQlQ4/IIje/XSnGoT+C50B/KXrDX+FoNQGYq5M3XqU/5E3ab+cfxKMwsQWCbw2EhK Hlr6EyztGUQy8yEw3lfxNEINt+KSRsZ4pXe4ERZgcYJBrhV4AHu9/3vdA1uig/zzeox6 4RG33R+/w246/mK9jcvBHBgbA/H9GoGNx5sjESTjCtKAtF+R7jkCv/2Iw3w+euzFFHvJ N4HA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=oKh8L3ukh4XUchWBADzpdMRcZ/muD9vhADkdS5aaBtA=; fh=R4q+IrwcnbT6Cs8xosyc4HbLI7XgRhIfybatP2ox7Ok=; b=aZPwYTxkTNpO/B15NUBh0dc9AM4IWbB7s3p/ydXWqnGTRujDERCoQl+V0XBtCrjmFQ vsJrPcJ9Q/GiGptiGX//WZO91UTi/VO7T7DG/fBPnFQeSxL1bxeTkx0U8KzstRGZM9pl auiCrr6er1pY07f2Q/JptphBBJKkCL4oMOoP66BNzn9vrtIV3tQwUWWJSCvyWTQwa/tI 0CZK9f76E5E09OKr42MxnHIHb9PlMpNHccdriNprq3KeUk798dUGhi60TgtnS9D6qYtR nocD3FQOXLlSiEtNzpTMdxwF7jUEH9Plg4iIaicpljkOq7O4syZKYEmby17n3YswlGKb pK/g==; darn=vger.kernel.org ARC-Authentication-Results: i=1; mx.google.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1774899567; x=1775504367; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=oKh8L3ukh4XUchWBADzpdMRcZ/muD9vhADkdS5aaBtA=; b=gM7jqwdhW2iE88jS5syb5bwmhyo9wNc2USf0BEwwBaNuF4dlYsz8oJo9DXaaoh8KaF 9ZhkNK3xGPKX5Lpz+t3jPWwRUlU3HvsDo6BidFHzszGw1hiGI3T6bNf80S0sM2PzgeXB oADL5LZiq5vjq3JpM5S+jVzmc2jdKi79JP/bjEMZZR4LkaUCaCuPihpVcKD4ZYg4kPRR qw3TMJwytaCdFEYylnjNvjckVr+43aSlxbx+uE+56BO1Pw4uMhcdfJo9rOQt3t8AGLfs 1LoXBtgvT6jFqKlhRhHyt20FdrTFp4vz2F111N96vEWtoYAeiqTvx31wdrK+JBzEPJey 1nXw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1774899567; x=1775504367; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=oKh8L3ukh4XUchWBADzpdMRcZ/muD9vhADkdS5aaBtA=; b=YUdfBZLe7bJlyXZWzyx3cIPE1eDSWxGIQSrpDMMrdvs/2yNNMR4VDeKzcP58N+ugVX IdnH8X/+D08MN7zF0iKNNs5XcKS4D8TWGyvfbIffi89Gjt9ijLH1pCWCVy+f8MyR8Zi7 m0o6bVjsI8ZQgo3pI5HlrKMjrMcgwE39ymduha056dVrt6PMIMt10svDzvQG2sQWwb7s tUzmSPfyNJGu/nq44xZ2X+aevRn1fQtioaNs4+OdDcuKhQSbUBwDd+O1sYK1G/CEVDBp /iHMrCDIRlaYtKCj+lwzvc1Mta1gT4o/l0PmJ0oKV8OBjp4PdbEYMsR/jJ+qgRah0H/Q YcTQ== X-Forwarded-Encrypted: i=1; AJvYcCVH3GfhL/uXZmy77l6zeIUWXAfiE1wpy+gK5RH4Sdzl80JpFpGQdrPG0r6vKr7ZOKHvcE04gGMI1zmkZSY=@vger.kernel.org X-Gm-Message-State: AOJu0YwgtCGZzuHUSeC5VJvqLnnSm/1IcCvWrkROc6BSKfMYFI3bLa99 xNo7XqtxTwbWkNhmw1+7NeXIGeXXyEwxRs2io/0nRLdnDr8sA7nk1Ia7hSANR9j0EVeW8KxjUGw ghKWZh8ePh8FIiNQ5ATpK+4GK+LP8k35HkXl5rT2ICA== X-Gm-Gg: ATEYQzwsVOQGB7e195oRBGbMzEB3YgcaH4wycniSUnAYfai+/jxoYfux3qnjfJ2Rkmv GEWxyrfPNXwHIeKEvnibFfAZiOerQjYTElv1lH0BpFOQKhVXgskYJsmwcay/XHHMRq0T6yEJ53K 3bzlTbZaEi7d2o4KmpByzDJgshURDevo5sfA5Gx0J8/bYJVJrbQDJhZlKnP50wqAfVbYhSQaayG 8kdafuJG3qJ6SCRg9EBYkfJvBKC1Y9LAjmz3FNuvlAoY8M8Ry0R6SJMUgfikIDNfllwgLzXBzth x5qPUzo= X-Received: by 2002:a17:907:846:b0:b98:4f24:a6d with SMTP id a640c23a62f3a-b9b502bfd51mr937477666b.11.1774899567358; Mon, 30 Mar 2026 12:39:27 -0700 (PDT) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20260330191611.16929-1-royujjal@gmail.com> In-Reply-To: <20260330191611.16929-1-royujjal@gmail.com> From: Ujjal Roy Date: Tue, 31 Mar 2026 01:09:15 +0530 X-Gm-Features: AQROBzBPKFrWxeTO63V57MZLR93bpDWq5OJl46BKm3EnyddwLm9W3nhW6ZcH4tU Message-ID: Subject: Re: [PATCH net-next v2 0/5] net: bridge: mcast: add multicast exponential field encoding To: "David S . Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Simon Horman , Nikolay Aleksandrov , Ido Schimmel , David Ahern , Shuah Khan , Andy Roulin , Yong Wang , Petr Machata Cc: Ujjal Roy , bridge@lists.linux.dev, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Tue, Mar 31, 2026 at 12:46=E2=80=AFAM Ujjal Roy wro= te: > > Description: > This series addresses a mismatch in how multicast query > intervals and response codes are handled across IPv4 (IGMPv3) > and IPv6 (MLDv2). While decoding logic currently exists, > the corresponding encoding logic is missing during query > packet generation. This leads to incorrect intervals being > transmitted when values exceed their linear thresholds. > > The patches introduce a unified floating-point encoding > approach based on RFC3376 and RFC3810, ensuring that large > intervals are correctly represented in QQIC and MRC fields > using the exponent-mantissa format. > > Key Changes: > * ipv4: igmp: get rid of IGMPV3_{QQIC,MRC} and simplify calculation > Removes legacy macros in favor of a cleaner, unified > calculation for retrieving intervals from encoded fields, > improving code maintainability. > > * ipv6: mld: rename mldv2_mrc() and add mldv2_qqi() > Standardizes MLDv2 terminology by renaming mldv2_mrc() > to mldv2_mrd() (Maximum Response Delay) and introducing > a new API mldv2_qqi for QQI calculation, improving code > readability. > > * ipv4: igmp: encode multicast exponential fields > Introduces the logic to dynamically calculate the exponent > and mantissa using bit-scan (fls). This ensures QQIC and > MRC fields (8-bit) are properly encoded when transmitting > query packets with intervals that exceed their respective > linear threshold value of 128 (for QQI/MRT). > > * ipv6: mld: encode multicast exponential fields > Applies similar encoding logic for MLDv2. This ensures > QQIC (8-bit) and MRC (16-bit) fields are properly encoded > when transmitting query packets with intervals that exceed > their respective linear thresholds (128 for QQI; 32768 > for MRD). > > Impact: > These changes ensure that multicast queriers and listeners > stay synchronized on timing intervals, preventing protocol > timeouts or premature group membership expiration caused > by incorrectly formatted packet headers. > > v2: > - Retargeted the series to net-next as suggested > - Fixed a compilation warning in the MLD rename change > - Kept reverse xmas tree order in IGMP exponential encoding change > - Added bridge selftests to validate IGMPv3 Query MRC and QQIC handling > > Ujjal Roy (5): > ipv4: igmp: get rid of IGMPV3_{QQIC,MRC} and simplify calculation > ipv6: mld: rename mldv2_mrc() and add mldv2_qqi() > ipv4: igmp: encode multicast exponential fields > ipv6: mld: encode multicast exponential fields > selftests: net: bridge: add tests for igmpv3 MRC and QQIC validation > > include/linux/igmp.h | 158 +++++++++++++++- > include/net/mld.h | 179 +++++++++++++++++- > net/bridge/br_multicast.c | 22 +-- > net/ipv4/igmp.c | 6 +- > net/ipv6/mcast.c | 19 +- > .../selftests/net/forwarding/.gitignore | 2 + > .../testing/selftests/net/forwarding/Makefile | 10 + > .../selftests/net/forwarding/bridge_igmp.sh | 109 +++++++++++ > .../selftests/net/forwarding/mc_decode.c | 38 ++++ > .../selftests/net/forwarding/mc_encode.c | 40 ++++ > 10 files changed, 535 insertions(+), 48 deletions(-) > create mode 100644 tools/testing/selftests/net/forwarding/mc_decode.c > create mode 100644 tools/testing/selftests/net/forwarding/mc_encode.c > > > base-commit: cf0d9080c6f795bc6be08babbffa29b62c06e9b0 > -- > 2.43.0 > Forgot to attach test result using bridge_igmp.sh selftest. First two test cases are added newly v3query_mrc_test and v3query_qqic_test= . Without these patches: tools/testing/selftests/net/forwarding# ./bridge_igmp.sh TEST: IGMPv3 query: verify MRC (configured=3D160, expected=3D132) [FA= IL] Bad MRC value in IGMP packet: Max Resp Time: 51.2 sec (0xa0) TEST: IGMPv3 query: verify QQIC (configured=3D160, expected=3D132) [FA= IL] Bad QQIC value in IGMP packet: QQIC: 160 TEST: IGMPv2 report 239.10.10.10 [ OK ] ... With these patches: tools/testing/selftests/net/forwarding# ./bridge_igmp.sh TEST: IGMPv3 query: verify MRC (configured=3D160, expected=3D132) [ O= K ] TEST: IGMPv3 query: verify QQIC (configured=3D160, expected=3D132) [ O= K ] TEST: IGMPv2 report 239.10.10.10 [ OK ] ...