From patchwork Thu Sep 3 15:16:36 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bill Fischofer X-Patchwork-Id: 53032 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-la0-f70.google.com (mail-la0-f70.google.com [209.85.215.70]) by patches.linaro.org (Postfix) with ESMTPS id 6E81622E23 for ; Thu, 3 Sep 2015 15:19:52 +0000 (UTC) Received: by laeb10 with SMTP id b10sf18052405lae.1 for ; Thu, 03 Sep 2015 08:19:51 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:delivered-to:from:to:date :message-id:in-reply-to:references:subject:precedence:list-id :list-unsubscribe:list-archive:list-post:list-help:list-subscribe :mime-version:content-type:content-transfer-encoding:errors-to :sender:x-original-sender:x-original-authentication-results :mailing-list; bh=nSI8mPCl5RVCBFpmgA8EaBW4vD/peUSE6cPZWwI+VfU=; b=JTydKNwoMm8EjePDbFaqqiIQsoZ/aTCfNJ4YkjinZ/Y7ZQrOck7V5sV30PQU3mV8Wp s/TB8UUGEUwGTKLxC0xhdKQdiTDF6ApZIFZwhexap2NK9sq/26ijsAAAR7LhN9NWOVvR KBoq2LDqG70nrwt0XOi34JuDyweZzhAb1k7d8DNF+aHwLUG2W7txefeXflPmTDrc8KJT 8ETiLuZgveFU/1myQopyf1m7ySdO+zjiTyNt88RbGG0BAvx3Onk6UmRyKgatXAx2BXmX zod0t+RbOII/doxkyyD1HzouwBDCpRl5Qp12hmtuo1cOKJTVS7x+8NPJVgX8XKCd88tb 0ayQ== X-Gm-Message-State: ALoCoQlNKkJZH9VoEEGdzKzeqRKmGKb9z7lEEeaOZtuik4w/wfHobzcQ4bR5/etL1Wt2mBDrfKLd X-Received: by 10.195.12.83 with SMTP id eo19mr325608wjd.0.1441293591277; Thu, 03 Sep 2015 08:19:51 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.25.134 with SMTP id c6ls242393lag.54.gmail; Thu, 03 Sep 2015 08:19:51 -0700 (PDT) X-Received: by 10.112.171.68 with SMTP id as4mr22252970lbc.64.1441293591106; Thu, 03 Sep 2015 08:19:51 -0700 (PDT) Received: from mail-lb0-f176.google.com (mail-lb0-f176.google.com. [209.85.217.176]) by mx.google.com with ESMTPS id us5si1336521lbb.58.2015.09.03.08.19.51 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 03 Sep 2015 08:19:51 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.176 as permitted sender) client-ip=209.85.217.176; Received: by lbcjc2 with SMTP id jc2so26317679lbc.0 for ; Thu, 03 Sep 2015 08:19:51 -0700 (PDT) X-Received: by 10.112.209.106 with SMTP id ml10mr21953744lbc.112.1441293591006; Thu, 03 Sep 2015 08:19:51 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.164.42 with SMTP id yn10csp1343789lbb; Thu, 3 Sep 2015 08:19:50 -0700 (PDT) X-Received: by 10.140.85.165 with SMTP id n34mr7133568qgd.83.1441293590093; Thu, 03 Sep 2015 08:19:50 -0700 (PDT) Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id 48si20266366qgo.63.2015.09.03.08.19.49; Thu, 03 Sep 2015 08:19:50 -0700 (PDT) Received-SPF: pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.225.227.206 as permitted sender) client-ip=54.225.227.206; Received: by lists.linaro.org (Postfix, from userid 109) id 4E3E261A2E; Thu, 3 Sep 2015 15:19:49 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on ip-10-142-244-252 X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, URIBL_BLOCKED autolearn=disabled version=3.4.0 Received: from [127.0.0.1] (localhost [127.0.0.1]) by lists.linaro.org (Postfix) with ESMTP id 8898A61A46; Thu, 3 Sep 2015 15:17:01 +0000 (UTC) X-Original-To: lng-odp@lists.linaro.org Delivered-To: lng-odp@lists.linaro.org Received: by lists.linaro.org (Postfix, from userid 109) id 28DFF61A36; Thu, 3 Sep 2015 15:16:57 +0000 (UTC) Received: from mail-ob0-f181.google.com (mail-ob0-f181.google.com [209.85.214.181]) by lists.linaro.org (Postfix) with ESMTPS id D2A1861A1B for ; Thu, 3 Sep 2015 15:16:49 +0000 (UTC) Received: by obbbh8 with SMTP id bh8so35101049obb.0 for ; Thu, 03 Sep 2015 08:16:49 -0700 (PDT) X-Received: by 10.60.125.8 with SMTP id mm8mr27680443oeb.73.1441293409312; Thu, 03 Sep 2015 08:16:49 -0700 (PDT) Received: from Ubuntu15.localdomain (cpe-24-28-70-239.austin.res.rr.com. [24.28.70.239]) by smtp.gmail.com with ESMTPSA id e73sm1525294oib.3.2015.09.03.08.16.48 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 03 Sep 2015 08:16:48 -0700 (PDT) From: Bill Fischofer To: lng-odp@lists.linaro.org, maxim.uvarov@linaro.org Date: Thu, 3 Sep 2015 10:16:36 -0500 Message-Id: <1441293400-28777-5-git-send-email-bill.fischofer@linaro.org> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1441293400-28777-1-git-send-email-bill.fischofer@linaro.org> References: <1441293400-28777-1-git-send-email-bill.fischofer@linaro.org> X-Topics: patch Subject: [lng-odp] [PATCHv2 4/8] linux-generic: queue: add destroy check for ordered queues X-BeenThere: lng-odp@lists.linaro.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: , List-Help: , List-Subscribe: , MIME-Version: 1.0 Errors-To: lng-odp-bounces@lists.linaro.org Sender: "lng-odp" X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: bill.fischofer@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.176 as permitted sender) smtp.mailfrom=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 Ensure that the reorder queue associated with ordered queues is empty as part of odp_queue_destroy() processing Signed-off-by: Bill Fischofer --- platform/linux-generic/odp_queue.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/platform/linux-generic/odp_queue.c b/platform/linux-generic/odp_queue.c index bc59d88..46b3371 100644 --- a/platform/linux-generic/odp_queue.c +++ b/platform/linux-generic/odp_queue.c @@ -274,6 +274,12 @@ 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); + return -1; + } switch (queue->s.status) { case QUEUE_STATUS_READY: