From patchwork Wed Dec 17 13:56:56 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxim Uvarov X-Patchwork-Id: 42380 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ee0-f71.google.com (mail-ee0-f71.google.com [74.125.83.71]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 44ABE26C8B for ; Wed, 17 Dec 2014 13:57:23 +0000 (UTC) Received: by mail-ee0-f71.google.com with SMTP id c13sf10347286eek.10 for ; Wed, 17 Dec 2014 05:57:22 -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=mRXETxe/erVTggQyvYOiBWKKyiypmbtyTnW/7iSdEFI=; b=TXmskWQLVJsWNFpyLJzp3KSkvEGcEp/28nQYNMRkNChT8jLKnEjZ3eNyZ6R+VNkimM gA9BUYg7w6rTAfc15GUSzwoMqH6LvEaVo2GxWW5uqvLvtszbz2kmtPvk9XI9QjAMC9KD juTFoY473eb/PBXG51Cy2SbykTnWknI7kWzQkD7kCceuTCkRa2DK086evtlkAvYjKOef TXVORMV0u/skia3bLRgt7zXPMjESjVIb8G7kz0jL97gV7eyoH6MwrmvPt+dSiYzpErDa daY7EDc2ey3LAU9ZCKpK9/axz8ZUbK3u3FdTNADFX2V2L9lVOmYuFjABeUcVgBCeNxh6 sTxA== X-Gm-Message-State: ALoCoQnvT1On6ucxE/VFDyM3pn9cU1foJz04mkqEFzJ36CRGcxPh/PWxNU9o61Sddkq9OUElfINS X-Received: by 10.194.92.34 with SMTP id cj2mr269416wjb.5.1418824642487; Wed, 17 Dec 2014 05:57:22 -0800 (PST) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.19.167 with SMTP id g7ls850391lae.62.gmail; Wed, 17 Dec 2014 05:57:22 -0800 (PST) X-Received: by 10.152.20.7 with SMTP id j7mr29950491lae.37.1418824642321; Wed, 17 Dec 2014 05:57:22 -0800 (PST) Received: from mail-lb0-f176.google.com (mail-lb0-f176.google.com. [209.85.217.176]) by mx.google.com with ESMTPS id ev4si3910655lbc.105.2014.12.17.05.57.22 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 17 Dec 2014 05:57:22 -0800 (PST) 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 mail-lb0-f176.google.com with SMTP id p9so13032990lbv.35 for ; Wed, 17 Dec 2014 05:57:22 -0800 (PST) X-Received: by 10.152.197.5 with SMTP id iq5mr41210992lac.6.1418824642181; Wed, 17 Dec 2014 05:57:22 -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 ru5csp1370756lbb; Wed, 17 Dec 2014 05:57:21 -0800 (PST) X-Received: by 10.236.110.41 with SMTP id t29mr30485733yhg.51.1418824640765; Wed, 17 Dec 2014 05:57:20 -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 190si1755974yko.172.2014.12.17.05.57.19 (version=TLSv1 cipher=RC4-SHA bits=128/128); Wed, 17 Dec 2014 05:57:20 -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 1Y1F6K-0001Sn-Lg; Wed, 17 Dec 2014 13:57:16 +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 1Y1F6D-0001Qh-JW for lng-odp@lists.linaro.org; Wed, 17 Dec 2014 13:57:09 +0000 Received: by mail-la0-f52.google.com with SMTP id hs14so12953565lab.25 for ; Wed, 17 Dec 2014 05:57:04 -0800 (PST) X-Received: by 10.152.25.194 with SMTP id e2mr2604581lag.22.1418824623693; Wed, 17 Dec 2014 05:57:03 -0800 (PST) Received: from localhost.localdomain ([188.92.105.210]) by mx.google.com with ESMTPSA id jg8sm970107lbc.0.2014.12.17.05.57.02 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 17 Dec 2014 05:57:02 -0800 (PST) From: Maxim Uvarov To: lng-odp@lists.linaro.org Date: Wed, 17 Dec 2014 16:56:56 +0300 Message-Id: <1418824616-19221-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] [PATCH] 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.176 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 odp_pktio_inq_remdef() calls odp_pktio_inq_setdef() with ODP_QUEUE_INVALID. odp_pktio_inq_setdef should set up ODP_QUEUE_INVALID to pktio instead of returning with error. Signed-off-by: Maxim Uvarov --- platform/linux-generic/odp_packet_io.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/platform/linux-generic/odp_packet_io.c b/platform/linux-generic/odp_packet_io.c index 3ca8100..4e54658 100644 --- a/platform/linux-generic/odp_packet_io.c +++ b/platform/linux-generic/odp_packet_io.c @@ -367,9 +367,16 @@ int odp_pktio_inq_setdef(odp_pktio_t id, odp_queue_t queue) pktio_entry_t *pktio_entry = get_pktio_entry(id); queue_entry_t *qentry; - if (pktio_entry == NULL || queue == ODP_QUEUE_INVALID) + if (pktio_entry == NULL) return -1; + if (queue == ODP_QUEUE_INVALID) { + lock_entry(pktio_entry); + pktio_entry->s.inq_default = ODP_QUEUE_INVALID; + unlock_entry(pktio_entry); + return 0; + } + qentry = queue_to_qentry(queue); if (qentry->s.type != ODP_QUEUE_TYPE_PKTIN)