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 CDD82430EF; Thu, 24 Aug 2023 13:17:48 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id B927141611; Thu, 24 Aug 2023 13:17:48 +0200 (CEST) Received: from mail.lysator.liu.se (mail.lysator.liu.se [130.236.254.3]) by mails.dpdk.org (Postfix) with ESMTP id A497B41611; Thu, 24 Aug 2023 13:17:46 +0200 (CEST) Received: from mail.lysator.liu.se (localhost [127.0.0.1]) by mail.lysator.liu.se (Postfix) with ESMTP id 69EDE1D5D3; Thu, 24 Aug 2023 13:17:46 +0200 (CEST) Received: by mail.lysator.liu.se (Postfix, from userid 1004) id 486481D5D2; Thu, 24 Aug 2023 13:17:46 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on hermod.lysator.liu.se X-Spam-Level: X-Spam-Status: No, score=-2.9 required=5.0 tests=ALL_TRUSTED, AWL, NICE_REPLY_A autolearn=disabled version=3.4.6 X-Spam-Score: -2.9 Received: from [192.168.1.59] (h-62-63-215-114.A163.priv.bahnhof.se [62.63.215.114]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (2048 bits)) (No client certificate requested) by mail.lysator.liu.se (Postfix) with ESMTPSA id 201481D662; Thu, 24 Aug 2023 13:17:43 +0200 (CEST) Message-ID: <644934bc-a10f-5db6-cf0f-819c3828fdf6@lysator.liu.se> Date: Thu, 24 Aug 2023 13:17:42 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.13.0 Subject: Re: [PATCH v2 1/3] eventdev: introduce event dispatcher Content-Language: en-US To: Jerin Jacob Cc: =?UTF-8?Q?Mattias_R=c3=b6nnblom?= , jerinj@marvell.com, dev@dpdk.org, harry.van.haaren@intel.com, peter.j.nilsson@ericsson.com, Stephen Hemminger , Heng Wang , "Naga Harish K, S V" , Erik Gabriel Carrillo , "Gujjar, Abhinandan S" , Pavan Nikhilesh , Shijith Thotton , Hemant Agrawal , Sachin Saxena , Liang Ma , Peter Mccarthy , techboard@dpdk.org, Zhirun Yan References: <20230614172527.157664-2-mattias.ronnblom@ericsson.com> <20230616074041.159675-1-mattias.ronnblom@ericsson.com> <20230616074041.159675-2-mattias.ronnblom@ericsson.com> <785e3e39-9258-8b87-7d9b-083a370a787b@lysator.liu.se> From: =?UTF-8?Q?Mattias_R=c3=b6nnblom?= In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Virus-Scanned: ClamAV using ClamSMTP 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 On 2023-08-22 14:32, Jerin Jacob wrote: > On Tue, Aug 22, 2023 at 2:12 PM Mattias Rönnblom wrote: >> >> On 2023-08-18 08:09, Jerin Jacob wrote: >>> On Fri, Jun 16, 2023 at 1:17 PM Mattias Rönnblom >>> wrote: >>>> >>> >>> Hi Mattais, >>> >>> Finally, got some time to review this series, and thanks for excellent >>> documentation. >>> >>> I understand the use case for the dispatcher, But following are some >>> of my concern >>> >>> 1) To decouple the application specific business logic, one need to >>> use two function pointers to access per packet (match and process) >>> function. >> >> The API design is based on community feedback, which suggested more >> flexibility was required than the initial >> "dispatching-based-on-queue-id-only" functionality the first RFC provided. >> >> Where I expected to land was a design where I would have something like >> the RFC v2 design with match+process callbacks, and then a supplementary >> "hard-coded" dispatch-internal match API as well, where only the process >> function would be used (much like how RFC v1 worked). >> >> It turned out the special-case API was not performing better (rather the >> opposite) for the evaluated use cases, so I dropped that idea. >> >> That said, it could always be a future extension to re-introduce >> dispatcher-internal matching. > > Ack. > >> >>> 2) Need to enforce service core for its usage. >>> >> >> Well, Eventdev does that already, except on systems where all required >> event adapters have the appropriate INTERNAL_PORT capability. > > Yes. The difference is, one is for HW feature emulation and other one > for framework usage. > Can you elaborate why that difference is relevant? Both the adapters and the event dispatcher are optional, so if you have an issue with service cores, you can avoid their use. > >> >>> IMO, Both are a given application's choice, All the application does >>> not need to use this scheme. Keeping the code in lib/eventdev has the >>> following issue. >>> >>> 1)It is kind of enforcing above scheme for all the application >>> modeling, which may not applicable for application use cases and >>> eventdev device does not dictate a specific framework model. >>> 2) The framework code, we never kept in device class library. i.e., >>> public APIs are implemented through device class API and public API >>> don't have any no hook to PMD API. >>> For example, we never kept lib/distributor/ code in lib/ethdev. >>> >>> Other than the placement of this code, I agree with use case and >>> solution at high level . The following could option for placement of >>> this library. Based on that, we can have next level review. >>> >> >> I'm fine with keeping this as a separate library, although I also don't >> see the harm in having some utility-type functionality in eventdev itself. > > I see harm as > > 1)It is kind of enforcing above scheme for all the application > modeling, which may not applicable for all application use cases and > eventdev device does not dictate a specific framework model. > What scheme is being enforced? Using this thing is optional. > 2) The framework code, we never kept in device class library. i.e., > public APIs are implemented through device class API and public API > don't have any no hook to PMD API. > For example, we never kept lib/distributor/ code in lib/ethdev. > > I would to keep eventDEV library scope as abstracting event device features. > We have some common code in library whose scope is sharing between PMDs > not a framework on top eventdev public APIs. > > Having said that, I supportive to get this framework as new library and > happy to review the new library. > Thanks. I'll reshape the event dispatcher as a separate library and submit a new patch. >> >>> 1) It is possible to plug in this to lib/graph by adding new graph >>> model(@zhirun.yan@intel.com recently added >>> RTE_GRAPH_MODEL_MCORE_DISPATCH) >>> >>> Based on my understanding, That can translate to >>> a) Adding new graph model which allows to have it on graph walk >>> (Graph walk is nothing but calling registered dispatcher routines) >>> b) It is possible to add model specific APIs via >>> rte_graph_model_model_name_xxxx() >>> c) Graph library is not using match callback kind of scheme. Instead, >>> nodes will process the packet and find its downstream node and enqueue >>> to it and then graph_walk() calls the downstream node specific process >>> function. >>> With that, we can meet the original goal of business logic decoupling. >>> However, Currently, nodes are not aware of what kind of graph model it >>> is running, that could be one issue here as eventdev has more >>> scheduling properties >>> like schedule type etc., to overcome that issue, it may be possible to >>> introduce nodes to graph model compatibility (where nodes can >>> advertise the supported graph models) >>> d) Currently we are planning to make graph API as stable, if we are >>> taking this path, we need to hold >>> https://patches.dpdk.org/project/dpdk/patch/20230810180515.113700-1-stephen@networkplumber.org/ >>> as >>> we may need to update some public APIs. >>> >>> 2) Have new library lib/event_dispatcher >>> >>> 3) Move to example directory to showcase the framework >>> >>> 4) Move to app/test-eventdev directory to show the case of the framework. >>> >>> >>> Thoughts? >> >> I'm not sure I follow. Are you suggesting rte_graph could use >> rte_event_dispatcher, or that an application could use rte_graph to >> solve the same problem as rte_event_dispatcher solves? > > Later one, Application could use rte_graph to solve the same problem > as rte_event_dispatcher solves. > In fact, both are solving similar problems. See below. > > >> >> I didn't review rte_graph in detail, but if it's anything like fd.io >> VPP's graph model, it's not a programming model that you switch to >> without significant application code impact. > > This is a new library, right? So, which existing applications? > Existing DPDK applications, which domain logic is not organized as a graph. Which, I'm guessing, are many. Moving from "raw" event device dequeue to the event dispatcher model is a trivial, non-intrusive, operation. > It is not strictly like VPP graph model. rte_graph supports plugin for > the different graph models. > > Following are the models available. > https://doc.dpdk.org/guides/prog_guide/graph_lib.html > See > 62.4.5.1. RTC (Run-To-Completion) > 62.4.5.2. Dispatch model > > RTC is similar to fd.io VPP. Other model is not like VPP. > > If we choose to take new library route instead of new rte_graph model > for eventdev then > https://doc.dpdk.org/guides/contributing/new_library.html will be the process.