From mboxrd@z Thu Jan 1 00:00:00 1970 From: Hemant Agrawal Subject: [PATCH v7 2/7] mbuf: maintain user and compile time mempool ops name Date: Mon, 29 Jan 2018 13:40:44 +0530 Message-ID: <1517213449-678-3-git-send-email-hemant.agrawal@nxp.com> References: <1516629083-13967-1-git-send-email-hemant.agrawal@nxp.com> <1517213449-678-1-git-send-email-hemant.agrawal@nxp.com> Mime-Version: 1.0 Content-Type: text/plain Cc: jerin.jacob@caviumnetworks.com, olivier.matz@6wind.com, santosh.shukla@caviumnetworks.com To: thomas@monjalon.net, dev@dpdk.org Return-path: Received: from EUR01-DB5-obe.outbound.protection.outlook.com (mail-db5eur01on0087.outbound.protection.outlook.com [104.47.2.87]) by dpdk.org (Postfix) with ESMTP id 8CACD1B32A for ; Mon, 29 Jan 2018 09:12:23 +0100 (CET) In-Reply-To: <1517213449-678-1-git-send-email-hemant.agrawal@nxp.com> List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" At present the userdefined mempool ops name overwrites the default mempool ops name variable in internal_config. This patch change the logic to maintain the value of user defined only in the internal config. The pktmbuf_create_pool is updated to reflect the same ie. use user defined. If not present than use the default. Signed-off-by: Hemant Agrawal Acked-by: Olivier Matz Acked-by: Santosh Shukla --- lib/librte_eal/common/eal_common_options.c | 2 +- lib/librte_mbuf/rte_mbuf.c | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/librte_eal/common/eal_common_options.c b/lib/librte_eal/common/eal_common_options.c index 7a40414..b6d2762 100644 --- a/lib/librte_eal/common/eal_common_options.c +++ b/lib/librte_eal/common/eal_common_options.c @@ -218,7 +218,7 @@ eal_reset_internal_config(struct internal_config *internal_cfg) #endif internal_cfg->vmware_tsc_map = 0; internal_cfg->create_uio_dev = 0; - internal_cfg->user_mbuf_pool_ops_name = RTE_MBUF_DEFAULT_MEMPOOL_OPS; + internal_cfg->user_mbuf_pool_ops_name = NULL; } static int diff --git a/lib/librte_mbuf/rte_mbuf.c b/lib/librte_mbuf/rte_mbuf.c index 937fd70..c085c37 100644 --- a/lib/librte_mbuf/rte_mbuf.c +++ b/lib/librte_mbuf/rte_mbuf.c @@ -177,6 +177,8 @@ rte_pktmbuf_pool_create(const char *name, unsigned n, return NULL; mp_ops_name = rte_eal_mbuf_default_mempool_ops(); + if (mp_ops_name == NULL) + mp_ops_name = RTE_MBUF_DEFAULT_MEMPOOL_OPS; ret = rte_mempool_set_ops_byname(mp, mp_ops_name, NULL); if (ret != 0) { RTE_LOG(ERR, MBUF, "error setting mempool handler\n"); -- 2.7.4