From patchwork Wed Dec 17 16:34:17 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxim Uvarov X-Patchwork-Id: 42385 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wi0-f200.google.com (mail-wi0-f200.google.com [209.85.212.200]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 76B3026C8B for ; Wed, 17 Dec 2014 16:34:45 +0000 (UTC) Received: by mail-wi0-f200.google.com with SMTP id ex7sf6548819wid.7 for ; Wed, 17 Dec 2014 08:34:44 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:from:to:date:message-id: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=ITCEAYqVtzIgRhc36+6I4h6pRt4885zU7JsydYQv/yo=; b=OV5OHGn642ecNaxBBVHeK6WB5ir4dNNQ4QinAJy+5yeHXp9ryaSwZCSwHQfNyiblGW 8eoVs4uU7gtHC7utljmRCTTktpJf0qMbq8eI6oIMa6HDNbHBhH9Qul1xOScXek4Z0pci 3x+zC8thD8IXnfrebSAxHSA5jlsNAyJy+0iNotprEYVxkYdsmqTtH4z4bP7Nm8Ewqzes PqZG+/l5kaDCMDpDkrFt4xTIsUZEtX+jF3m6toDQ8ZunIoL0I/SfH/2bRew7pSqAOsWP VA4YtG7q433RMu+x5Mqbv9Ds/rktpX2Guj7vcvYSo1GwvKtWiaqSIf5YUi+UPMEZsdrJ TpNA== X-Gm-Message-State: ALoCoQkyhq4RCQy61P8kRL7xSN9bDhd779H2Pw/F70Z9hQTeVNz35MhwzPxxxXVHaHg9aU1AGzav X-Received: by 10.112.154.232 with SMTP id vr8mr518594lbb.10.1418834084641; Wed, 17 Dec 2014 08:34:44 -0800 (PST) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.203.226 with SMTP id kt2ls1048534lac.52.gmail; Wed, 17 Dec 2014 08:34:44 -0800 (PST) X-Received: by 10.152.29.193 with SMTP id m1mr32503305lah.84.1418834084429; Wed, 17 Dec 2014 08:34:44 -0800 (PST) Received: from mail-lb0-f173.google.com (mail-lb0-f173.google.com. [209.85.217.173]) by mx.google.com with ESMTPS id e3si4331988lah.89.2014.12.17.08.34.44 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 17 Dec 2014 08:34:44 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.173 as permitted sender) client-ip=209.85.217.173; Received: by mail-lb0-f173.google.com with SMTP id z12so13068384lbi.18 for ; Wed, 17 Dec 2014 08:34:44 -0800 (PST) X-Received: by 10.152.116.46 with SMTP id jt14mr6486248lab.59.1418834083947; Wed, 17 Dec 2014 08:34:43 -0800 (PST) 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.142.69 with SMTP id ru5csp1418772lbb; Wed, 17 Dec 2014 08:34:43 -0800 (PST) X-Received: by 10.140.23.84 with SMTP id 78mr4424365qgo.93.1418834082713; Wed, 17 Dec 2014 08:34:42 -0800 (PST) Received: from ip-10-35-177-41.ec2.internal (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTPS id k10si5136917qge.43.2014.12.17.08.34.41 (version=TLSv1 cipher=RC4-SHA bits=128/128); Wed, 17 Dec 2014 08:34:42 -0800 (PST) Received-SPF: none (google.com: lng-odp-bounces@lists.linaro.org does not designate permitted sender hosts) client-ip=54.225.227.206; Received: from localhost ([127.0.0.1] helo=ip-10-35-177-41.ec2.internal) by ip-10-35-177-41.ec2.internal with esmtp (Exim 4.76) (envelope-from ) id 1Y1HYd-0001WW-IX; Wed, 17 Dec 2014 16:34:39 +0000 Received: from mail-lb0-f174.google.com ([209.85.217.174]) by ip-10-35-177-41.ec2.internal with esmtp (Exim 4.76) (envelope-from ) id 1Y1HYT-0001VD-Dx for lng-odp@lists.linaro.org; Wed, 17 Dec 2014 16:34:29 +0000 Received: by mail-lb0-f174.google.com with SMTP id 10so12890510lbg.5 for ; Wed, 17 Dec 2014 08:34:23 -0800 (PST) X-Received: by 10.112.198.233 with SMTP id jf9mr21963270lbc.9.1418834063730; Wed, 17 Dec 2014 08:34:23 -0800 (PST) Received: from localhost.localdomain ([188.92.105.210]) by mx.google.com with ESMTPSA id ji6sm1059987lbb.26.2014.12.17.08.34.22 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 17 Dec 2014 08:34:22 -0800 (PST) From: Maxim Uvarov To: lng-odp@lists.linaro.org Date: Wed, 17 Dec 2014 19:34:17 +0300 Message-Id: <1418834057-31954-1-git-send-email-maxim.uvarov@linaro.org> X-Mailer: git-send-email 1.8.5.1.163.gd7aced9 X-Topics: patch Subject: [lng-odp] [PATCHv2] linux-generic: fix odp_pktio_inq_remdef X-BeenThere: lng-odp@lists.linaro.org X-Mailman-Version: 2.1.14 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-bounces@lists.linaro.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: maxim.uvarov@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.173 as permitted sender) smtp.mail=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 Correctly destroy queue and remove it from scheduler. Signed-off-by: Maxim Uvarov --- v2: I reused Tarases implementation for destroy queue, which also removes this queue from scheduling. Maxim. platform/linux-generic/odp_packet_io.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/platform/linux-generic/odp_packet_io.c b/platform/linux-generic/odp_packet_io.c index 3ca8100..089feae 100644 --- a/platform/linux-generic/odp_packet_io.c +++ b/platform/linux-generic/odp_packet_io.c @@ -391,7 +391,19 @@ int odp_pktio_inq_setdef(odp_pktio_t id, odp_queue_t queue) int odp_pktio_inq_remdef(odp_pktio_t id) { - return odp_pktio_inq_setdef(id, ODP_QUEUE_INVALID); + pktio_entry_t *pktio_entry = get_pktio_entry(id); + odp_queue_t queue; + int ret; + + if (pktio_entry == NULL) + return -1; + + lock_entry(pktio_entry); + queue = pktio_entry->s.inq_default; + ret = odp_queue_destroy(queue); + unlock_entry(pktio_entry); + + return ret; } odp_queue_t odp_pktio_inq_getdef(odp_pktio_t id)