Received: by 2002:a05:6358:489b:b0:bb:da1:e618 with SMTP id x27csp2408528rwn; Fri, 16 Sep 2022 09:49:48 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4J3LIXweZBy5dmV8PrIYF54i6HygI3QJPGDjTCtwXA3Oipl7x3togJ8dVerRDe0Jy43SfX X-Received: by 2002:a62:e702:0:b0:541:854b:3aaf with SMTP id s2-20020a62e702000000b00541854b3aafmr5813737pfh.41.1663346988492; Fri, 16 Sep 2022 09:49:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1663346988; cv=none; d=google.com; s=arc-20160816; b=zFg0en5cG8qwavkGkkFeFIrNaS3CF8NFfA6zJ8v5Vmyw7F8KUBdidbrz8mhU49TNZn DCSFs9mx14nNiNiPdRzcMbnJ6yGcx/tQwm/oyZOqHlnci3e4SzwjafnQ7PGrBpufpQrI SQSgwSu8PNtNhgOpOZ5q6oUQinHp7lYsbUybiY3urjZD77qJ1vV7GWkGJsSxZJBJ2d4X OJUCmjAOQLxt44PV/p8GFx1Z1OjcPJvP01v+a9XuG1a87oHUMKE/2CaRQL5wPYTqqhIK DH7u+qe72yxOuwFIhF7bi+9mvFK6wi88SmqD/FPSWj9zRsIVgzzcjCXakLTiNmg9pkU4 PUHQ== 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=1PszXf1eLvaqGr3qgG4Iu6pjXXkXXU5NBmtR+I7j0kI=; b=bxZruL0pt9vF2YlHK/yOHdATRUV4jlXAOuKD2S1dk7ZL0PH6AdUtUV4hcq2GHjp4JA Xp/IET9UgsETGpT/Hb9TL/1in6Ae2dS9PwnJxzqNoAXlSbIYkYtcPNP+UDI24nFHy5TI 8IBBkZ3fi6em8h91+tP4dNxWSByEfgL5Wri3Jo1lUxiu6yPVOTuhRekEvCddwVmgjt6r nxTajhLvrvamd5qZPs1dl1Z7lZ0mGTqjncYBn91vAYi+SOBKt6ROt0N2vw1leR2w2ZyR KIxrpSLBPY14e8sCEHRuToIRETs9veb7gedT0bfeFXluPvccNNIpxsisPDtdCLDBfndp AdGw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=F9NHWnPK; 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 i8-20020a17090332c800b0016c44b7c8c5si6690792plr.11.2022.09.16.09.49.35; Fri, 16 Sep 2022 09:49:48 -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=F9NHWnPK; 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 S229735AbiIPQss (ORCPT + 99 others); Fri, 16 Sep 2022 12:48:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38934 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229454AbiIPQsq (ORCPT ); Fri, 16 Sep 2022 12:48:46 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DAE38A6C3A; Fri, 16 Sep 2022 09:48:45 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 89050B82868; Fri, 16 Sep 2022 16:48:44 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 80A2CC433C1; Fri, 16 Sep 2022 16:48:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1663346923; bh=+vXVK5L4p89KIlITqarB2UspkycCjrgWVBIxqSVqJSg=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=F9NHWnPKvRTk/oHjbrf4w8BlNCdDH/00/QdaSC4EbBi9iuIuIeRvciiKkFZa3t/BE by7Rg0ZLyJWCb7Bhxkfx5K9UPlTOQSoedD/+VlIlLDBU1u/rKIKEXNH26YdyQQT8lZ b232Vh0jmhSAb74LWvV/iYCuMpX6wKJsPC4/OutUgfsD7OI/ITff7SgROdC+aKue/8 Qepx5cJ+fDM8PzH8ooq4NfUjy3icUFUxASvpm8ulTIO7qFGhws8KXDXk1vkReRqQ79 dzoC31HgdklpA9YES5dI6bCWEsTIUpyaCn/JTJ1mGVkcYk69e1pA9a+rUk5qiMsBIJ o8SqxiDkwfrVA== Message-ID: Date: Fri, 16 Sep 2022 10:48:41 -0600 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:91.0) Gecko/20100101 Thunderbird/91.13.0 Subject: Re: [net-next v2 2/3] seg6: add NEXT-C-SID support for SRv6 End behavior Content-Language: en-US To: Andrea Mayer , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Hideaki YOSHIFUJI , 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 References: <20220912171619.16943-1-andrea.mayer@uniroma2.it> <20220912171619.16943-3-andrea.mayer@uniroma2.it> From: David Ahern In-Reply-To: <20220912171619.16943-3-andrea.mayer@uniroma2.it> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-8.9 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 9/12/22 11:16 AM, 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. > > 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. > > This patch introduces the support for flavors in SRv6 End behavior > implementing the NEXT-C-SID one. An SRv6 End behavior with NEXT-C-SID > flavor works as an End behavior but it is capable of processing the > compressed SID List encoded in C-SID containers. > > An SRv6 End 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 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://datatracker.ietf.org/doc/html/rfc8986 > > Signed-off-by: Andrea Mayer > --- > include/uapi/linux/seg6_local.h | 24 +++ > net/ipv6/seg6_local.c | 335 +++++++++++++++++++++++++++++++- > 2 files changed, 356 insertions(+), 3 deletions(-) > Reviewed-by: David Ahern