From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 97E4843ABD; Fri, 9 Feb 2024 16:33:11 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 2114742E64; Fri, 9 Feb 2024 16:33:11 +0100 (CET) Received: from wfhigh6-smtp.messagingengine.com (wfhigh6-smtp.messagingengine.com [64.147.123.157]) by mails.dpdk.org (Postfix) with ESMTP id 1E35240697 for ; Fri, 9 Feb 2024 16:33:09 +0100 (CET) Received: from compute6.internal (compute6.nyi.internal [10.202.2.47]) by mailfhigh.west.internal (Postfix) with ESMTP id 96A671800080; Fri, 9 Feb 2024 10:33:07 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute6.internal (MEProxy); Fri, 09 Feb 2024 10:33:08 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monjalon.net; h= cc:cc:content-transfer-encoding:content-type:content-type:date :date:from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to; s=fm3; t=1707492787; x=1707579187; bh=h4WTEAERTg01KP+CNHDJPSHIOmItUwu22idoNIvBdps=; b= HanuaufltQZI/G0sWTzFR+9ZzliBUY4elqfKa0YZWjwNgBiMWnnpv77bwouR1htq 6KQboK5rn2Of2KQokR+8ai0PFjEhbihK0vtKAQeFqRjHZbrj7G7lcP072TlaDx/3 dA1wECb7z5zu+X6bgr3owi1SxXk8FJDDNttYqiS5dFIXefu3JHI1JPGxa1RdZLii aD2YD48aUTD6L/c2tVYxw0HJuWXEQFNzTLHWGZBX+9WchqU7/nAC7My6POJKsf+N 9m76sCHi2y9gT/qdI+vdQdZnzR5tu7x2pJBRmffg19rZB2Z500aM4mnI8PGcivNr 7WjO1IO+fumN/3b67m7DBw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm3; t=1707492787; x= 1707579187; bh=h4WTEAERTg01KP+CNHDJPSHIOmItUwu22idoNIvBdps=; b=F vpnxn3UkD6Z7/d3W38iLgjDz0YC7yxFEEPnF1PR6jmexd9v3/JzP246x1Dkz9oDv pf47qzYg+wEkTiAEq4v3uPp7o0D5oGboIcbSGfm7BM16bXORG91kqXcLOh+WWhyT KlZCuPkXMZvCDHyzlJI7QhUMEbKzRcSsc9bSGRib/nCZ2FXSHIClc4UUf4zBWRgv W1FgmSU+ckQNLHwXEqIjFaVuq60zHmeCHOZC1Ss6A2uuezXmRYnxGnXF5mpLuTx+ 2UdzEX/NM4AUwXop1PRXA8Ich6BS052Nij2Ai/+ZXc3o8HTI086XA6+l1LeaeaxS q8WVicsW3tNb6bU0ua6Pw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvledrtdeigdejiecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefhvfevufffkfgjfhgggfgtsehtqhertddttdejnecuhfhrohhmpefvhhhomhgr shcuofhonhhjrghlohhnuceothhhohhmrghssehmohhnjhgrlhhonhdrnhgvtheqnecugg ftrfgrthhtvghrnhepfefftefgudeluefhteegvdelhfeuhfdvgfduhfevjeffudeuudei hfejueduhfefnecuffhomhgrihhnpehivghtfhdrohhrghenucevlhhushhtvghrufhiii gvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehthhhomhgrshesmhhonhhjrghlohhn rdhnvght X-ME-Proxy: Feedback-ID: i47234305:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Fri, 9 Feb 2024 10:33:05 -0500 (EST) From: Thomas Monjalon To: Gavin Li , orika@nvidia.com, andrew.rybchenko@oktetlabs.ru, Ferruh Yigit Cc: dev@dpdk.org, jiaweiw@nvidia.com Subject: Re: [RFC V1 1/1] net: extend VXLAN header to support more extensions Date: Fri, 09 Feb 2024 16:32:57 +0100 Message-ID: <27994279.gRfpFWEtPU@thomas> In-Reply-To: References: <20240130112520.1971315-1-gavinl@nvidia.com> <4126957.6PsWsQAL7t@thomas> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="UTF-8" X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org 09/02/2024 15:58, Ferruh Yigit: > On 2/9/2024 1:44 PM, Thomas Monjalon wrote: > > 09/02/2024 13:11, Ferruh Yigit: > >> On 2/9/2024 10:12 AM, Thomas Monjalon wrote: > >>> 09/02/2024 00:54, Ferruh Yigit: > >>>> On 1/30/2024 11:25 AM, Gavin Li wrote: > >>>>> Currently, DPDK supports VXLAN and VXLAN-GPE with similar header > >>>>> structures and we are working on adding support for VXLAN-GBP which= is > >>>>> another extension to VXLAN. More extension of VXLAN may be added in= the > >>>>> future. > >>>>> > >>>>> VXLAN and VXLAN-GBP use the same UDP port(4789) while VXLAN-GPE use= s a > >>>>> different one, 4790. The three protocols have the same header lengt= h and > >>>>> overall similar header structure as below. > >>>>> 0 1 2 3 > >>>>> 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 > >>>>> +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ > >>>>> |R|R|R|R|I|R|R|R| Reserved | > >>>>> +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ > >>>>> | VXLAN Network Identifier (VNI) | Reserved | > >>>>> +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ > >>>>> > >>>>> Figure 1: VXLAN Header > >>>>> > >>>>> 0 1 2 3 > >>>>> 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 > >>>>> +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ > >>>>> |R|R|Ver|I|P|B|O| Reserved |Next Protocol | > >>>>> +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ > >>>>> | VXLAN Network Identifier (VNI) | Reserved | > >>>>> +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ > >>>>> > >>>>> Figure 2: VXLAN-GPE Header > >>>>> > >>>>> 0 1 2 3 > >>>>> 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 > >>>>> +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ > >>>>> |G|R|R|R|I|R|R|R|R|D|R|R|A|R|R|R| Group Policy ID | > >>>>> +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ > >>>>> | VXLAN Network Identifier (VNI) | Reserved | > >>>>> +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ > >>>>> > >>>>> Figure 3: VXLAN-GBP Extension > >>>>> > >>>>> Both VXLAN-GPE and VXLAN-GBP extended VXLAN by redefining its reser= ved > >>>>> bits, which means the packets can be processed with same pattern an= d most > >>>>> of the code can be reused. Instead of adding more new items by > >>>>> copying/pasting code for the VXLAN extensions in the future, it=E2= =80=99s better > >>>>> to use existing VXLAN infrastructure and add support code in it. > >>>>> > >>>> > >>>> Hi Gavin, > >>>> > >>>> The motivation is to prevent code duplication, and the code mentione= d is > >>>> the driver code, right? > >>> > >>> The motivation is mainly to provide a unified and more explicit API. > >>> > >> > >> From user perspective, I think existing approach is more explicit, > >> because it sets VXLAN or VXLAN_GPE flow types. > >> > >> I am trying to understand the benefit, how unifying flow type in the A= PI > >> helps to the user? > >> > >>>> Overall OK to unify "struct rte_vxlan_hdr" although it makes the str= uct > >>>> a little complex, perhaps we can consider extraction some nested str= ucts > >>>> as named struct, no strong opinion. > >>>> > >>>> > >>>> But not sure about removing the flow item types for VXLAN-GPE, or not > >>>> adding for VXLAN-GBP. > >>>> > >>>> Think about a case user adding a rule, which has a item type as VXLAN > >>>> and in the protocol header some bits are set, lets say first word, l= ast > >>>> byte is set, how driver will know if to take it as GPE "next protoco= l" > >>>> or "group policy id". > >>> > >>> The driver may decide depending on the UDP port and some distinguishi= ng flags. > >>> If you want to match on GBP, you should includes the GBP flag in your= pattern, > >>> no need to use a separate item. > >>> > >> > >> Why not be more explicit? > >> It helps to driver to know more about the pattern to be able to create > >> proper flow rule, if there is an obvious way for driver to differentia= te > >> these protocol extensions, and flow item type is redundant, I can > >> understand the proposal, but otherwise I think better to keep flow ite= ms > >> for extensions. > >=20 > > In any case we need the simple VXLAN item. > > If we have GPE and GBP specialized items, > > what means a match on the simple VXLAN? > > Does it include packets with other extensions or exclude them? > > Matching the bits in the protocol make such decision explicit. > >=20 > >> When a rule is set in HW, HW may not care about the protocol, as long = as > >> bits in the rule match with the packet, HW can apply the action. > >> But for driver to be able to set the rule properly, it needs more > >> explicit information. > >=20 > > Yes information is in the pattern to match. > >=20 > >> Lets assume driver API get a pattern with 'RTE_FLOW_ITEM_TYPE_VXLAN' > >> type and "struct rte_flow_item_vxlan", at this point driver doesn't kn= ow > >> if it is VXLAN or any of the extensions. > >=20 > > Yes it knows because of the matched bits in the pattern. > > If the rule specify a match on GBP flag =3D 1, it is GBP only. > > If the rule specify a match on GBP flag =3D 0, it excludes GBP. > > If the rule does not mask GBP flag, it includes GBP. > >=20 >=20 >=20 > OK, VXLAN-GBP protocol has a GBP flag that gives a way to differentiate > the extension, so flow item for it becomes redundant and we can get rid > of it. Yes I think so. > Is it same for the other extensions? > If we use VXLAN flow item and by setting specific field in pattern can > we differentiate VXLAN and any other extension? > Or in some cases other information, like UDP port, needs to be taken > into account to differentiate protocol/extension? =46or VXLAN-GPE, differentiation is on UDP port. Remember we have an API to fill some UDP ports: rte_eth_dev_udp_tunnel_port_add with RTE_ETH_TUNNEL_TYPE_VXLAN_GPE The UDP port value/mask may be part of the flow rule pattern. > I found a spec for VXLAN-GBP, but it shows as sub-header for VXLAN-GPE, > different than what this RFC describes: > https://datatracker.ietf.org/doc/html/draft-lemon-vxlan-gpe-gbp >=20 > Can you please share link for VXLAN-GBP Extension spec? I will let Gavin explain here, I'm not an expert.