diff mbox

[v2] add odp_buffer_pool_destroy

Message ID 1414782616-21821-1-git-send-email-mike.holmes@linaro.org
State Rejected
Headers show

Commit Message

Mike Holmes Oct. 31, 2014, 7:10 p.m. UTC
Signed-off-by: Mike Holmes <mike.holmes@linaro.org>
---
 platform/linux-generic/include/api/odp_buffer_pool.h | 18 ++++++++++++++++++
 platform/linux-generic/odp_buffer_pool.c             |  7 +++++++
 2 files changed, 25 insertions(+)

Comments

Mike Holmes Nov. 5, 2014, 8:46 p.m. UTC | #1
Bill, can I drop this for you to add to your larger rewrite of buffers and
packets ?

On 31 October 2014 15:10, Mike Holmes <mike.holmes@linaro.org> wrote:

> Signed-off-by: Mike Holmes <mike.holmes@linaro.org>
> ---
>  platform/linux-generic/include/api/odp_buffer_pool.h | 18
> ++++++++++++++++++
>  platform/linux-generic/odp_buffer_pool.c             |  7 +++++++
>  2 files changed, 25 insertions(+)
>
> diff --git a/platform/linux-generic/include/api/odp_buffer_pool.h
> b/platform/linux-generic/include/api/odp_buffer_pool.h
> index d04abf0..7225fb7 100644
> --- a/platform/linux-generic/include/api/odp_buffer_pool.h
> +++ b/platform/linux-generic/include/api/odp_buffer_pool.h
> @@ -55,6 +55,24 @@ odp_buffer_pool_t odp_buffer_pool_create(const char
> *name,
>                                          size_t buf_size, size_t buf_align,
>                                          int buf_type);
>
> +/**
> + * Destroy a buffer pool
> + *
> + * This routine destroys a previously created buffer pool.
> + * @note Attempts to destroy a predefined buffer pool will be rejected.
> + * @warning The result is undefined if an attempt is made to destroy a
> buffer pool that
> + * contains allocated buffers.
> + *
> + * @sa odp_buffer_free
> + *
> + * @param pool[in]  Buffer pool handle
> + *
> + * @retval 0 for success
> + * @retval 1 on failure
> + */
> +int odp_buffer_pool_destroy(odp_buffer_pool_t pool);
> +
> +
>
>  /**
>   * Find a buffer pool by name
> diff --git a/platform/linux-generic/odp_buffer_pool.c
> b/platform/linux-generic/odp_buffer_pool.c
> index a48d7d6..d205f25 100644
> --- a/platform/linux-generic/odp_buffer_pool.c
> +++ b/platform/linux-generic/odp_buffer_pool.c
> @@ -16,6 +16,7 @@
>  #include <odp_config.h>
>  #include <odp_hints.h>
>  #include <odp_debug.h>
> +#include <odp_debug_internal.h>
>
>  #include <string.h>
>  #include <stdlib.h>
> @@ -410,6 +411,12 @@ odp_buffer_pool_t odp_buffer_pool_create(const char
> *name,
>         return pool_hdl;
>  }
>
> +/** @todo bug 619 */
> +int odp_buffer_pool_destroy(odp_buffer_pool_t pool ODP_UNUSED)
> +{
> +       ODP_UNIMPLEMENTED();
> +       return 0;
> +}
>
>  odp_buffer_pool_t odp_buffer_pool_lookup(const char *name)
>  {
> --
> 2.1.0
>
>
Bill Fischofer Nov. 6, 2014, 12:55 a.m. UTC | #2
Absolutely.

On Wed, Nov 5, 2014 at 2:46 PM, Mike Holmes <mike.holmes@linaro.org> wrote:

> Bill, can I drop this for you to add to your larger rewrite of buffers and
> packets ?
>
> On 31 October 2014 15:10, Mike Holmes <mike.holmes@linaro.org> wrote:
>
>> Signed-off-by: Mike Holmes <mike.holmes@linaro.org>
>> ---
>>  platform/linux-generic/include/api/odp_buffer_pool.h | 18
>> ++++++++++++++++++
>>  platform/linux-generic/odp_buffer_pool.c             |  7 +++++++
>>  2 files changed, 25 insertions(+)
>>
>> diff --git a/platform/linux-generic/include/api/odp_buffer_pool.h
>> b/platform/linux-generic/include/api/odp_buffer_pool.h
>> index d04abf0..7225fb7 100644
>> --- a/platform/linux-generic/include/api/odp_buffer_pool.h
>> +++ b/platform/linux-generic/include/api/odp_buffer_pool.h
>> @@ -55,6 +55,24 @@ odp_buffer_pool_t odp_buffer_pool_create(const char
>> *name,
>>                                          size_t buf_size, size_t
>> buf_align,
>>                                          int buf_type);
>>
>> +/**
>> + * Destroy a buffer pool
>> + *
>> + * This routine destroys a previously created buffer pool.
>> + * @note Attempts to destroy a predefined buffer pool will be rejected.
>> + * @warning The result is undefined if an attempt is made to destroy a
>> buffer pool that
>> + * contains allocated buffers.
>> + *
>> + * @sa odp_buffer_free
>> + *
>> + * @param pool[in]  Buffer pool handle
>> + *
>> + * @retval 0 for success
>> + * @retval 1 on failure
>> + */
>> +int odp_buffer_pool_destroy(odp_buffer_pool_t pool);
>> +
>> +
>>
>>  /**
>>   * Find a buffer pool by name
>> diff --git a/platform/linux-generic/odp_buffer_pool.c
>> b/platform/linux-generic/odp_buffer_pool.c
>> index a48d7d6..d205f25 100644
>> --- a/platform/linux-generic/odp_buffer_pool.c
>> +++ b/platform/linux-generic/odp_buffer_pool.c
>> @@ -16,6 +16,7 @@
>>  #include <odp_config.h>
>>  #include <odp_hints.h>
>>  #include <odp_debug.h>
>> +#include <odp_debug_internal.h>
>>
>>  #include <string.h>
>>  #include <stdlib.h>
>> @@ -410,6 +411,12 @@ odp_buffer_pool_t odp_buffer_pool_create(const char
>> *name,
>>         return pool_hdl;
>>  }
>>
>> +/** @todo bug 619 */
>> +int odp_buffer_pool_destroy(odp_buffer_pool_t pool ODP_UNUSED)
>> +{
>> +       ODP_UNIMPLEMENTED();
>> +       return 0;
>> +}
>>
>>  odp_buffer_pool_t odp_buffer_pool_lookup(const char *name)
>>  {
>> --
>> 2.1.0
>>
>>
>
>
> --
> *Mike Holmes*
> Linaro  Sr Technical Manager
> LNG - ODP
>
> _______________________________________________
> lng-odp mailing list
> lng-odp@lists.linaro.org
> http://lists.linaro.org/mailman/listinfo/lng-odp
>
>
diff mbox

Patch

diff --git a/platform/linux-generic/include/api/odp_buffer_pool.h b/platform/linux-generic/include/api/odp_buffer_pool.h
index d04abf0..7225fb7 100644
--- a/platform/linux-generic/include/api/odp_buffer_pool.h
+++ b/platform/linux-generic/include/api/odp_buffer_pool.h
@@ -55,6 +55,24 @@  odp_buffer_pool_t odp_buffer_pool_create(const char *name,
 					 size_t buf_size, size_t buf_align,
 					 int buf_type);
 
+/**
+ * Destroy a buffer pool
+ *
+ * This routine destroys a previously created buffer pool.
+ * @note Attempts to destroy a predefined buffer pool will be rejected.
+ * @warning The result is undefined if an attempt is made to destroy a buffer pool that
+ * contains allocated buffers.
+ *
+ * @sa odp_buffer_free
+ *
+ * @param pool[in]  Buffer pool handle
+ *
+ * @retval 0 for success
+ * @retval 1 on failure
+ */
+int odp_buffer_pool_destroy(odp_buffer_pool_t pool);
+
+
 
 /**
  * Find a buffer pool by name
diff --git a/platform/linux-generic/odp_buffer_pool.c b/platform/linux-generic/odp_buffer_pool.c
index a48d7d6..d205f25 100644
--- a/platform/linux-generic/odp_buffer_pool.c
+++ b/platform/linux-generic/odp_buffer_pool.c
@@ -16,6 +16,7 @@ 
 #include <odp_config.h>
 #include <odp_hints.h>
 #include <odp_debug.h>
+#include <odp_debug_internal.h>
 
 #include <string.h>
 #include <stdlib.h>
@@ -410,6 +411,12 @@  odp_buffer_pool_t odp_buffer_pool_create(const char *name,
 	return pool_hdl;
 }
 
+/** @todo bug 619 */
+int odp_buffer_pool_destroy(odp_buffer_pool_t pool ODP_UNUSED)
+{
+	ODP_UNIMPLEMENTED();
+	return 0;
+}
 
 odp_buffer_pool_t odp_buffer_pool_lookup(const char *name)
 {