Article View: linux.kernel.netdev
Article #23527Re: [PATCH net] ipv6: advance the serial after rebalancing in fib6_ifup and fib6_ifdown
From: Ralf Lici
Date: Fri, 27 Nov 2026 10:07
Date: Fri, 27 Nov 2026 10:07
49 lines
11473 bytes
11473 bytes
On Thu, 26 Nov 2026 09:13:51 +0100, Ralf Lici <ralf@mandelbit.com> wrote:
> fib6_ifup and fib6_ifdown update the node serial before calling
> rt6_multipath_rebalance. A lookup that runs between the two can select a
> nexthop using the old ECMP upper bounds and read the new serial as its
> cookie. The cached dst then passes dst_check although it was selected
> from the old state, until the next relevant change.
>
> Update the serial after rt6_multipath_rebalance, so that it is published
> only after the routing state it describes. fib6_new_sernum allocates the
> serial with a fully ordered atomic_try_cmpxchg, which orders the
> rebalance before the serial update. The invalidation scope is unchanged:
> fib6_ifup still updates the node and its ancestors, fib6_ifdown only the
> node.
>
> Validating dsts against the generation sampled before the lookup, as
> proposed in "ipv6: validate cached dsts against the netns route
> generation", relies on this order as well: a lookup that reads the new
> generation must also observe the routing change it describes.
>
> Reported by Sashiko while reviewing an earlier version of this change.
>
> Fixes: d7dedee184e7 ("ipv6: Calculate hash thresholds for IPv6 nexthops")
> Fixes: 4bc852006b62 ("ipv6: update route serial number on NETDEV_CHANGE")
> Link: https://lore.kernel.org/netdev/cover.1795642432.git.dahern@nvidia.com/
> Signed-off-by: Ralf Lici <ralf@mandelbit.com>
> Reviewed-by: Xia Yan <yanxia@cmss.chinamobile.com>
Didn't receive Sashiko's review [1] by email this time and it's not on
the list either, not sure why.
Sashiko asks whether the reorder closes the race or only narrows it.
It closes the case described in the commit message: a lookup that runs
entirely between the serial update and the rebalance. A lookup that
selects its nexthop before both writes and reads the cookie after them
is the late cookie sampling race in general, which this patch does not
address on its own. The series in the Link closes it by sampling the
generation before the lookup, and relies on this order to do so, as the
third paragraph says.
I don't think this needs a respin, but I can send a v2 if you'd prefer
the commit message to say this explicitly.
[1] https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261126081353.55240-1-ralf%40mandelbit.com
--
Ralf Lici
Mandelbit Srl
Technical Details
Message-ID:
<20261127100758.254409-1-ralf@mandelbit.com>Path:
mbox-mo1.pugleaf.net!srv.newsdeef.eu!newsfeed.bofh.team!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-372708-linux-kernel-netdev=dewy.ruReferences:
<20261126081353.55240-1-ralf@mandelbit.com>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu!newsfeed.bofh.team!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-372708-linux-kernel-netdev=dewy.ru From: ralf@mandelbit.com (Ralf Lici) Newsgroups: linux.kernel.netdev Subject: Re: [PATCH net] ipv6: advance the serial after rebalancing in fib6_ifup and fib6_ifdown Date: Fri, 27 Nov 2026 11:07:57 +0100 Organization: Usenet Network Message-ID: <20261127100758.254409-1-ralf@mandelbit.com> References: <20261126081353.55240-1-ralf@mandelbit.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Injection-Info: usenet.network; logging-data="727080"; mail-complaints-to="abuse@usenet.network" Cancel-Lock: sha1:mO800SR4R3QBKlmKZu+gNkOx7+A= sha256:aqivVPq64MlCjGWfjpzBzPDdGjRhuQRSm1M6OIEptC8= sha1:o/HY7A+I7QnqKh+12ZrHPmZkOGE= sha256:qlej1ljXn4L1YgGx7/UnTaM1Sa2mv28rF9/b0Ic4/oo= List-ID: <netdev.vger.kernel.org> X-Mailpost-Empty-Hdrs: X-Spam-Level X-Received: from localhost (localhost [127.0.0.1]) by mail.dewy.ru (Postfix) with ESMTP id 5B8EC125F53; Fri, 27 Nov 2026 15:10:33 +0300 (MSK) X-Virus-Scanned: Debian amavisd-new at usenet.network X-Spam-Flag: NO X-Spam-Score: -3.151 X-Spam-Status: No, score=-3.151 tagged_above=-9999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HEADER_FROM_DIFFERENT_DOMAINS=0.249, MAILING_LIST_MULTI=-1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001] autolearn=ham autolearn_force=no X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (2048-bit key) header.d=mandelbit.com X-Received: from mail.dewy.ru ([127.0.0.1]) by localhost (mail.dewy.ru [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id KdrrIB_GaMKm; Fri, 27 Nov 2026 15:10:29 +0300 (MSK) X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.105.105.114; helo=tor.lore.kernel.org; envelope-from=netdev+bounces-372708-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> X-Authentication-Results: OpenDMARC; dmarc=none (p=none dis=none) header.from=mandelbit.com X-Received: from tor.lore.kernel.org (tor.lore.kernel.org [172.105.105.114]) by mail.dewy.ru (Postfix) with ESMTPS id F0D00125F50; Fri, 27 Nov 2026 15:10:19 +0300 (MSK) X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92]) by tor.lore.kernel.org (Postfix) with ESMTP id 70B3D2C5FB; Fri, 27 Nov 2026 12:10:18 +0000 (UTC) X-Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1 X-ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass; t=1795781416; b=2FDUKSzfU+ROzrXGj0mhc/o/dVK59SDJFqXdf/LDDVxLwRLm3nL4yd3Cp1ds7WP/sDDC SoxTEywNaLfYVvtpmm0UO7u15dhJWexN61o9ZDY172wxTkt2oxwWICYEG8SL4N6USQYyW cjt7TF4npQzUssIyMXYyQV3us6rEUOe1Hklx1OM+DXgxYwOXo6i+YlEUQzevnXBW+60cM AIfL6l5zXCUJxHZOamP1Ob0fzbhPF7ou4vccBBCpZBmqKe87ByOj75yksTQtPYj+/WAo9 4lDbzcnEqeebuyMpszf25+0k7f066MAuoNH24Z11cia1uaEk2scrlraALoLUrb2xGTg== X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795781416; h=X-Original-To:Received:DMARC-Filter:Received:DKIM-Signature:From:To: Cc:Subject:Date:Message-ID:X-Mailer:In-Reply-To:References: X-Mailing-List:List-Id:List-Post:List-Help:List-Subscribe: List-Unsubscribe:List-Owner:Precedence:MIME-Version: Content-Transfer-Encoding:X-Rspamd-Queue-Id; bh=xZ8iFlrCt45suSPHlvUZxZAHscsAMzIunGbFGZgXo/Y=; b=C1s3S8kEvwv7nVUjsZ9/h+q+gRY7ERH4OFMTi35E0iNK6lH16C6lqs81CHhY78U/Iunr 9rmYoBGWlgVn+ObiIDWZxP9ymgd1wdr9BDgfYFETjgp8t9e70VV33ed+Lshvrz7/JP2DN B4PpOZbXEWLKRzVV2Y5lCCKudDvjTEkSy56tv74F8Sn69N+VLrCwNS7uOuEVGSJafxzDh Z6vH7ojeRywuWVSDduiDB6c4UL2b6exs4sj5J8XwOFPYcMCibPD63xROsgt4W5l16nQxT AakCYvr+jTSS+9nQ0RrTEeiBlve//9tjC6x+OV8KfBp2HKq5zzE1td3J/TuPUO4T/og== X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dkim=pass header.d=mandelbit.com header.i=@mandelbit.com header.a=rsa-sha256 header.s=MBO0001 header.b=f5MIhrmM; dmarc=none header.from=mandelbit.com; spf=pass smtp.mailfrom=mandelbit.com; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1 X-Received: from localhost.localdomain (localhost [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 6ADCA606A324; Fri, 27 Nov 2026 12:10:16 +0000 (UTC) X-Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key, unprotected) header.d=mandelbit.com header.i=@mandelbit.com header.a=rsa-sha256 header.s=MBO0001 header.b=f5MIhrmM X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=195.10.208.47 X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1795781415; b=gcrxDtx9dRYgKOSOWenxbJC20HMQmAFoCzXUTORBSPCMx93WeVCo2LF2gt8lkeIn0/uH WxXKky9L+du1yicK+U3mNcfjgFl1pKChBivCvizb03GyG87a3S6KQMB1V8kx108ticsq9 dNS8qZNx+aLtBo9zVItwRIf2PhPH70fiGsQDBLA9OIcaCgG7QuL/b7TtOG811gAVAUo/i Du5A/wLfhASafNkfxL/7f92VCTMvkR0x2tFidfZ6OSjDdohq8DnefNU9sB8ViCX0lrfHW TUITtr3St4qMwI0hwBNcj0lzfdG/QZ9nnssDOnPKqcGkWLI1dNf75lt6MjkTZB7uOvw== X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795781415; h=DMARC-Filter:Received:DKIM-Signature:From:To:Cc:Subject:Date: Message-ID:X-Mailer:In-Reply-To:References:MIME-Version: Content-Transfer-Encoding:X-Rspamd-Queue-Id; bh=xZ8iFlrCt45suSPHlvUZxZAHscsAMzIunGbFGZgXo/Y=; b=sPbtD6AU5XsxemrJpa9n+6QkwVOCA6SBDi7crHZV0GtKDp4hIve4+tsmSZ7fX4wohGgL ynR+F9dM1rivE+gekLZTEJPSFE9oPKu3Svr01dnQ39grj/gimDevXUHJh2P3/cfXjaET8 h2GeXXcx8ywJviPYMpma5DYek7OokkfaDUSVgqLIUcEMHErVEFJHC5WaYGM4KHsPZTf4P z9u8Np9Z9Kvfx/LM7sz0ys1M6WQdlL9wb+XR0u9nropGyJKxGMzBOUCpLLVB4NhJCiyg8 WYbPHn4Fm8F/vj0P57LK7KZsC33SNih36/iPsFCuoYLPH6jW0UNXJJtMefb8JnJpcmQ== X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none header.from=mandelbit.com; spf=pass smtp.mailfrom=mandelbit.com; dkim=pass header.d=mandelbit.com header.i=@mandelbit.com header.a=rsa-sha256 header.s=MBO0001 header.b=f5MIhrmM; arc=none smtp.remote-ip=195.10.208.47 X-Received: from mout-b-107.mailbox.org (mout-b-107.mailbox.org [195.10.208.47]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4597C606A31F; Fri, 27 Nov 2026 12:10:13 +0000 (UTC) X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 4597C606A31F X-Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=mandelbit.com X-Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=mandelbit.com X-Received: from smtp102.mailbox.org (smtp102.mailbox.org [IPv6:2001:67c:2050:b231:465::102]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519MLKEM768 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mout-b-107.mailbox.org (Postfix) with ESMTPS id 4jbXKm3Jjvz3xxX; Fri, 27 Nov 2026 13:10:04 +0100 (CET) X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mandelbit.com; s=MBO0001; t=1795781405; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=xZ8iFlrCt45suSPHlvUZxZAHscsAMzIunGbFGZgXo/Y=; b=f5MIhrmM6uWKLLDwlY1YnTf/uTrO4Qk3rmtLf9H96lScGyhouMJDOiFLFMYAPsWf01/HcD Kmkq/VlSEoajKxIXGf83lsDsDXV5OuX6R+Ex4LXz7eSmdbHqYLl4PKd4louDnr6gYVLoFN MXgDmLodTQtBTaNM89n0xLOGEWMngja/jteTsz8Csg4N9W6x//taLGu72fEJvCHTIrhOGp GQXuIII7D1uSEfHG0h0Q2WwP8A90naROm6SK9PilAHFgyDrA8JWWCXi8ixRibf69wVN+Qg Cxko6Zt/QL3rCNQ28PXsyb6hWF26AV0maffWqF5SeYGUy+kPRDMV/CyrZZFcDg== X-Authentication-Results: outgoing_mbo_mout; dkim=none; spf=pass (outgoing_mbo_mout: domain of ralf@mandelbit.com designates 2001:67c:2050:b231:465::102 as permitted sender) smtp.mailfrom=ralf@mandelbit.com X-Cc: netdev@vger.kernel.org, David Ahern <dsahern@kernel.org>, Ido Schimmel <idosch@nvidia.com>, "David S. Miller" <davem@davemloft.net>, Eric Dumazet <edumazet@kernel.org>, Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>, Willem de Bruijn <willemb@google.com>, Simon Horman <horms@kernel.org>, Sagarika Sharma <sharmasagarika@google.com>, Kuniyuki Iwashima <kuniyu@google.com>, Xia Yan <yanxia@cmss.chinamobile.com>, linux-kernel@vger.kernel.org X-Mailer: git-send-email 2.56.0 X-In-Reply-To: <20261126081353.55240-1-ralf@mandelbit.com> X-Mailing-List: netdev@vger.kernel.org X-List-Post: <mailto:netdev@vger.kernel.org> X-List-Help: <mailto:netdev+help@vger.kernel.org> X-List-Subscribe: <mailto:netdev+subscribe@vger.kernel.org> X-List-Unsubscribe: <mailto:netdev+unsubscribe@vger.kernel.org> X-List-Owner: <mailto:netdev+owner@vger.kernel.org> X-Precedence: list X-Rspamd-Queue-Id: 4jbXKm3Jjvz3xxX