From: Hemant Agrawal <hemant.agrawal@nxp.com>
To: dev@dpdk.org
Cc: ferruh.yigit@intel.com
Subject: [dpdk-dev] [PATCH 2/3] bus/dpaa: update dpaa mempool for secondary process
Date: Tue, 25 Jun 2019 16:10:18 +0530 [thread overview]
Message-ID: <20190625104019.19287-2-hemant.agrawal@nxp.com> (raw)
In-Reply-To: <20190625104019.19287-1-hemant.agrawal@nxp.com>
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 <radu-andrei.bulie@nxp.com>
Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
Tested-by: Akhil Goyal <akhil.goyal@nxp.com>
---
drivers/bus/dpaa/include/compat.h | 10 ++++++----
drivers/mempool/dpaa/dpaa_mempool.c | 11 ++++++++++-
2 files changed, 16 insertions(+), 5 deletions(-)
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 <rte_common.h>
#include <rte_debug.h>
#include <rte_cycles.h>
+#include <rte_malloc.h>
/* 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");
--
2.17.1
next prev parent reply other threads:[~2019-06-25 10:42 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-06-25 10:40 [dpdk-dev] [PATCH 1/3] bus/dpaa: add plug support and rework parse Hemant Agrawal
2019-06-25 10:40 ` Hemant Agrawal [this message]
2019-06-25 10:40 ` [dpdk-dev] [PATCH 3/3] net/dpaa: support interface init for multi process Hemant Agrawal
2019-07-07 21:15 ` [dpdk-dev] [PATCH 1/3] bus/dpaa: add plug support and rework parse Thomas Monjalon
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20190625104019.19287-2-hemant.agrawal@nxp.com \
--to=hemant.agrawal@nxp.com \
--cc=dev@dpdk.org \
--cc=ferruh.yigit@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).