Received: by 2002:a05:7412:bb8d:b0:d7:7d3a:4fe2 with SMTP id js13csp89098rdb; Mon, 14 Aug 2023 10:16:30 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGC3bHmM3g5rdF1euervtofNrgHhoXlpd7sdoyOz5zF446A9lFMMtQYfNSbZBdh9NprkG9V X-Received: by 2002:a05:6a21:7783:b0:13d:b318:5c70 with SMTP id bd3-20020a056a21778300b0013db3185c70mr13540131pzc.19.1692033390108; Mon, 14 Aug 2023 10:16:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1692033390; cv=none; d=google.com; s=arc-20160816; b=hc2W98B7wkvI7AMJkHIlLQlFK5RiTu8sUV/ALLTl5RGpkTFUlGiqNwBxz+jJWMl+Re dycdpm0bXBoVp+fd9qpJJrDwrn7Cq9MZYCc+vQBf8m+ACOrG4MbIYNra6+bD2BBEj5NI D0hr6oB6pb78fUpDlPGSaeD3TCL0xZf7HfEB0VSqJsgpGSkjNh1V08JIZv/6UmiWzKxP TCEvMDOf3zXV/1AZ1dXPK8PCoJfhAglH/HsR5qLozMIF0wnOgGah30yQCVwdF2jeP2lE lJc7dYxUGV3ibGZsX7bCBNGWFSsQidnxmk8xrJPFcgV0CLe3suKtuq5A4sWqHGw6NdEI 95zw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=2PVtIr2loSISG+p8j1rV1Hse1HBlQMskh5u5xQY923o=; fh=6MJbBRVegF0PcbQCxFd5vTMEVzjDFXhLECtPKWACNRY=; b=r1/El5HrLrOgb048MvcZR3YD70VO0xSW4YemBjq/lcvMFus29zUBii+PCWmzMQPZDl Zr1DBXjZJNs0GW7H5ZTWYSJNRt+GC0fTp4Ti59d1zHRWM0lSujKlY+ZZSg+88GYJkqic IMuy7uRDG2V+3GBe7aD8Bcyh0DoqmCcznSBZ+POJRvZ1Twj3vuuVw/bMN/QJwCVLkgiN 90GUPXLUXdO4V6b0qlkM0LrUarCYP4WS+wKQUvuuJOOJ+DwOgBaaX6cn7imJzpEXJdhK OUjHpbITmXnenLuJrk4MYj3kUAYUyPujfX0ILVkp/8iyEkS+khJku8aZRwOsidHAO2ZX u7DA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=N04TVlLA; 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id k15-20020a635a4f000000b0055b4307963fsi8021243pgm.197.2023.08.14.10.16.01; Mon, 14 Aug 2023 10:16:30 -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; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=N04TVlLA; 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230430AbjHNQRT (ORCPT + 99 others); Mon, 14 Aug 2023 12:17:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52398 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230070AbjHNQQt (ORCPT ); Mon, 14 Aug 2023 12:16:49 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7728D106; Mon, 14 Aug 2023 09:16:48 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 0295163FBE; Mon, 14 Aug 2023 16:16:48 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id DE590C433BD; Mon, 14 Aug 2023 16:16:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1692029807; bh=XKO2xiTql41TuJLWtHYgWjPpFQF/Knxed55Bfd0sH6g=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=N04TVlLA2sSYBppKAwbJPd63MGeg3lZCanL0qajx5zFZXwvmsxyuwQTVgYRHm/Mqs syaqNxvXLKpWuKfLPSN6fv/QV3sQKkawCCt9I2GdfCoK5laCBr5qH6t17hAUf01nUd yfXR0YGud2GcHSC85CpKfMzLS9bFhU6PwKsuwtu3KIdOmZ4vPAOW6GnIVdUIiJlRRN vKKWSs82TOdZiGvg+2C0StnxbSgV3mRshEO2/g+j86IU/8vswNcZnjhw+MsuvEYw3g PU6v6iN/ePYTVD0TPU6+jfphRXeLuD4k3rizkpy0xlC/lZiFsbo3996Weog9THEV1V htAhxBqooDLqg== Message-ID: <92d32852-17f0-099c-a2b5-12a29da14133@kernel.org> Date: Mon, 14 Aug 2023 10:16:46 -0600 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.14.0 Subject: Re: [net-next v2 1/2] seg6: add NEXT-C-SID support for SRv6 End.X behavior Content-Language: en-US To: Andrea Mayer , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , 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 References: <20230812180926.16689-1-andrea.mayer@uniroma2.it> <20230812180926.16689-2-andrea.mayer@uniroma2.it> From: David Ahern In-Reply-To: <20230812180926.16689-2-andrea.mayer@uniroma2.it> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-9.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A, RCVD_IN_DNSWL_HI,SPF_HELO_NONE,SPF_PASS 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 On 8/12/23 12:09 PM, Andrea Mayer wrote: > The NEXT-C-SID mechanism described in [1] offers the possibility of > encoding several SRv6 segments within a single 128 bit SID address. Such > a SID address is called a Compressed SID (C-SID) container. In this way, > the length of the SID List can be drastically reduced. > > A SID instantiated with the NEXT-C-SID flavor considers an IPv6 address > logically structured in three main blocks: i) Locator-Block; ii) > Locator-Node Function; iii) Argument. > > C-SID container > +------------------------------------------------------------------+ > | Locator-Block |Loc-Node| Argument | > | |Function| | > +------------------------------------------------------------------+ > <--------- B -----------> <- NF -> <------------- A ---------------> > > (i) The Locator-Block can be any IPv6 prefix available to the provider; > > (ii) The Locator-Node Function represents the node and the function to > be triggered when a packet is received on the node; > > (iii) The Argument carries the remaining C-SIDs in the current C-SID > container. > > This patch leverages the NEXT-C-SID mechanism previously introduced in the > Linux SRv6 subsystem [2] to support SID compression capabilities in the > SRv6 End.X behavior [3]. > An SRv6 End.X behavior with NEXT-C-SID flavor works as an End.X behavior > but it is capable of processing the compressed SID List encoded in C-SID > containers. > > An SRv6 End.X behavior with NEXT-C-SID flavor can be configured to support > user-provided Locator-Block and Locator-Node Function lengths. In this > implementation, such lengths must be evenly divisible by 8 (i.e. must be > byte-aligned), otherwise the kernel informs the user about invalid > values with a meaningful error code and message through netlink_ext_ack. > > If Locator-Block and/or Locator-Node Function lengths are not provided > by the user during configuration of an SRv6 End.X behavior instance with > NEXT-C-SID flavor, the kernel will choose their default values i.e., > 32-bit Locator-Block and 16-bit Locator-Node Function. > > [1] - https://datatracker.ietf.org/doc/html/draft-ietf-spring-srv6-srh-compression > [2] - https://lore.kernel.org/all/20220912171619.16943-1-andrea.mayer@uniroma2.it/ > [3] - https://datatracker.ietf.org/doc/html/rfc8986#name-endx-l3-cross-connect > > Signed-off-by: Andrea Mayer > --- > net/ipv6/seg6_local.c | 108 ++++++++++++++++++++++++++++++++++-------- > 1 file changed, 88 insertions(+), 20 deletions(-) > Reviewed-by: David Ahern