[dpdk-dev] [PATCH 1/3] eal: add API to set default mbuf mempool ops

Pavan Nikhilesh pbhagavatula at caviumnetworks.com
Wed Dec 13 20:55:36 CET 2017


Add new API to set the default mbuf mempool ops name i.e. set the provided
ops name to `internal_config.mbuf_pool_ops_name`.

Signed-off-by: Pavan Nikhilesh <pbhagavatula at caviumnetworks.com>
---
 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      | 6 ++++++
 4 files changed, 27 insertions(+)

diff --git a/lib/librte_eal/bsdapp/eal/eal.c b/lib/librte_eal/bsdapp/eal/eal.c
index 369a682a8..dc87ffbdc 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.mbuf_pool_ops_name;
 }
 
+void
+rte_eal_set_mbuf_default_mempool_ops(const char *ops_name)
+{
+	internal_config.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 8e4e71cc1..eb7db5797 100644
--- a/lib/librte_eal/common/include/rte_eal.h
+++ b/lib/librte_eal/common/include/rte_eal.h
@@ -335,6 +335,15 @@ enum rte_iova_mode rte_eal_iova_mode(void);
 const char *
 rte_eal_mbuf_default_mempool_ops(void);
 
+/**
+ * Set default pool ops name for mbuf
+ *
+ * @param ops_name
+ *   mempool ops name that is to be set as default.
+ */
+void
+rte_eal_set_mbuf_default_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 229eec9f1..5c6feff64 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.mbuf_pool_ops_name;
 }
 
+void
+rte_eal_set_mbuf_default_mempool_ops(const char *ops_name)
+{
+	internal_config.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 f4f46c1be..43a6fa97f 100644
--- a/lib/librte_eal/rte_eal_version.map
+++ b/lib/librte_eal/rte_eal_version.map
@@ -200,6 +200,12 @@ DPDK_17.11 {
 
 } DPDK_17.08;
 
+DPDK_18.02 {
+	global:
+
+	rte_eal_set_mbuf_default_mempool_ops;
+} DPDK_17.11;
+
 EXPERIMENTAL {
 	global:
 
-- 
2.14.1



More information about the dev mailing list