🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #10147

[PATCH net v2 0/3] net: ioam6: makes IOAM insertion transparent to IPv6 ECMP

#10147
From: Hangbin Liu
Date: Tue, 03 Nov 2026 09:20
80 lines
11618 bytes
This series makes IOAM insertion transparent to IPv6 ECMP, as required
by RFC 9486 (C2): a packet carrying IOAM options must be forwarded
along the same path as the identical packet without them.

Patch 1 fixes the transit side: hash policy 0 hashed the raw IPv6
nexthdr, which becomes NEXTHDR_HOP once an IOAM Hop-by-Hop header is
inserted. The policy-0 key (and the ICMPv6-error flow selection) now
uses the nexthdr the packet would have had if the Hop-by-Hop header
carried only IOAM options and padding.

Patch 2 fixes the injecting node: on an ioam6 output destination-cache
miss, inline mode now reuses orig_dst so the ECMP sibling from the
original socket lookup is kept (the destination does not change).
Encapsulation may switch the destination to tundst, so it still
re-looks up the transformed packet, using the Hop-by-Hop nexthdr for
flowi6_proto (IPPROTO_IPV6 after encap) and precomputing fl6.mp_hash
from the packet so ICMPv6 quoted-flow and L4 keys are not lost when
ip6_route_output() runs with no skb.

Patch 3 adds selftests/net/ioam6_ecmp.sh, covering both places: a
transit forwarder with a multipath route, and an encapsulating node
compared against a plain ip6ip6 baseline.

The issue was found while reviewing RFC9486. It can be reproduced and
verified by the newly added ioam6_ecmp.sh test.

Tested with:
ecmp_rehash.sh
fib_nexthops.sh
ioam6_ecmp.sh
tcp_ecmp_failover.sh
forwarding/gre_inner_v4_multipath.sh
forwarding/gre_inner_v6_multipath.sh
forwarding/gre_multipath_nh_res.sh
forwarding/gre_multipath_nh.sh
forwarding/gre_multipath.sh
forwarding/ip6gre_inner_v4_multipath.sh
forwarding/ip6gre_inner_v6_multipath.sh
forwarding/router_mpath_nh_res.sh
forwarding/router_mpath_nh.sh
forwarding/router_multipath.sh

---
Changes in v2:
- patch 01:
  * use skb_network_offset() as the start of offset.
  * try get inner next header for ICMPv6 errors.
- patch 02:
  * use origin dst for inline mode, as dst is not changed.
  * use HBH nexthdr for encap mode, as dst may change to tundst.
- patch 03:
  * remove `-w` to prevent ping from ignoring `-c` and continuing to send
    packets before receiving replies.
  * remove beta_tnl warm up since the tunnel will be re-create every time.
  * move trap cleanup before setup
  * update some comments
  * remove tunsrc in ioam encap setup
- Link to v1: https://patch.msgid.link/20261028-ipv6_ioam_ecmp-v1-0-9b6715b6f4c0@kylinos.cn

---
Hangbin Liu (3):
      ipv6: route: consider IOAM options in ECMP hash policy 0
      ipv6: ioam6: use transformed packet nexthdr for ECMP re-lookup
      selftests: net: add ioam6 ECMP test (RFC 9486 C2)

 include/uapi/linux/in6.h                  |   1 +
 net/ipv6/ioam6_iptunnel.c                 |  79 ++++---
 net/ipv6/route.c                          |  95 +++++++-
 tools/testing/selftests/net/Makefile      |   1 +
 tools/testing/selftests/net/config        |   2 +
 tools/testing/selftests/net/ioam6_ecmp.sh | 348 ++++++++++++++++++++++++++++++
 6 files changed, 495 insertions(+), 31 deletions(-)
---
base-commit: c3e67bd82b9b9b1a5118f09a429ccefe2aab0741
change-id: 20261020-ipv6_ioam_ecmp-ae4ef0a4bdae

Best regards,
--  
Hangbin Liu <liuhangbin@kylinos.cn>
Technical Details
Message-ID: <20261103-ipv6_ioam_ecmp-v2-0-6ef0318bdb5e@kylinos.cn>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-355317-linux-kernel-netdev=dewy.ru

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-355317-linux-kernel-netdev=dewy.ru
From: hangbin.liu@linux.dev (Hangbin Liu)
Newsgroups: linux.kernel.netdev
Subject: [PATCH net v2 0/3] net: ioam6: makes IOAM insertion transparent to
 IPv6 ECMP
Date: Tue, 03 Nov 2026 17:20:49 +0800
Organization: Usenet Network
Message-ID: <20261103-ipv6_ioam_ecmp-v2-0-6ef0318bdb5e@kylinos.cn>
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 7bit
Injection-Info: usenet.network;
	logging-data="3131207"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:XJLCh6PB979hGbquRwIymI/bfg0= sha256:RUL05xbLj9kzv4/TcAVv9ipeNFqR6hTRGNTVDFm6/sI=
	sha1:AmKE7x8GWUQbe8oKTmyN6Hf/v3o= sha256:sP/Kr7JKpqwFo6sL1GdFaMZlWji/m0dzToUnbHKh9s8=
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 AD10C112796; Tue,  3 Nov 2026 12:27:27 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -3.051
X-Spam-Status: No, score=-3.051 tagged_above=-9999 required=6.31
	tests=[DCC_REPUT_70_89=0.1, 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 (1024-bit key)
	header.d=linux.dev
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 37v0AZSSAzma;
	Tue,  3 Nov 2026 12:27:24 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-355317-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> 
X-Authentication-Results: OpenDMARC; dmarc=fail (p=none dis=none) header.from=linux.dev
X-Received: from sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10])
	by mail.dewy.ru (Postfix) with ESMTPS id CDB72112792; Tue,  3 Nov 2026 12:27:13 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92])
	by sea.lore.kernel.org (Postfix) with ESMTP id 0A1652B306; Tue,  3 Nov 2026 09:21:20 +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=1793697679;
	b=igt+Hqv6R6aHl5WtesVR48TxB2euc5bwuStSc2IyILxdHICznqVFjvkFL6zmyb0CsoAK
	 X1DL2rtm2THYMaPKWlF2Pos+5ZHsVG4FAXjCYveY5KFSi0kaHLZx86x+C77eGpFSalVHi
	 qnratT7D6YW4IT3rPsnQj5iXe5AoMysrpszpwipsWHOM9miCn+8oSgwgjBsWSS/NeJ1F+
	 enlcr8zplDVcPxRkR1Xz3Uxo2DEGffQ43XfJF8lnAjaFM/gQFUZ+2WBUEus+6hpzJhFRF
	 5OBHXPPrlErh94z0ccks2w6rrEhOfR1HUtfVdwAtBHzCrPRFWoc9L80zF+plrOMmaSA==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1793697679;
	h=X-Original-To:Received:DMARC-Filter:X-Envelope-To:DKIM-Signature:
	 X-Envelope-To:Received:X-Mizu-Trace-ID:X-Migadu-Flow:From:Subject:
	 Date:Message-Id:X-Mailing-List:List-Id:List-Post:List-Help:
	 List-Subscribe:List-Unsubscribe:List-Owner:Precedence:MIME-Version:
	 Content-Type:Content-Transfer-Encoding:X-B4-Tracking:X-Change-ID:To:
	 Cc:X-Mailer;
	bh=9seIfKUb5mL9/pRiltJe+WDkz9VAJT3ACyumajU4uZs=;
	b=EeAPOyuTFQXqyDjfJWnfbkUcleM8O9XmshW2cOTtfuu6yhIc6fLrfUUJaHmc8z1xVV7F
	 Vd3uf7AZ8ZsAZNcjHqpiNM/GsTflHldNJWTm0KEH60J1wRlc9QlGgBuOqT6V8FZcvxnGn
	 PW0A4Na0tfB8UnuOKzREfvXpGdzHXbRJrKbWK7Bv/HQ00xyRWKEchS9QlK6/CBNdwzl6G
	 aGOmRyFhyTIvmKunU9WDqKluZbGMbCTGw4F9lji8SJ25+V8V8N17oxa2lK5fh06zepSwL
	 KpI1ZhAenGaHnjlLS4GvyQWn6XDTJCfXyb1KWfDol5OrWzZgE2xLlntw1r2jvsBbbgA==
X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; 
	dkim=pass header.d=linux.dev header.i=@linux.dev header.a=rsa-sha256 header.s=key1 header.b=I0mgW61i;
	dmarc=pass header.from=linux.dev;
	spf=pass smtp.mailfrom=linux.dev;
	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 67C65606A332;
	Tue,  3 Nov 2026 09:21:19 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org;
	dkim=pass (1024-bit key, unprotected) header.d=linux.dev header.i=@linux.dev header.a=rsa-sha256 header.s=key1 header.b=I0mgW61i
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=95.215.58.46
X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none;
	t=1793697678;
	b=KazXWSgQLwxinBkGr2HpE4xTFugLIWBLjUH+5CQUVmynYNZEtjiXGsAKdeiceAU2hzbp
	 MaQnAwCOAWRbyV9dhuy2QX9KE0zqFMSb6fJJiCHzxWlluARcgHLQy74+FEs8BrUB/C2jU
	 sxWA/Zt1bq+C9qAi55q1XeamO8f6/Hdr7Tpj1AXWh3jVHYBtdBt8WAcntk1mEYwPhXw0m
	 lRbXWjNr+gCFGoQGJ22Sa9ExqBs2SYn1Nhy3IxnaQchYRVhk5MgJmfDseixKIdj7sn5Rb
	 ErTmj8a1AHDjXDaIyPPngCB5Ixr39vyK1wWsw5iv7iDU8oNp1+9c4KKSnmdOLePRmcQ==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1793697678;
	h=DMARC-Filter:X-Envelope-To:DKIM-Signature:X-Envelope-To:Received:
	 X-Mizu-Trace-ID:X-Migadu-Flow:From:Subject:Date:Message-Id:
	 MIME-Version:Content-Type:Content-Transfer-Encoding:X-B4-Tracking:
	 X-Change-ID:To:Cc:X-Mailer;
	bh=9seIfKUb5mL9/pRiltJe+WDkz9VAJT3ACyumajU4uZs=;
	b=kUirAHFv8myLjoCllo12TDXQz2wqweIiG4JPTEQlld7VB4n0qDvzC58tpLtuwSGHx07g
	 stPrUsq946VLRbqlu7/9Y/NT9L8p5B4Ye+14B/IvrtIci5TdTLRDnLCbAAcQYi5tP5Kif
	 RQaWYYsqVu5TVVLHUWhDBK4nRXiKe4eLYLAwQJJ9Ay0sJ/oSPB+FBOZ+z9Mqwo0ym6euw
	 Jbn6F+S1QxU1tmbFx/+ZYWASUVvMT2esDglGFzC9/MAKDVxS+VC8o+uMqOcEIA+saH7ha
	 wJ8I8r+WY46gQ20J/Nk1K7PJPlFBssnljqnl6s78ATiBVcYMQyovUijbIN2gfnj9FFQ==
X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; 
	dmarc=pass header.from=linux.dev;
	spf=pass smtp.mailfrom=linux.dev;
	dkim=pass header.d=linux.dev header.i=@linux.dev header.a=rsa-sha256 header.s=key1 header.b=I0mgW61i;
	arc=none smtp.remote-ip=95.215.58.46
X-Received: from mta1.migadu.com (out-46.mta1.migadu.com [95.215.58.46])
	(using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)
	 key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256)
	(No client certificate requested)
	by smtp.subspace.kernel.org (Postfix) with ESMTPS id 38274606A327
	for <netdev@vger.kernel.org>; Tue,  3 Nov 2026 09:21:16 +0000 (UTC)
X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 38274606A327
X-Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev
X-Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev
X-Envelope-To: netdev@vger.kernel.org
X-DKIM-Signature: a=rsa-sha256; bh=Dogg26upRcYPteVZYsSyT1265sb9gcafjUHnbvF97og=;
 c=simple/simple; d=linux.dev;
 h=from:to:subject:date:message-id:mime-version:content-type; s=key1;
 t=1793697675; v=1; x=1794302475;
 b=I0mgW61inAYftsexWS2+OTxq41aS9OM4setyUhQfKYaBmWfTJytrcMqojQ0HODeozLwBPc8B
 F2sx/UdNm9jEmk4u1B8Ym+o8SjPVTsrOktNVM0L/K66HIL7G9pqJIfOc53Pz+vjek0BaOQevYR5
 dfLHkzjveKcQhLRg/Iyy8nb4=
X-Envelope-To: netdev@vger.kernel.org
X-Received: by mta10.migadu.com with ESMTPS id 6dbf83cf33588557;
	Tue, 03 Nov 2026 09:21:15 +0000
X-Mizu-Trace-ID: 6dbf83cf33588557
X-Migadu-Flow: FLOW_OUT
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-B4-Tracking: v=1; b=H4sIAAAAAAAC/12Nyw6CMBREf4XctTVtg/Wx4j8MIW25yFVpSYuNh
 PDvArpyeSYzcyaIGAgjXLIJAiaK5N0CcpeBbbW7IaN6YZBcKsElZ9QnVZHXXYW265nGHBuuc1N
 rhGXUB2zovR1eweEA5TeML3NHO6xXa62lOPgwbtoktvLPcPo3JME4Oxt1FAejmtzy4jE+yfm4t
 w7KeZ4/uK+fcMQAAAA=
X-Change-ID: 20261020-ipv6_ioam_ecmp-ae4ef0a4bdae
X-Cc: Hangbin Liu <hangbin.liu@linux.dev>, linux-kernel@vger.kernel.org, 
 netdev@vger.kernel.org, linux-kselftest@vger.kernel.org, 
 Hangbin Liu <liuhangbin@kylinos.cn>
X-Mailer: b4 0.16.0