]> git.droids-corp.org - dpdk.git/commitdiff
mbuf: fix logic of user mempool ops API
authorNipun Gupta <nipun.gupta@nxp.com>
Fri, 2 Feb 2018 08:03:01 +0000 (13:33 +0530)
committerThomas Monjalon <thomas@monjalon.net>
Tue, 6 Feb 2018 00:02:12 +0000 (01:02 +0100)
The existing rte_eal_mbuf_default mempool ops can return the compile time
default ops name if the user has not provided command line inputs for
mempool ops name. It will break the logic of best mempool ops as it will
never return platform hw mempool ops.

This patch introduces a new API to just return the user mempool ops only.

Fixes: 8b0f7f434132 ("mbuf: maintain user and compile time mempool ops name")
Signed-off-by: Nipun Gupta <nipun.gupta@nxp.com>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
lib/librte_eal/bsdapp/eal/eal.c
lib/librte_eal/common/include/rte_eal.h
lib/librte_eal/linuxapp/eal/eal.c
lib/librte_eal/rte_eal_version.map
lib/librte_mbuf/rte_mbuf_pool_ops.c

index 1622a419cefb4bdb517fe4e2215c90415a3034b9..4eafcb5ad1d2063ba12ebd3b244b7a10510a12a1 100644 (file)
@@ -82,6 +82,13 @@ struct internal_config internal_config;
 /* used by rte_rdtsc() */
 int rte_cycles_vmware_tsc_map;
 
+/* Return user provided mbuf pool ops name */
+const char * __rte_experimental
+rte_eal_mbuf_user_pool_ops(void)
+{
+       return internal_config.user_mbuf_pool_ops_name;
+}
+
 /* Return mbuf pool ops name */
 const char *
 rte_eal_mbuf_default_mempool_ops(void)
index 08c66373e43397e16589789fb10efa7be86698b0..044474e6c1ea422cda3b2baea4db4561de05bc72 100644 (file)
@@ -451,6 +451,18 @@ static inline int rte_gettid(void)
  */
 enum rte_iova_mode rte_eal_iova_mode(void);
 
+/**
+ * @warning
+ * @b EXPERIMENTAL: this API may change without prior notice
+ *
+ * Get user provided pool ops name for mbuf
+ *
+ * @return
+ *   returns user provided pool ops name.
+ */
+const char * __rte_experimental
+rte_eal_mbuf_user_pool_ops(void);
+
 /**
  * Get default pool ops name for mbuf
  *
index 451fdaf7acd24240769c76fbfa774d98ce1ef9c7..38306bf5c8d5f6979e5cc4b28cc25445a7087fdc 100644 (file)
@@ -92,6 +92,13 @@ struct internal_config internal_config;
 /* used by rte_rdtsc() */
 int rte_cycles_vmware_tsc_map;
 
+/* Return user provided mbuf pool ops name */
+const char * __rte_experimental
+rte_eal_mbuf_user_pool_ops(void)
+{
+       return internal_config.user_mbuf_pool_ops_name;
+}
+
 /* Return mbuf pool ops name */
 const char *
 rte_eal_mbuf_default_mempool_ops(void)
index 4146907a9e10d1d1ae351e91d355d39f794a0947..2e6cbe96e84ef5c9676553178fb6f6a729700caa 100644 (file)
@@ -220,6 +220,7 @@ EXPERIMENTAL {
        rte_eal_devargs_remove;
        rte_eal_hotplug_add;
        rte_eal_hotplug_remove;
+       rte_eal_mbuf_user_pool_ops;
        rte_mp_action_register;
        rte_mp_action_unregister;
        rte_mp_sendmsg;
index 385fc438f432aceaf91a4b8ddb98a5370d9e1573..48cc342002a538ce24a99f8f15e3324b1900cf68 100644 (file)
@@ -74,7 +74,7 @@ rte_mbuf_user_mempool_ops(void)
 
        mz = rte_memzone_lookup("mbuf_user_pool_ops");
        if (mz == NULL)
-               return rte_eal_mbuf_default_mempool_ops();
+               return rte_eal_mbuf_user_pool_ops();
        return mz->addr;
 }