Received: by 2002:a05:6358:489b:b0:bb:da1:e618 with SMTP id x27csp5581334rwn; Mon, 12 Sep 2022 11:08:51 -0700 (PDT) X-Google-Smtp-Source: AA6agR7gYBDBExd0yK9MgzFoktZkEcDTRNQ4oK2/wHWxxU8VO6g+Ov1xqtfoLP3FqCVO26k2y6oF X-Received: by 2002:a05:6402:1f8c:b0:43e:8fab:76c with SMTP id c12-20020a0564021f8c00b0043e8fab076cmr22976236edc.126.1663006131152; Mon, 12 Sep 2022 11:08:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1663006131; cv=none; d=google.com; s=arc-20160816; b=L29hlD0gyLKUOpZFHYL4O5pNfUpwGjSVrVV2Bo8U64jhxVQG92Ithv4RDIMxx8y0WV E2Be4La6SXTONYUVJy+p+WxQXB2rDMCILbjNkY8ySTwmcmM81m2RSo04ghver7mPzoUu SamcAEIl8wD/IoNyWSgHpO16FUUl8DWe49Yvn32THTR1aJwNHYFWZcaNS/NO+NaBm9FV XqU6EcytxhR16AKv4QxtaKh60WwblC+usfRDv1AcEp714Cno/UdeatlW2fcIL2jG2XFZ YtON5QeKjkeq/XYwU//yctM9T00IDb6F6YKklGcXGRvy6bq9+RP8XqySgW0sruoWvFM7 2qAQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=vH58n+rhXToxw4S/zr1apABtQoXVnZ5r2SSqPP0H7jM=; b=g3l5Jd3C56EgcMcSEgd3c4/TsR08RvMnuZoE90HpcMStBnrCtNwJK9fvXwD4SzNDHb DPE9wcZfF11EBj25+kl7pMUhpIOE0buWU+OYz1NdaemuBfOENi3jTvSUni6HRB1spnuo cmx/B+weP9PNOZGocdIDx1vruuQfN2IG5fvABU+vOzGM7JBLP3iLLdpZBBkWywJYmclM rN3lH9Iec4PaIxch1N61M/IZi3Ew76N1IajoCL1iku8N7BCUZN+Vl6R4NJxJY7CWENkA YLxz7ixz+AWkuHsTjoZ+3tt7Si1+0zRubGLp95bV1YeMjdAGlST69M3nFbi5ZKAubxkG 4c6Q== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=uniroma2.it Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id nd27-20020a170907629b00b00779f84dbe5fsi8887541ejc.385.2022.09.12.11.08.25; Mon, 12 Sep 2022 11:08:51 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=uniroma2.it Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229869AbiILSF2 (ORCPT + 99 others); Mon, 12 Sep 2022 14:05:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51142 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229735AbiILSFZ (ORCPT ); Mon, 12 Sep 2022 14:05:25 -0400 X-Greylist: delayed 601 seconds by postgrey-1.37 at lindbergh.monkeyblade.net; Mon, 12 Sep 2022 11:05:22 PDT Received: from smtp.uniroma2.it (smtp.uniroma2.it [160.80.6.16]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A74D227DDA; Mon, 12 Sep 2022 11:05:19 -0700 (PDT) Received: from localhost.localdomain ([160.80.103.126]) by smtp-2015.uniroma2.it (8.14.4/8.14.4/Debian-8) with ESMTP id 28CHGubU031029 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT); Mon, 12 Sep 2022 19:16:57 +0200 From: Andrea Mayer To: "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Hideaki YOSHIFUJI , David Ahern , Shuah Khan , linux-kernel@vger.kernel.org, netdev@vger.kernel.org, linux-kselftest@vger.kernel.org, bpf@vger.kernel.org Cc: Stefano Salsano , Paolo Lungaroni , Ahmed Abdelsalam , Andrea Mayer Subject: [net-next v2 0/3] seg6: add NEXT-C-SID support for SRv6 End behavior Date: Mon, 12 Sep 2022 19:16:16 +0200 Message-Id: <20220912171619.16943-1-andrea.mayer@uniroma2.it> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Virus-Scanned: clamav-milter 0.100.0 at smtp-2015 X-Virus-Status: Clean X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The Segment Routing (SR) architecture is based on loose source routing. A list of instructions, called segments, can be added to the packet headers to influence the forwarding and processing of the packets in an SR enabled network. In SRv6 (Segment Routing over IPv6 data plane) [1], the segment identifiers (SIDs) are IPv6 addresses (128 bits) and the segment list (SID List) is carried in the Segment Routing Header (SRH). A segment may correspond to a "behavior" that is executed by a node when the packet is received. The Linux kernel currently supports a large subset of the behaviors described in [2] (e.g., End, End.X, End.T and so on). Some SRv6 scenarios (i.e.: traffic-engineering, fast-rerouting, VPN, mobile network backhaul, etc.) may require a large number of segments (i.e. up to 15). Therefore, reducing the size of the SID List is useful to minimize the impact on MTU (Maximum Transfer Unit) and to enable SRv6 on legacy hardware devices with limited processing power that can suffer from long IPv6 headers. Draft-ietf-spring-srv6-srh-compression [3] extends the SRv6 architecture by providing different mechanisms for the efficient representation (i.e. compression) of the SID List. The NEXT-C-SID mechanism described in [3] offers the possibility of encoding several SRv6 segments within a single 128 bit SID address. Such a SID address is called a Compressed SID Container. In this way, the length of the SID List can be drastically reduced. In some cases, the SRH can be omitted, as the IPv6 Destination Address can carry the whole Segment List, using its compressed representation. The NEXT-C-SID mechanism relies on the "flavors" framework defined in [2]. The flavors represent additional operations that can modify or extend a subset of the existing behaviors. In this patchset we extend the SRv6 Subsystem in order to support the NEXT-C-SID mechanism. In details the patchset is made of: - patch 1/3: add netlink_ext_ack support in parsing SRv6 behavior attributes; - patch 2/3: add NEXT-C-SID support for SRv6 End behavior; - patch 3/3: add selftest for NEXT-C-SID in SRv6 End behavior. The corresponding iproute2 patch for supporting the NEXT-C-SID in SRv6 End behavior is provided in a separated patchset. Comments, improvements and suggestions are always appreciated. Thank you all, Andrea [1] - https://datatracker.ietf.org/doc/html/rfc8754 [2] - https://datatracker.ietf.org/doc/html/rfc8986 [3] - https://datatracker.ietf.org/doc/html/draft-ietf-spring-srv6-srh-compression v1 -> v2: - rename misleading variable names and macros, using the suffix '_bits' instead of '_len', e.g. 'lcblock_len'->'lcblock_bits'; - remove unnecessary cast operations; - get rid of the 'yoda-style' syntax; - fix check for default C-SID configuration at compilation time; - add selftest for NEXT-C-SID in SRv6 End behavior. Thanks to Paolo Abeni for reviewing v1. Andrea Mayer (3): seg6: add netlink_ext_ack support in parsing SRv6 behavior attributes seg6: add NEXT-C-SID support for SRv6 End behavior selftests: seg6: add selftest for NEXT-C-SID flavor in SRv6 End behavior include/uapi/linux/seg6_local.h | 24 + net/ipv6/seg6_local.c | 379 +++++- tools/testing/selftests/net/Makefile | 1 + .../net/srv6_end_next_csid_l3vpn_test.sh | 1145 +++++++++++++++++ 4 files changed, 1530 insertions(+), 19 deletions(-) create mode 100755 tools/testing/selftests/net/srv6_end_next_csid_l3vpn_test.sh -- 2.20.1