From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id E79F2A0597; Wed, 8 Apr 2020 21:18:32 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 3CA3E1C1C0; Wed, 8 Apr 2020 21:18:32 +0200 (CEST) Received: from mail-il1-f193.google.com (mail-il1-f193.google.com [209.85.166.193]) by dpdk.org (Postfix) with ESMTP id 2BF091C1A9 for ; Wed, 8 Apr 2020 21:18:31 +0200 (CEST) Received: by mail-il1-f193.google.com with SMTP id g15so7836469ilj.10 for ; Wed, 08 Apr 2020 12:18:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=fFPMVH8x7yZS3XoxxzTYCgllXngH9yQeXi1Inar22tY=; b=lzwiR5Vm2AjySvvRfbLHWsZY/GtAP+wP+rqwYQnc+Y+/F6BhxGQuQcg+qr8EOe1X/d G0JUwWV6I5R9fsd7CmnJe74xSegFdQCjHzBNVRpVnIzVTxbOvOI3EYCt0lfbM/U3KYWu tOlIy9NnnzHU0HK/E0lrwKrbg1u9JFV5fFTvsPEYFIJOolleQczmxqOrG1reqhZJZBn/ RhXAS7xy7lL04Aaik+MdwnTeqqKASVddYm7FtMItBwi2Ym1EMLNyV7arWBRkrZbHHa+5 ljqsjauLDHUQw9+EZW2fiDuVv6EEymZvfiTvUb3FJLOs+N/5umTXc3VrPu/9/c7kwoHC kZEw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=fFPMVH8x7yZS3XoxxzTYCgllXngH9yQeXi1Inar22tY=; b=dM0aX253GXy1wJAt2RJB54PFopoGOUtYnrnDFiWK9lfc1UHai9HOXTzTQUvl4Dc6fp 9jvuIf+HWXDdOG246zoDjF/M37RnFobXKJ+pMH+JUmiL0EEmD6djKijxQ38Rjybrq/+e 3K0mSQSu73Ho1sRx9lkkEVWGaphAG8ckM3pi/TiI7XUWQY62jEyKYXy8+zSe3eHR57uU OpDO1FWp68x5YSWIsKW4FoFs8IX0g5yhQRr6GbWz8j6jeeOM4d5CrAFDfauehkRJDxUz dbaeYRnHuU9w9xpaBN6Vys5i9uCHEEYPTWgEW2Fy+BKSahUzvVIcpJbp5AfNssoJMqre A26g== X-Gm-Message-State: AGi0PuavIVAf9eX9Za62OiUwbz/GtrW0N7Hn1Pzk9bgCwArUfT8/0roz Sms4WsN29J0SfvLxtx+NxfOxCGoV/jFnAosJozc= X-Google-Smtp-Source: APiQypJYTRA4G9BktZZ4uQuscc9xU8SkKtAhI8dCdwNdvg/kz4RZHCTZn7fBnvZ2lq6iY4cipgwcoxet7r7jwlcsRjI= X-Received: by 2002:a92:48cb:: with SMTP id j72mr9581166ilg.162.1586373510301; Wed, 08 Apr 2020 12:18:30 -0700 (PDT) MIME-Version: 1.0 References: <20200331192945.2466880-1-jerinj@marvell.com> <20200405085613.1336841-1-jerinj@marvell.com> <20200405085613.1336841-9-jerinj@marvell.com> In-Reply-To: From: Jerin Jacob Date: Thu, 9 Apr 2020 00:48:14 +0530 Message-ID: To: Andrzej Ostruszka Cc: dpdk-dev Content-Type: text/plain; charset="UTF-8" Subject: Re: [dpdk-dev] [PATCH v4 08/29] graph: implement graph operation APIs X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On Wed, Apr 8, 2020 at 11:19 PM Andrzej Ostruszka wrote: > > On 4/5/20 10:55 AM, jerinj@marvell.com wrote: > > From: Jerin Jacob > > > > Adding support for graph specific API implementation like > > Graph lookup to get graph object, retrieving graph ID > > From name and graph name from ID. > > > > Signed-off-by: Jerin Jacob > > Signed-off-by: Kiran Kumar K > > Signed-off-by: Pavan Nikhilesh > > Signed-off-by: Nithin Dabilpuram > > --- > > lib/librte_graph/graph.c | 131 +++++++++++++++++++++++++ > > lib/librte_graph/rte_graph_version.map | 8 ++ > > 2 files changed, 139 insertions(+) > > > > diff --git a/lib/librte_graph/graph.c b/lib/librte_graph/graph.c > > index dc373231e..7c6a7897d 100644 > > --- a/lib/librte_graph/graph.c > > +++ b/lib/librte_graph/graph.c > > @@ -210,6 +210,54 @@ graph_node_fini(struct graph *graph) > > graph_node->node->name)); > > } > > > > +static struct rte_graph * > > +graph_mem_fixup_node_ctx(struct rte_graph *graph) > > How is this function fixing context? It only updates process pointer > never touching context. In the multiprocess model, # The primary process( using rte_graph_create() API), it will create the graph object in hugepage memory # Secondary process calls rte_graph_lookup() to get the graph object, created by the primary process. Internally it uses rte_memzone_lookup() to get the hugepage memory populated by the primary process. # The ONLY data that need to be updated in the secondary process context is the process() function pointer. graph_mem_fixup_node_ctx(), do name-based lookup with node name and replace with function pointer in secondary process context. > > > +{ > > + struct rte_node *node; > > + struct node *node_db; > > + rte_graph_off_t off; > > + rte_node_t count; > > + const char *name; > > + > > + rte_graph_foreach_node(count, off, graph, node) { > > + if (node->parent_id == RTE_NODE_ID_INVALID) /* Static node */ > > + name = node->name; > > + else /* Cloned node */ > > + name = node->parent; > > + > > + node_db = node_from_name(name); > > + if (node_db == NULL) > > + SET_ERR_JMP(ENOLINK, fail, "Node %s not found", name); > > + node->process = node_db->process; > > + } > > + > > + return graph; > > +fail: > > + return NULL; > > +} > > + > > +static struct rte_graph * > > +graph_mem_fixup_secondray(struct rte_graph *graph) > > Typo here? I will fix it v5.