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 D2CD5A04FA; Sun, 2 Feb 2020 12:09:14 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 456F71BFCF; Sun, 2 Feb 2020 12:09:14 +0100 (CET) Received: from mail-il1-f195.google.com (mail-il1-f195.google.com [209.85.166.195]) by dpdk.org (Postfix) with ESMTP id 21B881BFAD; Sun, 2 Feb 2020 12:09:13 +0100 (CET) Received: by mail-il1-f195.google.com with SMTP id s18so10191514iln.0; Sun, 02 Feb 2020 03:09:13 -0800 (PST) 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=cX3++4j6wDTMq9RapY1IMzVR5+Um3O1CTO1/9dkM4pU=; b=RKf3L9fntrh+AKbPNmEotecAYdz43V9+NOwtORZItjMDbPrDL2SNp+Hr8krCe9Hnqp I/RRGYU0TVyV3+2dL3HmCe2iS9CQ5hPIl5uaLZNUB8cYEHT6LbBxFwp9XCjUOKiqstNN 9QjeRcDNh3vQLFmB5J+FD9rsTKXUwu195N38MTtjOLyRrSoiC9ZBKJaJU4HmU8m0DHcp zTYG1QEXo6E+6EWp5k5wCa/lPc5FdVWa3xmEXsbgTi8g38uFhoOsmbyskqYTMD2lHgPh GqqEfCXEUOESvW34Jq1jqnWIiDDgm1PWjbKhuVOWa9H/QielaPy4x1SkCTacapu0Xd4/ wOxg== 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=cX3++4j6wDTMq9RapY1IMzVR5+Um3O1CTO1/9dkM4pU=; b=Up0gWhhSdtQhMOhyua08DXuOAMchqhCqh0e4nstVsHC+ZWnYowp/JSrdYcxEGNT1DU jr4jdKELXDgV6TsrGnfHYnnDZEI2bAGyY5iNWT4zIdaB+eAR8/6m7iJeWdp6+Vk3Xrf+ 4dwTpBs43PZfVpHF5r6QNkwuG1POP49TnVGkEooBwLZtgdV0MNvZEyP2e4hP1870r9V9 jyme1rHM4nhERU5hMnsDQvqAzusXVRyI/F0Ig3RRbjrua0G9ClwfZlXJ7Z7vouMuc4Nu Q98/uEeJJmxHalicWQrptswieHdReAR8w+9GnE9MDKhkE3yzXZLbWbB7J2axQDVpthid ohIA== X-Gm-Message-State: APjAAAW0L+84PS2h6FgJR4hILQvMixkM1rFQntrVS5n4yDZWAI/kRw5w 81QfHJklLUcDVgim+ILriV2iHzNMGmDAapL0nxI= X-Google-Smtp-Source: APXvYqwvMKg2CDqeBtbj5Ls0JVGYZ8BlU4semTjJYJ5ztMdwiwIvqvoNEhcx4NE6pWWoY1rP60hi+UXbFigthJngb4c= X-Received: by 2002:a92:1906:: with SMTP id 6mr18177585ilz.130.1580641752338; Sun, 02 Feb 2020 03:09:12 -0800 (PST) MIME-Version: 1.0 References: <20200131170201.3236153-1-jerinj@marvell.com> <20200131170201.3236153-2-jerinj@marvell.com> <20200202023523.2f160b4e@shemminger-XPS-13-9360> In-Reply-To: <20200202023523.2f160b4e@shemminger-XPS-13-9360> From: Jerin Jacob Date: Sun, 2 Feb 2020 16:38:55 +0530 Message-ID: To: Stephen Hemminger Cc: Jerin Jacob , dpdk-dev , Prasun Kapoor , Nithin Dabilpuram , Kiran Kumar K , Pavan Nikhilesh , Narayana Prasad , nsaxena@marvell.com, sshankarnara@marvell.com, Honnappa Nagarahalli , Thomas Monjalon , David Marchand , Ferruh Yigit , Andrew Rybchenko , Ajit Khaparde , "Ye, Xiaolong" , Raslan Darawsheh , Maxime Coquelin , Akhil Goyal , Cristian Dumitrescu , John McNamara , "Richardson, Bruce" , Anatoly Burakov , Gavin Hu , David Christensen , "Ananyev, Konstantin" , Pallavi Kadam , Olivier Matz , Gage Eads , "Rao, Nikhil" , Erik Gabriel Carrillo , Hemant Agrawal , "Artem V. Andreev" , Stephen Hemminger , Shahaf Shuler , "Wiles, Keith" , =?UTF-8?Q?Mattias_R=C3=B6nnblom?= , Jasvinder Singh , Vladimir Medvedkin , Ray Kinsella , techboard@dpdk.org Content-Type: text/plain; charset="UTF-8" Subject: Re: [dpdk-dev] [RFC PATCH 1/5] graph: introduce graph subsystem 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 Sun, Feb 2, 2020 at 4:05 PM Stephen Hemminger wrote: > > On Fri, 31 Jan 2020 22:31:57 +0530 > wrote: > > > + /* Create graph object */ > > + graph = calloc(1, sizeof(*graph)); > > + if (graph == NULL) > > + set_err(ENOMEM, fail, "failed to calloc graph object"); > > This won't be safe if used in primary/secondary process model. > You would need to use rte_calloc etc to allow this. That memory used only local housekeeping purposes. Down in the function, it creates a graph reel from the memzone with all the required data for fast path. see graph_fp_mem_create() workers/secondary process get the real fast path graph object through rte_graph_lookup() which returns the "struct rte_graph *". Followed by invoking rte_graph_walk(struct rte_graph *graph) for the graph walk. 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); }