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 785A345B5A; Thu, 17 Oct 2024 09:07:31 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id CFFFF402E2; Thu, 17 Oct 2024 09:07:27 +0200 (CEST) Received: from mail-lf1-f50.google.com (mail-lf1-f50.google.com [209.85.167.50]) by mails.dpdk.org (Postfix) with ESMTP id 1FF8540261 for ; Thu, 17 Oct 2024 09:03:51 +0200 (CEST) Received: by mail-lf1-f50.google.com with SMTP id 2adb3069b0e04-539fbbadf83so748649e87.0 for ; Thu, 17 Oct 2024 00:03:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1729148630; x=1729753430; darn=dpdk.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=sVTVjaKqrlhag9aiDcvm56phLLlynldAZA2Wop91c8w=; b=Y/9X966FRXzL6B8KxFfjxYCwZCWV4S6CZLXDRNZ1Z/gxQAIAq9kTjk2g2zXfqFtHT+ 9hOlw9metnYd+vK9lNhxjDf2xP8ZHhxZLX0MJfzyzyIxfu6j1y+u02+mhxKTVjVB9FgH 0d9ZB4iPxdtCd8aDAmeooEmvE3yNh5x6LAqfp35raTEh5qRcun2TGmW1gqgtMBY8VzEq YCj703AQr93U+w1AhXsXudvvzJhbulxdu8UsVtu9PMYOvBcEGSNcun2vFHiy81Af9HgH P/vJLvOmPkhQ9TutPY/70YEzvc9b1Zg0EPxlGsmmKRNeBOVdeMpL/JlmCPZsIgMCAAfX J7cw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1729148630; x=1729753430; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=sVTVjaKqrlhag9aiDcvm56phLLlynldAZA2Wop91c8w=; b=DgI+xud61ngblzk7kSeJ9cz7RYsFT7OQNJtHU1HpFxrgfD1CxcLAyfc2ky6Xsn2McD xxfku87OQARAu/aOePVpGz7U1hGFQwLxEQM7pPfkLwJo9HMkYB1M/LixlrqPUimj9QNH FsVQ97rGFHCix5G/X5iWNIudE3gO2EnVFjdjhbOhz+x9TP5jL80D4qRcWBzYIAn3dvPB 61KkLCh4+u/YLvYY5ssH6+5Xr/t1CbCo7lLXqJDcQhFspgrj2GpKXyTUtWo6p5RWvujz 1rK8hrS6+77HQDhmwIS3Bo0fLj9eQe9QS2eOmUHQM6a+CkCb4L2WFa3PHjJ7GpesXrJI liBw== X-Forwarded-Encrypted: i=1; AJvYcCWYXTjItwR7zp0FcqWS8EoIHWT0Qdwu/Pk+h2kOaWiTmFEQLEq2gGpUZVFRP4BA9lEzinA=@dpdk.org X-Gm-Message-State: AOJu0YzvZ+nx0BKHnM5CsS7fAm36aWejk4iovu9MvgY3K5GQQs8lhVTK hmmKAsisNkkaOZKleVQgyfTwVd1iO9RRnFW9llBSxCLFDQ3z3tQNeXKotZ7uHAVpxux4MiB0dN+ dr+GUevdTjRbbdnXdzhDCNJ65CUo= X-Google-Smtp-Source: AGHT+IFXTEUopv5CNPYUcrS9zZWmt3ddTeIfQgLbNDe1+sN6E1sSmHKbaE/A9EU3jfNJHIzgugZc0WtbhT2q5xJxlko= X-Received: by 2002:a05:6512:3196:b0:539:89f7:3187 with SMTP id 2adb3069b0e04-539da583db0mr10286927e87.47.1729148629796; Thu, 17 Oct 2024 00:03:49 -0700 (PDT) MIME-Version: 1.0 References: <20240907073115.1531070-1-nsaxena@marvell.com> In-Reply-To: From: Nitin Saxena Date: Thu, 17 Oct 2024 12:33:37 +0530 Message-ID: Subject: Re: [EXTERNAL] Re: [RFC PATCH 0/3] add feature arc in rte_graph To: Robin Jarry Cc: David Marchand , Nitin Saxena , Jerin Jacob , Kiran Kumar Kokkilagadda , Nithin Kumar Dabilpuram , Zhirun Yan , "dev@dpdk.org" , Christophe Fontaine Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Mailman-Approved-At: Thu, 17 Oct 2024 09:07:24 +0200 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 Hi Robin/David and all, We realized the feature arc patch series is difficult to understand as a new concept. Our objectives are following with feature arc changes 1. Allow reusability of standard DPDK nodes (defined in lib/nodes/*) with out-of-tree applications (like grout). Currently out-of-tree graph applications are duplicating standard nodes but not reusing the standard ones which are available. In the long term, we would like to mature standard DPDK nodes with flexibility of hooking them to out-of-tree application nodes. 2. Flexibility to enable/disable sub-graphs per interface based on the runtime configuration updates. Protocol sub-graphs can be selectively enabled for few (or all interfaces) at runtime 3. More than one sub-graphs/features can be enabled on an interface. So a packet has to follow a sequential ordering node path on worker cores. Packets may need to move from one sub-graph to another sub-graph per interf= ace 4. Last but not least, an optimized implementation which does not (or minimally) stop worker cores for any control plane runtime updates. Any performance regression should also be avoided I am planning to create a draft presentation on feature arc which I can share, when ready, to discuss. If needed, I can also plan to present that in one of the DPDK community meetings. Their we can also discuss if there are any alternatives of achieving above objectives Thanks, Nitin . On Wed, Oct 16, 2024 at 7:20=E2=80=AFPM Nitin Saxena = wrote: > > Hi Robin, > > Thanks for the review > Please see my replies inline > > Thanks, > Nitin > > On Wed, Oct 16, 2024 at 3:08=E2=80=AFPM Robin Jarry w= rote: > > > > Hi folks, > > > > David Marchand, Oct 16, 2024 at 11:24: > > > On Mon, Oct 14, 2024 at 1:12=E2=80=AFPM Nitin Saxena wrote: > > >> I had pushed non RFC patch series before -rc1 date (11th oct). > > >> We have an ABI change in this patch series https://patches.dpdk.org/= project/dpdk/patch/20241010133111.2764712-3-nsaxena@marvell.com/ > > >> Could you help merge this patch series in rc2 otherwise it has to wa= it for next LTS > > > > > > Just read through the series, I am not confident with this addition. > > > It requires a lot of changes in the node code for supporting it, wher= e > > > it should be something handled in/facilitated by the graph library > > > itself. > > > > As far as I can tell, it will be very complicated (if not impossible) t= o > > determine in a generic manner whether a packet must be steered towards > > a sub tree or not. The decision *must* come from the originating node i= n > > some way or another. > > Nitin> I am not sure if it *must* always be from the originating node? > What about a control plane which wants to enable "IP4 feature" on > interface 'X' by assigning IP address? > A originating node (say: ip4-input) *must not* activate IP4 lookup > sub-graph for interface "X " until control plane assigns any IP > address to it. > > Regarding the complexity of adopting feature arc changes in fast path, > - a sub-optimal change for feature-arc would be simple and trivial but > at the cost of performance. > - Complexity increases when feature arc changes are optimally > integrated (like "ip4_rewrite" changes in the patch) with no > performance regression > > > > > > I did not read much from Robin or Christophe who have been writing > > > more node code than me. > > > I would prefer their opinion before going forward. > > > > This series is indeed very dense. I like the concept of having > > extensible sub trees in the graph but it feels like the implementation > > is more complex than it should be. > > > > Lacking of another solution, we went for a naive approach in grout. > > Basically, some nodes have undefined next nodes which are extended usin= g > > a dedicated API. > > Nitin> With an initial glance, it looks like "grout" is trying to > solve a use-case where a child is being added to the parent's > undefined next node. This is trying to create a runtime parent-child > relationship > > On the other hand, feature arc not just create parent-child > relationships but also sibling-sibling relationships as well. Also > enabling sub-graph per interface is critical functionality in feature > arc that adds complexity > > Let's assume a use-case in ingress direction, at the IPv4 layer, > where IPv4-input is the *originating node* and > > - On interface X, IPsec-policy, IP4-classify() and IPv4-lookup > sub-graphs are enabled in a sequential order > - On interface Y, IP4-classify() and IPv4-lookup sub-graphs are > enabled. in a sequential order. i.e. IPsec-policy is *disabled* on > interface Y > > In fast path, following processing should happen for "mbuf0" which is > received on interface "X" > - "ipv4-input" sends mbuf0 to the first enabled sub-graph node for > interface X, "IPsec-policy" > - In "IPsec-policy" node processing, if policy action results in > "bypass" action for mbuf0, it must then be sent to next enabled > sub-graph i.e. "IPv4-classify" (from "IPsec-policy" node) > - In "IPv4-classify" node processing, if classify fails for mbuf0 then > it should finally be sent to "IPv4-lookup" node (from "IPv4-classify" > node) > > whereas for "mbuf1" received on interface Y following fast path > processing must happen > - "Ipv4-input" sends mbuf1 to the first enabled sub-graph node for > interface Y, "IPv4-classify" > - If "IPv4-classify" fails for mbuf1, then it should finally be sent > to IPv4-lookup node > > To behave differently for interface X and interface Y as above > - First of all, IPsec-policy/IPv4-classify/IPv4-lookup must be > connected to "ipv4-input" node (Parent-Child relationship) > - Also, IPsec-policy/IPv4-classify/IPv4-lookup must also be connected > with each other (Sibling-Sibling relationship) > - Fast path APIs provide *rte_edges_t* to send mbuf from one node to > another node > 1. Based on interface (either Interface X or Interface Y) > 2. Based on which node, fast path APIs are called. Next enabled > feature/sub-graph can only be determined from previous enabled > feature/sub-graph in fast path > > Not sure if grout handles above use-cases in the same manner. AFAIR , > for any control plane change grout re-creates "graph" objects which > may not be required with feature arc. > > > > > https://github.com/DPDK/grout/blob/v0.2/modules/infra/datapath/eth_inpu= t.c#L23-L31 > > > > This API can be used by other nodes to attach themselves to these > > extensible nodes: > > > > https://github.com/DPDK/grout/blob/v0.2/modules/ip/datapath/arp_input.c= #L143 > > https://github.com/DPDK/grout/blob/v0.2/modules/ip/datapath/ip_input.c#= L124 > > https://github.com/DPDK/grout/blob/v0.2/modules/ip6/datapath/ip6_input.= c#L122 > > > > After which, the extensible nodes can steer the packets towards the > > correct downstream edge based on the dedicated classifier field: > > > > https://github.com/DPDK/grout/blob/v0.2/modules/infra/datapath/eth_inpu= t.c#L79 > > > > Obviously, this does not natively support a per-interface sub tree > > traversal, but it can be done in the originating node based on packet > > private context data. > > Nitin> Expressing per interface sub-tree traversal is the key > functionality of feature arc. > > > > > This raises a more important question: how can we standardize the way > > private application data is passed from node to node? And how could we > > enforce this declaratively in the node register API? > > Nitin> What you are suggesting here (node to node application data > exchange) can be done in rte_node_register API but, IMO, this is not > related to feature arc. > Feature arc is not just between parent and child nodes but also > between siblings (as explained above) > > > > > Do you think we could find some middle ground that would not require > > such extensive changes? > > Nitin> If you are pointing to ipv4-rewrite changes, I had an internal > review comment of adding those changes without any *performance > regression*. > A sub-optimal code would be much simpler but at the cost of performance. > > > > > Cheers, > > Robin > >