From patchwork Thu Dec 18 11:04:14 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxim Uvarov X-Patchwork-Id: 42414 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wi0-f198.google.com (mail-wi0-f198.google.com [209.85.212.198]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 0556E26C6B for ; Thu, 18 Dec 2014 11:04:49 +0000 (UTC) Received: by mail-wi0-f198.google.com with SMTP id r20sf531628wiv.9 for ; Thu, 18 Dec 2014 03:04:48 -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: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=k6LFUN83NCWLulzF114ll1nY6c0fz8dMnj0//aSTtXk=; b=masgYfPEImytH0EarmJbMs+aoUKkoW3QspN/1HMHK+eKIC5ZreLgSrFm20VrC//R1L I3KTGAAvvqkVhh4y9pDxD6d6dnMvxktVK6XSQgnXBaGZfquKPQL73Leisa/lwT46XaUq 9kOqQ+7qkdq3hD4VpNgd/YGoLJkhei9Ey5SWSoxAB60UkGhgCXoGZ4lKKaPnbBYmzIoR LcJ9bvcIdoF/u2mY7tmfhs7f59tjnfBtXgxf5xapxoHVu5ew8bqPu7jQMuryECAQj4Q2 jlSlgtP25ejFpv9i42NXy4udnu8EnwoatMIUkprRjZCf4GrbT4hHzvqubwxYbDL/qQjw RK3Q== X-Gm-Message-State: ALoCoQmgSZSPKgbD2Y2lqOXWRdMVhF9F4AQbfgzDsFscDGhiH7DGADLUn6L+w3UP0QMdJtGIhNcG X-Received: by 10.112.154.232 with SMTP id vr8mr236617lbb.10.1418900688224; Thu, 18 Dec 2014 03:04:48 -0800 (PST) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.19.39 with SMTP id b7ls995479lae.38.gmail; Thu, 18 Dec 2014 03:04:47 -0800 (PST) X-Received: by 10.152.21.228 with SMTP id y4mr1631684lae.72.1418900687826; Thu, 18 Dec 2014 03:04:47 -0800 (PST) Received: from mail-la0-f44.google.com (mail-la0-f44.google.com. [209.85.215.44]) by mx.google.com with ESMTPS id ld3si6458688lac.115.2014.12.18.03.04.47 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 18 Dec 2014 03:04:47 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.44 as permitted sender) client-ip=209.85.215.44; Received: by mail-la0-f44.google.com with SMTP id gd6so798074lab.3 for ; Thu, 18 Dec 2014 03:04:47 -0800 (PST) X-Received: by 10.152.7.229 with SMTP id m5mr1620915laa.80.1418900687733; Thu, 18 Dec 2014 03:04:47 -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 ru5csp1665935lbb; Thu, 18 Dec 2014 03:04:46 -0800 (PST) X-Received: by 10.224.37.131 with SMTP id x3mr506933qad.104.1418900686127; Thu, 18 Dec 2014 03:04:46 -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 l9si7808767qaz.27.2014.12.18.03.04.45 (version=TLSv1 cipher=RC4-SHA bits=128/128); Thu, 18 Dec 2014 03:04:46 -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 1Y1Yst-00048X-9h; Thu, 18 Dec 2014 11:04:43 +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 1Y1Ysj-000461-I0 for lng-odp@lists.linaro.org; Thu, 18 Dec 2014 11:04:33 +0000 Received: by mail-la0-f53.google.com with SMTP id gm9so796337lab.12 for ; Thu, 18 Dec 2014 03:04:27 -0800 (PST) X-Received: by 10.152.29.6 with SMTP id f6mr1658383lah.32.1418900667647; Thu, 18 Dec 2014 03:04:27 -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 v4sm1676892lav.25.2014.12.18.03.04.26 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 18 Dec 2014 03:04:26 -0800 (PST) From: Maxim Uvarov To: lng-odp@lists.linaro.org Date: Thu, 18 Dec 2014 14:04:14 +0300 Message-Id: <1418900657-21427-2-git-send-email-maxim.uvarov@linaro.org> X-Mailer: git-send-email 1.8.5.1.163.gd7aced9 In-Reply-To: <1418900657-21427-1-git-send-email-maxim.uvarov@linaro.org> References: <1418900657-21427-1-git-send-email-maxim.uvarov@linaro.org> X-Topics: patch Subject: [lng-odp] [PATCHv4 1/4] 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.215.44 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 --- platform/linux-generic/odp_packet_io.c | 28 +++++++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) diff --git a/platform/linux-generic/odp_packet_io.c b/platform/linux-generic/odp_packet_io.c index 3ca8100..80c1e82 100644 --- a/platform/linux-generic/odp_packet_io.c +++ b/platform/linux-generic/odp_packet_io.c @@ -391,7 +391,33 @@ 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_FREE; + 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)