diff mbox

[4/7] linux-generic: queue: add destroy check for ordered queues

Message ID 1441238841-25105-5-git-send-email-bill.fischofer@linaro.org
State New
Headers show

Commit Message

Bill Fischofer Sept. 3, 2015, 12:07 a.m. UTC
Ensure that the reorder queue associated with ordered queues is empty
as part of odp_queue_destroy() processing

Signed-off-by: Bill Fischofer <bill.fischofer@linaro.org>
---
 platform/linux-generic/odp_queue.c | 5 +++++
 1 file changed, 5 insertions(+)

Comments

Maxim Uvarov Sept. 3, 2015, 5:23 a.m. UTC | #1
On 09/03/15 03:07, Bill Fischofer wrote:
> Ensure that the reorder queue associated with ordered queues is empty
> as part of odp_queue_destroy() processing
>
> Signed-off-by: Bill Fischofer <bill.fischofer@linaro.org>
> ---
>   platform/linux-generic/odp_queue.c | 5 +++++
>   1 file changed, 5 insertions(+)
>
> diff --git a/platform/linux-generic/odp_queue.c b/platform/linux-generic/odp_queue.c
> index bc59d88..87c5f91 100644
> --- a/platform/linux-generic/odp_queue.c
> +++ b/platform/linux-generic/odp_queue.c
> @@ -274,6 +274,11 @@ int odp_queue_destroy(odp_queue_t handle)
>   		ODP_ERR("queue \"%s\" not empty\n", queue->s.name);
>   		return -1;
>   	}
> +	if (queue_is_ordered(queue) && queue->s.reorder_head) {
> +		UNLOCK(&queue->s.lock);
> +		ODP_ERR("queue \"%s\" reorder queue not empty\n",
> +			queue->s.name);
> +	}

did you miss return? there is unlock in the end of function.

Maxim.
>   
>   	switch (queue->s.status) {
>   	case QUEUE_STATUS_READY:
Bill Fischofer Sept. 3, 2015, 11:57 a.m. UTC | #2
Yes, good catch.  I'll post a v2 to address that.

On Thu, Sep 3, 2015 at 12:23 AM, Maxim Uvarov <maxim.uvarov@linaro.org>
wrote:

> On 09/03/15 03:07, Bill Fischofer wrote:
>
>> Ensure that the reorder queue associated with ordered queues is empty
>> as part of odp_queue_destroy() processing
>>
>> Signed-off-by: Bill Fischofer <bill.fischofer@linaro.org>
>> ---
>>   platform/linux-generic/odp_queue.c | 5 +++++
>>   1 file changed, 5 insertions(+)
>>
>> diff --git a/platform/linux-generic/odp_queue.c
>> b/platform/linux-generic/odp_queue.c
>> index bc59d88..87c5f91 100644
>> --- a/platform/linux-generic/odp_queue.c
>> +++ b/platform/linux-generic/odp_queue.c
>> @@ -274,6 +274,11 @@ int odp_queue_destroy(odp_queue_t handle)
>>                 ODP_ERR("queue \"%s\" not empty\n", queue->s.name);
>>                 return -1;
>>         }
>> +       if (queue_is_ordered(queue) && queue->s.reorder_head) {
>> +               UNLOCK(&queue->s.lock);
>> +               ODP_ERR("queue \"%s\" reorder queue not empty\n",
>> +                       queue->s.name);
>> +       }
>>
>
> did you miss return? there is unlock in the end of function.
>
> Maxim.
>
>         switch (queue->s.status) {
>>         case QUEUE_STATUS_READY:
>>
>
>
Maxim Uvarov Sept. 3, 2015, 12:11 p.m. UTC | #3
please also pull changes for master. I see rejects on applying that patches.

Maxim.

On 09/03/15 14:57, Bill Fischofer wrote:
> Yes, good catch.  I'll post a v2 to address that.
>
> On Thu, Sep 3, 2015 at 12:23 AM, Maxim Uvarov <maxim.uvarov@linaro.org 
> <mailto:maxim.uvarov@linaro.org>> wrote:
>
>     On 09/03/15 03:07, Bill Fischofer wrote:
>
>         Ensure that the reorder queue associated with ordered queues
>         is empty
>         as part of odp_queue_destroy() processing
>
>         Signed-off-by: Bill Fischofer <bill.fischofer@linaro.org
>         <mailto:bill.fischofer@linaro.org>>
>         ---
>           platform/linux-generic/odp_queue.c | 5 +++++
>           1 file changed, 5 insertions(+)
>
>         diff --git a/platform/linux-generic/odp_queue.c
>         b/platform/linux-generic/odp_queue.c
>         index bc59d88..87c5f91 100644
>         --- a/platform/linux-generic/odp_queue.c
>         +++ b/platform/linux-generic/odp_queue.c
>         @@ -274,6 +274,11 @@ int odp_queue_destroy(odp_queue_t handle)
>                         ODP_ERR("queue \"%s\" not empty\n",
>         queue->s.name <http://s.name>);
>                         return -1;
>                 }
>         +       if (queue_is_ordered(queue) && queue->s.reorder_head) {
>         +               UNLOCK(&queue->s.lock);
>         +               ODP_ERR("queue \"%s\" reorder queue not empty\n",
>         +                       queue->s.name <http://s.name>);
>         +       }
>
>
>     did you miss return? there is unlock in the end of function.
>
>     Maxim.
>
>                 switch (queue->s.status) {
>                 case QUEUE_STATUS_READY:
>
>
>
diff mbox

Patch

diff --git a/platform/linux-generic/odp_queue.c b/platform/linux-generic/odp_queue.c
index bc59d88..87c5f91 100644
--- a/platform/linux-generic/odp_queue.c
+++ b/platform/linux-generic/odp_queue.c
@@ -274,6 +274,11 @@  int odp_queue_destroy(odp_queue_t handle)
 		ODP_ERR("queue \"%s\" not empty\n", queue->s.name);
 		return -1;
 	}
+	if (queue_is_ordered(queue) && queue->s.reorder_head) {
+		UNLOCK(&queue->s.lock);
+		ODP_ERR("queue \"%s\" reorder queue not empty\n",
+			queue->s.name);
+	}
 
 	switch (queue->s.status) {
 	case QUEUE_STATUS_READY: