From patchwork Tue Jun 25 10:40:18 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hemant Agrawal X-Patchwork-Id: 167691 Delivered-To: patch@linaro.org Received: by 2002:ac9:6410:0:0:0:0:0 with SMTP id r16csp4826349ock; Tue, 25 Jun 2019 03:42:16 -0700 (PDT) X-Google-Smtp-Source: APXvYqyn+80dQOXyAowpv0lx+FlmhfXJwSJDsYf7G2zo48tQc6lSImILmQ06i1bhEUIYGDHRaF/R X-Received: by 2002:a17:906:1845:: with SMTP id w5mr24472753eje.0.1561459336293; Tue, 25 Jun 2019 03:42:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1561459336; cv=none; d=google.com; s=arc-20160816; b=k1wo59fA8VpVTXQOzC0Fh7I6PHRIk0YrqLn/c70o2sDxvqAdFoxiaOOgV6QT2Vk4hD jr3ezU/JumNqbOdXVvy4CASIcU30pnV7IS0KfRoX9lOPMaUbEpXnkQWGE5uw4Ta66emt M5VDiEDR83b3QZrVwdI0Oz/8Hno09+GJ24Zj6CHVw67r92P2HJz6V4F5fn3oqu6Otzq9 tZDAD0LCVfMCmySepS/JOZeVb9yY7V6WPu+vfQemfQpxQOwZ8+qttCWi/roRI48rRsUP lRar1olNypa8t9iSxvhIkvOXrx835041UNJLo7wtUlavJZpdeRo01qdR2Y8EHNMnsQGo zJIQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject:references:in-reply-to :message-id:date:cc:to:from; bh=IklopaFvHg1obhiyPT/eGnhQL8EFWCJA+Nbe/k7ALsQ=; b=Y4aHPRcch6RqakGCvlesIjRoPbgh7LtAfaTdiJCBbQ/+Mfb2y3ULtoTYIM49qsZlCZ nlqmHmwApTGeg5c19hMiyi1NKad3GG2XFK/y1foJhpZPU759m7Red6ElALv2dHbgyp6F FRGGVVBu6mhECvZcmcgahci2Uhldyv8mnFIgCaj8gVHoo8oaZ6oKLHvmlPoHr5xPPqz/ l2qquhGLtXqptNxH5H6Zn5lH2lIJAg2N+rt8nzNi/7omeggWv/H8ShAlVCkCY+gu5syQ Q/vSo+g5kbD1yoHpathLMfW5O3C3RvPDjYkfgU3VOVE26dE0Aash/dQUtV9pJ7JCnZ/0 yosA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) smtp.mailfrom=dev-bounces@dpdk.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Return-Path: Received: from dpdk.org (dpdk.org. [92.243.14.124]) by mx.google.com with ESMTP id z5si101847edp.114.2019.06.25.03.42.16; Tue, 25 Jun 2019 03:42:16 -0700 (PDT) Received-SPF: pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) client-ip=92.243.14.124; Authentication-Results: mx.google.com; spf=pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) smtp.mailfrom=dev-bounces@dpdk.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 9882B1B9E6; Tue, 25 Jun 2019 12:42:09 +0200 (CEST) Received: from inva020.nxp.com (inva020.nxp.com [92.121.34.13]) by dpdk.org (Postfix) with ESMTP id 59BA8559A for ; Tue, 25 Jun 2019 12:42:04 +0200 (CEST) Received: from inva020.nxp.com (localhost [127.0.0.1]) by inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id E38F11A07AF; Tue, 25 Jun 2019 12:42:03 +0200 (CEST) Received: from invc005.ap-rdc01.nxp.com (invc005.ap-rdc01.nxp.com [165.114.16.14]) by inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id 477A01A07B6; Tue, 25 Jun 2019 12:42:02 +0200 (CEST) Received: from bf-netperf1.ap.freescale.net (bf-netperf1.ap.freescale.net [10.232.133.63]) by invc005.ap-rdc01.nxp.com (Postfix) with ESMTP id C235E402FB; Tue, 25 Jun 2019 18:41:59 +0800 (SGT) From: Hemant Agrawal To: dev@dpdk.org Cc: ferruh.yigit@intel.com Date: Tue, 25 Jun 2019 16:10:18 +0530 Message-Id: <20190625104019.19287-2-hemant.agrawal@nxp.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190625104019.19287-1-hemant.agrawal@nxp.com> References: <20190625104019.19287-1-hemant.agrawal@nxp.com> X-Virus-Scanned: ClamAV using ClamSMTP Subject: [dpdk-dev] [PATCH 2/3] bus/dpaa: update dpaa mempool for secondary process 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" 1. need to use the bpool with rte_malloc instead of rte_free 2. Option to give portal to the seondary process thread. Signed-off-by: Radu Bulie Signed-off-by: Hemant Agrawal Tested-by: Akhil Goyal --- drivers/bus/dpaa/include/compat.h | 10 ++++++---- drivers/mempool/dpaa/dpaa_mempool.c | 11 ++++++++++- 2 files changed, 16 insertions(+), 5 deletions(-) -- 2.17.1 diff --git a/drivers/bus/dpaa/include/compat.h b/drivers/bus/dpaa/include/compat.h index 86cecf67b..277ce6369 100644 --- a/drivers/bus/dpaa/include/compat.h +++ b/drivers/bus/dpaa/include/compat.h @@ -2,6 +2,7 @@ * * Copyright 2011 Freescale Semiconductor, Inc. * All rights reserved. + * Copyright 2019 NXP * */ @@ -40,6 +41,7 @@ #include #include #include +#include /* The following definitions are primarily to allow the single-source driver * interfaces to be included by arbitrary program code. Ie. for interfaces that @@ -339,12 +341,12 @@ static inline void copy_bytes(void *dest, const void *src, size_t sz) #endif /* Allocator stuff */ -#define kmalloc(sz, t) malloc(sz) -#define vmalloc(sz) malloc(sz) -#define kfree(p) { if (p) free(p); } +#define kmalloc(sz, t) rte_malloc(NULL, sz, 0) +#define vmalloc(sz) rte_malloc(NULL, sz, 0) +#define kfree(p) { if (p) rte_free(p); } static inline void *kzalloc(size_t sz, gfp_t __foo __rte_unused) { - void *ptr = malloc(sz); + void *ptr = rte_malloc(NULL, sz, 0); if (ptr) memset(ptr, 0, sz); diff --git a/drivers/mempool/dpaa/dpaa_mempool.c b/drivers/mempool/dpaa/dpaa_mempool.c index 003081772..3551e6d10 100644 --- a/drivers/mempool/dpaa/dpaa_mempool.c +++ b/drivers/mempool/dpaa/dpaa_mempool.c @@ -1,6 +1,6 @@ /* SPDX-License-Identifier: BSD-3-Clause * - * Copyright 2017 NXP + * Copyright 2017,2019 NXP * */ @@ -51,6 +51,15 @@ dpaa_mbuf_create_pool(struct rte_mempool *mp) MEMPOOL_INIT_FUNC_TRACE(); + if (unlikely(!RTE_PER_LCORE(dpaa_io))) { + ret = rte_dpaa_portal_init((void *)0); + if (ret) { + DPAA_MEMPOOL_ERR( + "rte_dpaa_portal_init failed with ret: %d", + ret); + return -1; + } + } bp = bman_new_pool(¶ms); if (!bp) { DPAA_MEMPOOL_ERR("bman_new_pool() failed");