From patchwork Thu Dec 18 13:14:55 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxim Uvarov X-Patchwork-Id: 42449 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 3F1B726C6B for ; Thu, 18 Dec 2014 13:15:22 +0000 (UTC) Received: by mail-wi0-f200.google.com with SMTP id ex7sf676949wid.11 for ; Thu, 18 Dec 2014 05:15:21 -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=RM4uPFo0kBMHyhQtiaqknLceLiMPh+8Ese4et++dpyE=; b=B8+hr34uVhBw0shNgB11V3GREuW2xfCI9iDwXptjiDIjJGH5TdWy/NAFCCLhqBvLOr PVAvPY/OZu/3N7W+oP7DZ00vh/ssupG4U4ORW8ap1MwX4yJG359N/K80654GzDKyueSc z0SCx4c73pKmOPrwd9zUY73cA8pxNiZISNJgnHuj+s4CrkM7MlgZLSYCCh1M1qOdoazk qKggHN1FoFuGcy0MkWLL40aFzzjKGkxHB0LgfJd3KpFGFqnVSq7vpeWTQuZkaOIrtQhq yysxtSgKceptB4r/P4OYC1aZyRtugNJG8PpS8/cSbi0nd93N27s5vqMp0BC43kTvIc7n JXhg== X-Gm-Message-State: ALoCoQnqJ+fnndPCJoZJLFItnsC9fLtVN11wKESxPE2A9JcMTJyjUDaPWXyXxH8tc9Q9zgqwYprm X-Received: by 10.112.9.199 with SMTP id c7mr328407lbb.7.1418908521487; Thu, 18 Dec 2014 05:15:21 -0800 (PST) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.234.103 with SMTP id ud7ls51680lac.8.gmail; Thu, 18 Dec 2014 05:15:21 -0800 (PST) X-Received: by 10.112.14.6 with SMTP id l6mr2167440lbc.91.1418908521038; Thu, 18 Dec 2014 05:15:21 -0800 (PST) Received: from mail-lb0-f181.google.com (mail-lb0-f181.google.com. [209.85.217.181]) by mx.google.com with ESMTPS id t9si6815266laj.101.2014.12.18.05.15.21 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 18 Dec 2014 05:15:21 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.181 as permitted sender) client-ip=209.85.217.181; Received: by mail-lb0-f181.google.com with SMTP id l4so956732lbv.12 for ; Thu, 18 Dec 2014 05:15:21 -0800 (PST) X-Received: by 10.112.138.137 with SMTP id qq9mr2206867lbb.80.1418908520933; Thu, 18 Dec 2014 05:15:20 -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 ru5csp1701638lbb; Thu, 18 Dec 2014 05:15:19 -0800 (PST) X-Received: by 10.229.37.136 with SMTP id x8mr3414779qcd.30.1418908518609; Thu, 18 Dec 2014 05:15:18 -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 j7si8128924qce.45.2014.12.18.05.15.17 (version=TLSv1 cipher=RC4-SHA bits=128/128); Thu, 18 Dec 2014 05:15:18 -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 1Y1avD-00025I-QP; Thu, 18 Dec 2014 13:15:15 +0000 Received: from mail-la0-f53.google.com ([209.85.215.53]) by ip-10-35-177-41.ec2.internal with esmtp (Exim 4.76) (envelope-from ) id 1Y1av6-00022t-Ve for lng-odp@lists.linaro.org; Thu, 18 Dec 2014 13:15:09 +0000 Received: by mail-la0-f53.google.com with SMTP id gm9so933456lab.40 for ; Thu, 18 Dec 2014 05:15:03 -0800 (PST) X-Received: by 10.112.16.129 with SMTP id g1mr2258311lbd.30.1418908503322; Thu, 18 Dec 2014 05:15:03 -0800 (PST) Received: from localhost.localdomain (ppp91-76-163-205.pppoe.mtu-net.ru. [91.76.163.205]) by mx.google.com with ESMTPSA id ki4sm1781122lac.1.2014.12.18.05.15.01 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 18 Dec 2014 05:15:02 -0800 (PST) From: Maxim Uvarov To: lng-odp@lists.linaro.org Date: Thu, 18 Dec 2014 16:14:55 +0300 Message-Id: <1418908495-5409-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] [PATCHv6] 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.181 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 remove queue from packet i/o and remove it from scheduler. Signed-off-by: Maxim Uvarov --- v6: set pktin to INVALID. platform/linux-generic/odp_packet_io.c | 29 ++++++++++++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) diff --git a/platform/linux-generic/odp_packet_io.c b/platform/linux-generic/odp_packet_io.c index 3ca8100..9b934b2 100644 --- a/platform/linux-generic/odp_packet_io.c +++ b/platform/linux-generic/odp_packet_io.c @@ -391,7 +391,34 @@ 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; + queue_entry_t *qentry; + + if (pktio_entry == NULL) + return -1; + + lock_entry(pktio_entry); + queue = pktio_entry->s.inq_default; + qentry = queue_to_qentry(queue); + + queue_lock(qentry); + if (qentry->s.status == QUEUE_STATUS_FREE) { + queue_unlock(qentry); + unlock_entry(pktio_entry); + return -1; + } + + qentry->s.enqueue = queue_enq_dummy; + qentry->s.enqueue_multi = queue_enq_multi_dummy; + qentry->s.status = QUEUE_STATUS_NOTSCHED; + qentry->s.pktin = ODP_PKTIO_INVALID; + queue_unlock(qentry); + + pktio_entry->s.inq_default = ODP_QUEUE_INVALID; + unlock_entry(pktio_entry); + + return 0; } odp_queue_t odp_pktio_inq_getdef(odp_pktio_t id)