From mboxrd@z Thu Jan 1 00:00:00 1970 From: Hemant Agrawal Subject: [PATCH v3 2/7] eal: add API to set user default mbuf mempool ops Date: Thu, 18 Jan 2018 18:56:27 +0530 Message-ID: <1516281992-6873-3-git-send-email-hemant.agrawal@nxp.com> References: <1515996674-26338-1-git-send-email-hemant.agrawal@nxp.com> <1516281992-6873-1-git-send-email-hemant.agrawal@nxp.com> Mime-Version: 1.0 Content-Type: text/plain Cc: , , , Pavan Nikhilesh To: Return-path: Received: from NAM03-DM3-obe.outbound.protection.outlook.com (mail-dm3nam03on0040.outbound.protection.outlook.com [104.47.41.40]) by dpdk.org (Postfix) with ESMTP id 5703F1B1E1 for ; Thu, 18 Jan 2018 14:27:53 +0100 (CET) In-Reply-To: <1516281992-6873-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" Add new API to set the user defined mbuf mempool ops name i.e. set the provided ops name to `internal_config.mbuf_pool_ops_name`. Signed-off-by: Pavan Nikhilesh Signed-off-by: Hemant Agrawal --- lib/librte_eal/bsdapp/eal/eal.c | 6 ++++++ lib/librte_eal/common/include/rte_eal.h | 9 +++++++++ lib/librte_eal/linuxapp/eal/eal.c | 6 ++++++ lib/librte_eal/rte_eal_version.map | 1 + 4 files changed, 22 insertions(+) diff --git a/lib/librte_eal/bsdapp/eal/eal.c b/lib/librte_eal/bsdapp/eal/eal.c index c602d02..64f010a 100644 --- a/lib/librte_eal/bsdapp/eal/eal.c +++ b/lib/librte_eal/bsdapp/eal/eal.c @@ -117,6 +117,12 @@ rte_eal_mbuf_default_mempool_ops(void) return internal_config.user_mbuf_pool_ops_name; } +void +rte_eal_set_mbuf_user_mempool_ops(const char *ops_name) +{ + internal_config.user_mbuf_pool_ops_name = ops_name; +} + /* Return a pointer to the configuration structure */ struct rte_config * rte_eal_get_configuration(void) diff --git a/lib/librte_eal/common/include/rte_eal.h b/lib/librte_eal/common/include/rte_eal.h index 2aba2c8..7645b34 100644 --- a/lib/librte_eal/common/include/rte_eal.h +++ b/lib/librte_eal/common/include/rte_eal.h @@ -307,6 +307,15 @@ enum rte_iova_mode rte_eal_iova_mode(void); const char * rte_eal_mbuf_default_mempool_ops(void); +/** + * Set user pool ops name for mbuf + * + * @param ops_name + * mempool ops name that is to be set as user defined. + */ +void +rte_eal_set_mbuf_user_mempool_ops(const char *ops_name); + #ifdef __cplusplus } #endif diff --git a/lib/librte_eal/linuxapp/eal/eal.c b/lib/librte_eal/linuxapp/eal/eal.c index e8c7100..46b2bb3 100644 --- a/lib/librte_eal/linuxapp/eal/eal.c +++ b/lib/librte_eal/linuxapp/eal/eal.c @@ -127,6 +127,12 @@ rte_eal_mbuf_default_mempool_ops(void) return internal_config.user_mbuf_pool_ops_name; } +void +rte_eal_set_mbuf_user_mempool_ops(const char *ops_name) +{ + internal_config.user_mbuf_pool_ops_name = ops_name; +} + /* Return a pointer to the configuration structure */ struct rte_config * rte_eal_get_configuration(void) diff --git a/lib/librte_eal/rte_eal_version.map b/lib/librte_eal/rte_eal_version.map index 7088b72..3529885 100644 --- a/lib/librte_eal/rte_eal_version.map +++ b/lib/librte_eal/rte_eal_version.map @@ -203,6 +203,7 @@ DPDK_17.11 { DPDK_18.02 { global: + rte_eal_set_mbuf_user_mempool_ops; rte_hypervisor_get; rte_hypervisor_get_name; rte_vfio_clear_group; -- 2.7.4