From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wm1-f48.google.com (mail-wm1-f48.google.com [209.85.128.48]) (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 9DE5834B1A6 for ; Fri, 9 Oct 2026 09:57:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.48 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1791539858; cv=none; b=akxCPViBabANOZTcz0KIceNqh04zVjs1Dul53FQ1dEs5g9+Ug2RKwLNIhGzwJXa8hnckWgi0yv/s5as5Zx70+Ilj4FLRxSh4IJgCBMUPzlxskcC9hkIa+IuF38pt/J8gog9XJn+R0Fnlp7tz1onjW4Du8cPb2dyXLAyvuuBmaSw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1791539858; c=relaxed/simple; bh=CZUowsiS7R3v4ktfIQO8p3SnSSmC+DnEiusOSgtwtAM=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=r3xoiqV9nztjAa/+RUhu7D28fAuwHpY3WMBc6MpnrkEyEwJk2cT40ORD1Y21cBc4KuOToKKI/cE6eQt1RTrAiTMkNh+ntoHKs4nGXLHlFY5tGbMIc9VZ4o7I+Mcy4kes981AFqKMfHDY6b6v54kSSaZLHJeUO3ja2MWAcz78/v0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=6wind.com; spf=pass smtp.mailfrom=6wind.com; dkim=pass (2048-bit key) header.d=6wind.com header.i=@6wind.com header.b=O/ll95+S; arc=none smtp.client-ip=209.85.128.48 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=6wind.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=6wind.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=6wind.com header.i=@6wind.com header.b="O/ll95+S" Received: by mail-wm1-f48.google.com with SMTP id 5b1f17b1804b1-4a018485638so1763225e9.1 for ; Fri, 09 Oct 2026 02:57:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=6wind.com; s=google; t=1791539855; x=1792144655; darn=vger.kernel.org; h=content-transfer-encoding:content-type:in-reply-to:organization :content-language:from:references:cc:to:subject:reply-to:user-agent :mime-version:date:message-id:from:to:cc:subject:date:message-id :reply-to:content-type; bh=jGNJK6cAv9yzUM3Gu9HFHfD/WcVYclzAOKq5nlTYmA8=; b=O/ll95+SfflFZAIxpt/1tMgMelVC8gKxMphm/OQMShzMCK/QlBOtkM9GypG6vl4/de aTlDNODTEaycVihPeb83cssSrY7kmUEOEBX8Lj/0HLi15lHQdI4xh2TEvkTDZrjDIwNM 0QwkIWwTQ1HBHQ9Bq36dKeo0vjsVXdspFGgAViLguI46cJgtkll/KOtD4caWJqc1iaSJ 8TEb66NC3V3lRwCUZolx3h9gS59mdTB3FEcoYLMt6z/TBJcM3cO2nQ9dYdNabCmRt0iF fRHjKouERBck5yp1MopHm3Y6RZRBuOwl/Eg+gARn3zZNjkNr7xfwWleC5eimTd3jkVM2 Y/oQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1791539855; x=1792144655; h=content-transfer-encoding:content-type:in-reply-to:organization :content-language:from:references:cc:to:subject:reply-to:user-agent :mime-version:date:message-id:x-gm-gg:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to:content-type; bh=jGNJK6cAv9yzUM3Gu9HFHfD/WcVYclzAOKq5nlTYmA8=; b=sKz5XshyKQI1uZswZ366HViJsb6hV9XbLnXesAqJCfMVZ/YgLikvNAtY1Ztor+f8xd 8/dtAQcDu5cJtepoHgGVYbMx42DHCLXmpZYjkU8TRry+A0Sx0bnQKKZrRtKkPTesvC1I bBN83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a1:7dcf:be1f with SMTP id 5b1f17b1804b1-4a18e476022mr25383075e9.1.1791539854893; Fri, 09 Oct 2026 02:57:34 -0700 (PDT) Received: from ?IPV6:2a01:e0a:ab7:2110:6a1d:efff:fe52:1959? ([2a01:e0a:ab7:2110:6a1d:efff:fe52:1959]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4a18e49792bsm59188805e9.4.2026.10.09.02.57.33 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 09 Oct 2026 02:57:34 -0700 (PDT) Message-ID: <9c5e6623-ccd3-4570-a5d0-313e09f9bb62@6wind.com> Date: Fri, 9 Oct 2026 11:57:33 +0200 Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Reply-To: nicolas.dichtel@6wind.com Subject: Re: [PATCH net-next v10 4/6] net: add AF_PACKET multicast dumps To: Yuyang Huang Cc: Ajay Singh , Aleksandr Loktionov , Andrew Lunn , Claudiu Beznea , "David S. Miller" , David Ahern , Donald Hunter , Eric Dumazet , Ido Schimmel , Jacob Keller , Jakub Kicinski , Johannes Berg , Kees Cook , Kory Maincent , Kuniyuki Iwashima , Nikolaos Gkarlis , Paolo Abeni , Sabrina Dubroca , Shuah Khan , Simon Horman , Stanislav Fomichev , Vadim Fedorenko , Willem de Bruijn , linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-wireless@vger.kernel.org, netdev@vger.kernel.org References: <20261007115821.11332-1-sigefriedhyy@gmail.com> <20261007115821.11332-5-sigefriedhyy@gmail.com> From: Nicolas Dichtel Content-Language: en-US Organization: 6WIND In-Reply-To: <20261007115821.11332-5-sigefriedhyy@gmail.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Le 07/10/2026 à 13:58, Yuyang Huang a écrit : > RTM_GETMULTICAST dumps IPv4 and IPv6 multicast group memberships, but > the device multicast list (dev->mc) is only available through > /proc/net/dev_mcast, so "ip maddr show" still has to parse procfs for > its link-layer entries. > > Handle RTM_GETMULTICAST dumps with ifa_family set to AF_PACKET next to > the dev->mc helpers in dev_addr_lists.c and report every entry of > dev->mc in the existing ifaddrmsg format: > > - IFA_MULTICAST carries the raw link-layer address > - IFA_MC_USERS carries the entry reference count > - IFA_F_GLOBAL in IFA_FLAGS reports netdev_hw_addr::global_use, set > by dev_mc_add_global() (SIOCADDMULTI) and dev_mc_add_excl() > ("bridge fdb add ... self"), i.e. entries added explicitly rather > than by a protocol join. This is the static column of > /proc/net/dev_mcast > - ifa_scope is RT_SCOPE_LINK > > This covers every column of /proc/net/dev_mcast. AF_PACKET is the > family iproute2 already uses for link-layer addresses ("ip -0"). > > The default FDB dump also walks dev->mc, but only for Ethernet devices > and only if the driver uses it, vxlan for example does not, and it has > no users count or global_use bit. Extending it would change "bridge fdb > show" output and add NDA_* attributes. > > Requests are always validated, there are no legacy users: prefixlen, > flags and scope must be zero, ifa_index selects one device and > IFA_TARGET_NETNSID is the only attribute accepted. The dump runs under > RCU and netif_addr_lock_bh() without RTNL. After each round cb->seq is > set from the dev->mc generation counter and dev_base_seq and checked > like rtnl_dump_ifinfo() does, so an entry added or removed since the > previous round sets NLM_F_DUMP_INTR. > > Signed-off-by: Yuyang Huang Reviewed-by: Nicolas Dichtel