From patchwork Mon Jul 31 17:51:15 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrea Mayer X-Patchwork-Id: 12895 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:918b:0:b0:3e4:2afc:c1 with SMTP id s11csp2210190vqg; Mon, 31 Jul 2023 12:05:47 -0700 (PDT) X-Google-Smtp-Source: APBJJlEnkQ800IsSJCWmYsoIFpFZXEoZdzqMFahWZBJP7E++PhN0Qxp2DPIuACTRFVSCIsRMB0Gn X-Received: by 2002:a17:90a:2a48:b0:263:ac11:c6d2 with SMTP id d8-20020a17090a2a4800b00263ac11c6d2mr9461789pjg.25.1690830346942; Mon, 31 Jul 2023 12:05:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690830346; cv=none; d=google.com; s=arc-20160816; b=bt4rpPnbwjBe1SBg0euJZ0/CjGysOvheGlVAom8h4Y7SR04bUluGG6jVW5ZdGSmMXs eBEm/nzyGvH/MndWOl45sD7dNlJ2cS/dGDNj8SjoR2crQP1qHlBrOfZntrgHY9qX4w1D 14SU0eBncktx+0GxFKq/7uhxDRNDIH8ivmL/wkTfBIh75x0iPZwFXKDF8FIBG1vzo3Wr BM8aKspbsbnumY0IET+1uufLl228EogjpWBsOtO297oAQfO16cm6ZI/8Eq2CDLImdqx6 DrQQPJNTaQGPHjqBV6soLbZfxiz6RtThLLgGewVIr4HWx90zPgGVKKeEl4OViG+RC8un YTTw== 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=16zVxKBIwUuP9g5S+m71auP9K1+DiHuvza6WKsV4wKY=; fh=gXBtgxK+TVgbTEWn3KR1PBLviwdQbbcA0VBv0gQXY2M=; b=CMSShETG9DNHOJY2EDEdqh0/DC2BxuJRYyKYzz/gJXQPNg1HUfAhhF87fPEyEKHnIa 8huMBor1RYsCu1CW6/yt9IwUaFx11fzf7WJYURky3lcDps8PiI8GOBNN68fTSGWzMQ+F DmWMlyl12xrGGLF+8+C+aT92eHVja+6FsW+Ir4ZxX10V8+6l9qBVnOoswv1qtl2nyjVk YDbC8n09tA7fs3I4xcOsorz9MQZFOqhnubYxhaxEaMaN5+HbK4dvJ0AADHChh8EtZU9u R53Vf632UI244DOU0dKm4dxTufIHQuu4VYZr2d5XCbaGygSmBdrP1VO4nmDUKdmn2uYC wOQg== 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 Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id n15-20020a170903110f00b001b886d36bf6si7813932plh.226.2023.07.31.12.05.33; Mon, 31 Jul 2023 12:05:46 -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 S230052AbjGaR6y (ORCPT + 99 others); Mon, 31 Jul 2023 13:58:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37328 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229604AbjGaR6x (ORCPT ); Mon, 31 Jul 2023 13:58:53 -0400 X-Greylist: delayed 402 seconds by postgrey-1.37 at lindbergh.monkeyblade.net; Mon, 31 Jul 2023 10:58:50 PDT Received: from smtp.uniroma2.it (smtp.uniroma2.it [160.80.6.23]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6E06BE4E; Mon, 31 Jul 2023 10:58:50 -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 36VHpZNe005077 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT); Mon, 31 Jul 2023 19:51:36 +0200 From: Andrea Mayer To: "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , David Ahern , Shuah Khan , linux-kernel@vger.kernel.org, netdev@vger.kernel.org, linux-kselftest@vger.kernel.org Cc: Stefano Salsano , Paolo Lungaroni , Ahmed Abdelsalam , Hangbin Liu , Andrea Mayer Subject: [net-next 0/2] seg6: add NEXT-C-SID support for SRv6 End.X behavior Date: Mon, 31 Jul 2023 19:51:15 +0200 Message-Id: <20230731175117.17376-1-andrea.mayer@uniroma2.it> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 X-Virus-Scanned: clamav-milter 0.100.0 at smtp-2015 X-Virus-Status: Clean X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_BLOCKED,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 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1772964122132481580 X-GMAIL-MSGID: 1772964122132481580 In the Segment Routing (SR) architecture 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. Considering the Segment Routing over IPv6 data plane (SRv6) [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). In some SRv6 scenarios, the number of segments carried by the SID List may increase dramatically, reducing the MTU (Maximum Transfer Unit) size and/or limiting the processing power of legacy hardware devices (due to longer IPv6 headers). The NEXT-C-SID mechanism [3] extends the SRv6 architecture by providing several ways to efficiently represent the SID List. By leveraging the NEXT-C-SID, is it possible to encode several SRv6 segments within a single 128 bit SID address (also referenced as Compressed SID Container). In this way, the length of the SID List can be drastically reduced. The NEXT-C-SID mechanism is built upon the "flavors" framework defined in [2]. This framework is already supported by the Linux SRv6 subsystem and is used to modify and/or extend a subset of existing behaviors. In this patchset, we extend the SRv6 End.X behavior in order to support the NEXT-C-SID mechanism. In details, the patchset is made of: - patch 1/2: add NEXT-C-SID support for SRv6 End.X behavior; - patch 2/2: add selftest for NEXT-C-SID in SRv6 End.X behavior. From the user space perspective, we do not need to change the iproute2 code to support the NEXT-C-SID flavor for the SRv6 End.X behavior. However, we will update the man page considering the NEXT-C-SID flavor applied to the SRv6 End.X behavior in a separate patch. 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 Andrea Mayer (1): seg6: add NEXT-C-SID support for SRv6 End.X behavior Paolo Lungaroni (1): selftests: seg6: add selftest for NEXT-C-SID flavor in SRv6 End.X behavior net/ipv6/seg6_local.c | 108 +- tools/testing/selftests/net/Makefile | 1 + .../net/srv6_end_x_next_csid_l3vpn_test.sh | 1213 +++++++++++++++++ 3 files changed, 1302 insertions(+), 20 deletions(-) create mode 100755 tools/testing/selftests/net/srv6_end_x_next_csid_l3vpn_test.sh