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 04C9EA0597; Wed, 8 Apr 2020 19:49:42 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id DD82A1C1A5; Wed, 8 Apr 2020 19:49:41 +0200 (CEST) Received: from mail-lj1-f196.google.com (mail-lj1-f196.google.com [209.85.208.196]) by dpdk.org (Postfix) with ESMTP id 6E3C61C0CF for ; Wed, 8 Apr 2020 19:49:40 +0200 (CEST) Received: by mail-lj1-f196.google.com with SMTP id n17so8566971lji.8 for ; Wed, 08 Apr 2020 10:49:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=semihalf-com.20150623.gappssmtp.com; s=20150623; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-language:content-transfer-encoding; bh=ALdSZCxDMxKsVRleYB4E/a/J4XLl7Zex9pbYWUY4uo4=; b=XOUTSBU5z4K3n5BAUpYs4rMXo9em3jwY2WSssqBb79lQD0c1ajY/NyZm1W2PIFFSA1 VBM77s4f+Oa08BmxigWxitHfT/mZ3vhvh2TofVVA6uY6RHVgz77BTI4hjpwmWZews+1G YKGpuAqqwR+rom1EXAvW3zJE1wcRu37Rn1SaHCUifRXWWDAZBodaZmjfkfS7uv309OLa bDwpYPOPOTTgadd2nWlqzQWwKW3m9/8aNV6RepCfacEWaiIsTAB9zF4p70yM2TwsQKPm 9pNuEeCZ9mZh4/gRXjkRUuo9hX6LD4seiNQhM6EE8vntRh8wIiXzL70uW7lgs1eNzNSG qVFQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=ALdSZCxDMxKsVRleYB4E/a/J4XLl7Zex9pbYWUY4uo4=; b=AlZTaaifBwBWStELEA45QxRhRenIDlszze/ToE8T8YYXkiqSnrtxVWdsJgRrwQ2kTu bK7LlqwAApK/OwM1K6RNRWfoC2FmJOA9ygDJY43nf6+J+9kNAXGpq/JE597/I4Pghjvz HGi5L49Pmbvij5vOCewdSahfc82EsFaQ/PtpRQjweQ+N0Rv0M4zq+V/nflPOTeWHL70p E1BIwKp4RVz386e4Bmxk6TP9uZ0tKgIx98r8JD4Sa0zxLBpGuebUnStYNKNPNkx/EgIy rggGQN5hx3UupyXL4RkKmo/ybhgMuuwRiY+rHsv2wEEK6HeH1dGJFBMr/zYNoq1WJ7ng J0gA== X-Gm-Message-State: AGi0PuY5kCvVaWnLeUIbLkyPdWjj/dGgZiviw20tTFoXxSd+aof0uxCt dSEYZzIrBwdFGXKlVaWF6kQyDarUD3o= X-Google-Smtp-Source: APiQypLrn1tRHEtuwG39z+gSBQsM6rpYND0EFtfCmUQWrub8q+ZrE3/XZavZEORT+cyrqZ3pLbh+qw== X-Received: by 2002:a2e:8958:: with SMTP id b24mr6052259ljk.211.1586368179468; Wed, 08 Apr 2020 10:49:39 -0700 (PDT) Received: from [192.168.8.100] (user-5-173-33-152.play-internet.pl. [5.173.33.152]) by smtp.gmail.com with ESMTPSA id c22sm15474447lfi.41.2020.04.08.10.49.38 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 08 Apr 2020 10:49:38 -0700 (PDT) To: dev@dpdk.org References: <20200331192945.2466880-1-jerinj@marvell.com> <20200405085613.1336841-1-jerinj@marvell.com> <20200405085613.1336841-9-jerinj@marvell.com> From: Andrzej Ostruszka Message-ID: Date: Wed, 8 Apr 2020 19:49:36 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Firefox/68.0 Thunderbird/68.4.1 MIME-Version: 1.0 In-Reply-To: <20200405085613.1336841-9-jerinj@marvell.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit 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 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. > +{ > + 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? > +{ > + if (graph == NULL || rte_eal_process_type() == RTE_PROC_PRIMARY) > + return graph; > + > + return graph_mem_fixup_node_ctx(graph); > +} > + > +struct rte_graph * > +rte_graph_lookup(const char *name) > +{ > + const struct rte_memzone *mz; > + struct rte_graph *rc = NULL; > + > + mz = rte_memzone_lookup(name); > + if (mz) > + rc = mz->addr; > + > + return graph_mem_fixup_secondray(rc); > +} [...] With regards Andrzej Ostruszka