mbuf: extend meaning of QinQ stripped bit
[dpdk.git] / lib / librte_mbuf / rte_mbuf_pool_ops.c
index a1d4699..f0e87a1 100644 (file)
@@ -9,12 +9,15 @@
 #include <rte_errno.h>
 #include <rte_mbuf_pool_ops.h>
 
-int __rte_experimental
+int
 rte_mbuf_set_platform_mempool_ops(const char *ops_name)
 {
        const struct rte_memzone *mz;
 
-       if (strlen(ops_name) >= RTE_MEMPOOL_OPS_NAMESIZE)
+       size_t len = strnlen(ops_name, RTE_MEMPOOL_OPS_NAMESIZE);
+       if (len == 0)
+               return -EINVAL;
+       if (len == RTE_MEMPOOL_OPS_NAMESIZE)
                return -ENAMETOOLONG;
 
        mz = rte_memzone_lookup("mbuf_platform_pool_ops");
@@ -35,7 +38,7 @@ rte_mbuf_set_platform_mempool_ops(const char *ops_name)
        return -EEXIST;
 }
 
-const char * __rte_experimental
+const char *
 rte_mbuf_platform_mempool_ops(void)
 {
        const struct rte_memzone *mz;
@@ -46,12 +49,15 @@ rte_mbuf_platform_mempool_ops(void)
        return mz->addr;
 }
 
-int __rte_experimental
+int
 rte_mbuf_set_user_mempool_ops(const char *ops_name)
 {
        const struct rte_memzone *mz;
 
-       if (strlen(ops_name) >= RTE_MEMPOOL_OPS_NAMESIZE)
+       size_t len = strnlen(ops_name, RTE_MEMPOOL_OPS_NAMESIZE);
+       if (len == 0)
+               return -EINVAL;
+       if (len == RTE_MEMPOOL_OPS_NAMESIZE)
                return -ENAMETOOLONG;
 
        mz = rte_memzone_lookup("mbuf_user_pool_ops");
@@ -67,7 +73,7 @@ rte_mbuf_set_user_mempool_ops(const char *ops_name)
 
 }
 
-const char * __rte_experimental
+const char *
 rte_mbuf_user_mempool_ops(void)
 {
        const struct rte_memzone *mz;
@@ -79,7 +85,7 @@ rte_mbuf_user_mempool_ops(void)
 }
 
 /* Return mbuf pool ops name */
-const char * __rte_experimental
+const char *
 rte_mbuf_best_mempool_ops(void)
 {
        /* User defined mempool ops takes the priority */