From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wm1-f53.google.com (mail-wm1-f53.google.com [209.85.128.53]) (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 480F53C0607 for ; Fri, 9 Oct 2026 09:50:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.53 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1791539458; cv=none; b=TJGCCVMlDo/GHp0QyLHFjKuRY0u2KZx/6OOXMqcIQeWmW6MngM4C/XSWtrSGPSZulBT7EcLpmMxfo77qPslxerFsoJcXjV/MPFmP8QD3DRhbKjEiqFaXKdhrajVyh/P3okb3Bwv8HX7RDQaM1XsH5YZVwQBRXT6sGG7TTdxEUFU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1791539458; c=relaxed/simple; bh=Yz6wuPAWR3FnxaZD/Hsy6uS1+1e7lH+YUjWeAZdItXM=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=s+6tEa7i/LjpzMI+Zqbmm4c3cIllpA3AMyShsV5WaUqU+Zsj5JST4Vc91MsMS1r+xo3di90yDddIsQyjfBbpAbfOtntuaVabxGk4g4lvMV2PABewDRS477T3U91nUxgxsJjI3bcdguK/H36ibTSN3DtiZPx0GfTKBbqmYlo0A3o= 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=HJOGT9n/; arc=none smtp.client-ip=209.85.128.53 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="HJOGT9n/" Received: by mail-wm1-f53.google.com with SMTP id 5b1f17b1804b1-49d04e4a943so1775855e9.2 for ; Fri, 09 Oct 2026 02:50:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=6wind.com; s=google; t=1791539455; x=1792144255; 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=mkuIOGDPXPuT/7Tp+eZvAIWGyivfRf31PISNCWLWipU=; b=HJOGT9n/exi7W6Ub/a7/97Ih7XhdRTGSAzdhav22oypY2OoixR7XQGTM58UD6zaq4+ QrUneJt1T2XlDLlvNl4oMavkpIkcdQBK4atg47nGl1y5xl17xKxJUf0ITs6t8AP2YODh 9emns+a+2aRnOQgamI4y/qh001sX0OMmtGYuokvfFh+ZHPY/122jQo6Qnh0BL2h8WFOb D5a9OX/de3ZP6u0nd0ZLF0H9dOCTQQQtGMc/D5mfVBUhi6R2onzjhKHQIokNHEcoZkTO 69neR0pTzLXIXqNWuSKgX4vkeRCeUJb7zkLvZkMOR8eIbqhlM4D9qoWYonx36r8d3VSe B0TA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1791539455; x=1792144255; 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=mkuIOGDPXPuT/7Tp+eZvAIWGyivfRf31PISNCWLWipU=; b=NkY6sjIgvvZyuarmszXIPxTkTduKygZBXKyZa6uKeE04IwCibVxGCl217m6fEY0/3s /XSynnAkFK3jlBC3Rf9fpQmuooj8yEpAXjiJ7TEvE/2b131eAiy9oCMJ5tNw3cnwdcCv b0sa4J2LrJTt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TP id 5b1f17b1804b1-4a18e47e330mr25254745e9.2.1791539455518; Fri, 09 Oct 2026 02:50:55 -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-4a18bea1021sm44280795e9.10.2026.10.09.02.50.54 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 09 Oct 2026 02:50:55 -0700 (PDT) Message-ID: <5d0a21f2-0a7c-4c66-a3c8-e4290dfc0e13@6wind.com> Date: Fri, 9 Oct 2026 11:50:54 +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 3/6] net: add a generation counter for dev->mc changes 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-4-sigefriedhyy@gmail.com> From: Nicolas Dichtel Content-Language: en-US Organization: 6WIND In-Reply-To: <20261007115821.11332-4-sigefriedhyy@gmail.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Le 07/10/2026 à 13:58, Yuyang Huang a écrit : > A multi-part RTM_GETMULTICAST dump of dev->mc resumes by position, so > entries added or removed between two dump rounds can be skipped or > repeated. The IPv4 and IPv6 dumps report that with NLM_F_DUMP_INTR by > stamping cb->seq from a per netns generation counter combined with > dev_base_seq, see inet_base_seq(). > > Add the equivalent for the device multicast lists: a per netns counter > bumped whenever an entry is added to or removed from any dev->mc. The > list helpers do not know which device a list belongs to, so give > netdev_hw_addr_list an mc_dev pointer, set for dev->mc only, and bump > the counter of dev_net(mc_dev) from the count helpers. That covers the > dev_mc_* helpers, both lists of a sync, the hardware sync helpers > drivers call from their rx mode callbacks or their own workers and the > reconciliation after an asynchronous rx mode update. It is atomic > since the writers only hold the address lock of their own device. > > Used by the following patch for the AF_PACKET multicast dump. > > Signed-off-by: Yuyang Huang Reviewed-by: Nicolas Dichtel