From patchwork Thu Dec 18 11:26:26 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxim Uvarov X-Patchwork-Id: 42421 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wi0-f199.google.com (mail-wi0-f199.google.com [209.85.212.199]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 89B4326C8B for ; Thu, 18 Dec 2014 11:27:03 +0000 (UTC) Received: by mail-wi0-f199.google.com with SMTP id bs8sf561058wib.2 for ; Thu, 18 Dec 2014 03:27:02 -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=fy20LGnAF4XcKF+ndElLSKgUeg8V/QTQUCdEsfy4+x8=; b=AUPVScErVZrCfg24IkVItEjF2M7s5zgKzindCAH+Tz9i6zcAh5Mg+EcO4vJmKGg6UZ 71Uvv6K8Rp/NuifIxpE283qxVyjr8GFsu/GTp7AD2Dn4D3yr2RyaKjMXe4pjKs3dpmvW 6u/nkE1lT/DWA+tzt+QKRlBS0U+yVRcUHmijLH9auc7qtmH89eHvplQH4RNdu+a84BdF Q//70A/Dqf+zhJnFyMeGbouY1KpJlcscXGO5vsYtgdD1BQmNRGS6OwxUIUyBaHrQ3MD0 EiVEbs5Au+66qTVSV4zYGEWsIwd58STlxPFJHR2kVjd+kPeKlhMtPyRFpFHWlzNA71tN nGlw== X-Gm-Message-State: ALoCoQnzwp9PPlglm9WaDIk3Gpb85hlz6A1KHIG8nicp5CV/4KVHCwqAi2n8L0T5+Fn0FR6RHYvm X-Received: by 10.180.99.227 with SMTP id et3mr60508wib.3.1418902022868; Thu, 18 Dec 2014 03:27:02 -0800 (PST) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.1.66 with SMTP id 2ls678315lak.10.gmail; Thu, 18 Dec 2014 03:27:02 -0800 (PST) X-Received: by 10.152.37.168 with SMTP id z8mr1660931laj.63.1418902022524; Thu, 18 Dec 2014 03:27:02 -0800 (PST) Received: from mail-la0-f53.google.com (mail-la0-f53.google.com. [209.85.215.53]) by mx.google.com with ESMTPS id xb8si6524177lbb.109.2014.12.18.03.27.02 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 18 Dec 2014 03:27:02 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.53 as permitted sender) client-ip=209.85.215.53; Received: by mail-la0-f53.google.com with SMTP id gm9so779989lab.40 for ; Thu, 18 Dec 2014 03:27:02 -0800 (PST) X-Received: by 10.112.189.10 with SMTP id ge10mr1657036lbc.23.1418902022389; Thu, 18 Dec 2014 03:27:02 -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 ru5csp1671964lbb; Thu, 18 Dec 2014 03:27:01 -0800 (PST) X-Received: by 10.224.30.74 with SMTP id t10mr2650270qac.8.1418902020678; Thu, 18 Dec 2014 03:27:00 -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 d108si7891044qgf.1.2014.12.18.03.26.59 (version=TLSv1 cipher=RC4-SHA bits=128/128); Thu, 18 Dec 2014 03:27:00 -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 1Y1ZEQ-0006ak-Ff; Thu, 18 Dec 2014 11:26:58 +0000 Received: from mail-la0-f52.google.com ([209.85.215.52]) by ip-10-35-177-41.ec2.internal with esmtp (Exim 4.76) (envelope-from ) id 1Y1ZEF-0006YD-Kr for lng-odp@lists.linaro.org; Thu, 18 Dec 2014 11:26:47 +0000 Received: by mail-la0-f52.google.com with SMTP id hs14so782345lab.39 for ; Thu, 18 Dec 2014 03:26:42 -0800 (PST) X-Received: by 10.112.14.6 with SMTP id l6mr1649503lbc.91.1418902002020; Thu, 18 Dec 2014 03:26:42 -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 pn7sm360365lbb.6.2014.12.18.03.26.40 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 18 Dec 2014 03:26:41 -0800 (PST) From: Maxim Uvarov To: lng-odp@lists.linaro.org Date: Thu, 18 Dec 2014 14:26:26 +0300 Message-Id: <1418901989-30502-2-git-send-email-maxim.uvarov@linaro.org> X-Mailer: git-send-email 1.8.5.1.163.gd7aced9 In-Reply-To: <1418901989-30502-1-git-send-email-maxim.uvarov@linaro.org> References: <1418901989-30502-1-git-send-email-maxim.uvarov@linaro.org> X-Topics: patch Subject: [lng-odp] [PATCHv5 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.53 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..80e248d 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_NOTSCHED; + 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)