From patchwork Wed Jun 3 16:06:01 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxim Uvarov X-Patchwork-Id: 49483 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-la0-f71.google.com (mail-la0-f71.google.com [209.85.215.71]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id A4AD120BE7 for ; Wed, 3 Jun 2015 16:06:27 +0000 (UTC) Received: by laboh3 with SMTP id oh3sf4415536lab.0 for ; Wed, 03 Jun 2015 09:06:26 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to: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=dFE0C+oSEiUTcNo5odHVgUzPOEaCwDy739UqW1Dacnw=; b=ebFjEoWgTTj0E/glksZXvLTOW3htFMmtiqFiHhxbRP8jRHg/x8Hh71plwXQq83vLAZ z3ayK+wSKLXAW1i5tEPqBbldY/lgvs5xlVbuyXAWwZ2jDEodyQ/k8s6ve1c6V3aMOkA6 u06MFiJZms2qVLsrtaOJbPRhugV6gCi5Hulc0YLgj/2j9SKpLjSQFTs9KUmYLRsqhF4X fMebGYb6H1jLy0zhGipLGs5j5a70kFKBi0MPBHcKiiN1yugDkzUdMlVDRJjTmNVIgZHs QtC7bpluO2FNAktPN/6dx9ze12nGQ7Y/52gYsDhbfFGdOV+Pe0q51w09M8XxiftdRMAG ohbw== X-Gm-Message-State: ALoCoQm81+3q1qRdw5HjbsbnAr+ZUFZc/Ir+LDSto5vy6X/6OVCO+ier0zo/fRV5RriVqTdTa9EF X-Received: by 10.180.36.172 with SMTP id r12mr14266897wij.6.1433347586483; Wed, 03 Jun 2015 09:06:26 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.153.8.171 with SMTP id dl11ls79377lad.55.gmail; Wed, 03 Jun 2015 09:06:26 -0700 (PDT) X-Received: by 10.152.43.168 with SMTP id x8mr33117379lal.79.1433347586246; Wed, 03 Jun 2015 09:06:26 -0700 (PDT) Received: from mail-lb0-f179.google.com (mail-lb0-f179.google.com. [209.85.217.179]) by mx.google.com with ESMTPS id w5si18380667laa.59.2015.06.03.09.06.26 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 03 Jun 2015 09:06:26 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.179 as permitted sender) client-ip=209.85.217.179; Received: by lbcmx3 with SMTP id mx3so10306331lbc.1 for ; Wed, 03 Jun 2015 09:06:26 -0700 (PDT) X-Received: by 10.152.206.75 with SMTP id lm11mr23135509lac.41.1433347586104; Wed, 03 Jun 2015 09:06:26 -0700 (PDT) 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.108.230 with SMTP id hn6csp3974561lbb; Wed, 3 Jun 2015 09:06:24 -0700 (PDT) X-Received: by 10.140.149.129 with SMTP id 123mr39189797qhv.56.1433347583832; Wed, 03 Jun 2015 09:06:23 -0700 (PDT) Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id r7si1021977qha.96.2015.06.03.09.06.16; Wed, 03 Jun 2015 09:06:23 -0700 (PDT) Received-SPF: pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.225.227.206 as permitted sender) client-ip=54.225.227.206; Received: by lists.linaro.org (Postfix, from userid 109) id D0A6761F83; Wed, 3 Jun 2015 16:06:16 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on ip-10-142-244-252.ec2.internal X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, URIBL_BLOCKED autolearn=disabled version=3.4.0 Received: from ip-10-142-244-252.ec2.internal (localhost [127.0.0.1]) by lists.linaro.org (Postfix) with ESMTP id A35AF61F75; Wed, 3 Jun 2015 16:06:13 +0000 (UTC) X-Original-To: lng-odp@lists.linaro.org Delivered-To: lng-odp@lists.linaro.org Received: by lists.linaro.org (Postfix, from userid 109) id E68C061F80; Wed, 3 Jun 2015 16:06:10 +0000 (UTC) Received: from mail-wg0-f46.google.com (mail-wg0-f46.google.com [74.125.82.46]) by lists.linaro.org (Postfix) with ESMTPS id 251AD61C6A for ; Wed, 3 Jun 2015 16:06:10 +0000 (UTC) Received: by wgv5 with SMTP id 5so13344122wgv.1 for ; Wed, 03 Jun 2015 09:06:09 -0700 (PDT) X-Received: by 10.194.123.4 with SMTP id lw4mr17361525wjb.94.1433347569337; Wed, 03 Jun 2015 09:06:09 -0700 (PDT) Received: from localhost.localdomain ([87.120.178.39]) by mx.google.com with ESMTPSA id uc9sm1711542wjc.7.2015.06.03.09.06.07 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 03 Jun 2015 09:06:08 -0700 (PDT) From: Maxim Uvarov To: lng-odp@lists.linaro.org Date: Wed, 3 Jun 2015 19:06:01 +0300 Message-Id: <1433347561-5761-1-git-send-email-maxim.uvarov@linaro.org> X-Mailer: git-send-email 1.9.1 X-Topics: patch Subject: [lng-odp] [PATCH] validation: pktio: do lookup before create X-BeenThere: lng-odp@lists.linaro.org X-Mailman-Version: 2.1.16 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" 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.179 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 Use the right order in test: first lookup for pktio, if it's not exist - create it. Signed-off-by: Maxim Uvarov --- test/validation/odp_pktio.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/validation/odp_pktio.c b/test/validation/odp_pktio.c index e1025d6..227ae83 100644 --- a/test/validation/odp_pktio.c +++ b/test/validation/odp_pktio.c @@ -225,9 +225,9 @@ static odp_pktio_t create_pktio(const char *iface, int num) { odp_pktio_t pktio; - pktio = odp_pktio_open(iface, pool[num]); + pktio = odp_pktio_lookup(iface); if (pktio == ODP_PKTIO_INVALID) - pktio = odp_pktio_lookup(iface); + pktio = odp_pktio_open(iface, pool[num]); CU_ASSERT(pktio != ODP_PKTIO_INVALID); CU_ASSERT(odp_pktio_to_u64(pktio) != odp_pktio_to_u64(ODP_PKTIO_INVALID));