From patchwork Tue Jan 30 16:00:07 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Github ODP bot X-Patchwork-Id: 126272 Delivered-To: patch@linaro.org Received: by 10.46.84.92 with SMTP id y28csp3492147ljd; Tue, 30 Jan 2018 08:08:14 -0800 (PST) X-Google-Smtp-Source: AH8x225NZagWYEYdyo9saMMFLHiwKNfe4zfISNX0Hv/KodqRGZcYHmWPQ2UiprZZTf+8GhEZNaUo X-Received: by 10.200.22.53 with SMTP id p50mr45541522qtj.284.1517328494554; Tue, 30 Jan 2018 08:08:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517328494; cv=none; d=google.com; s=arc-20160816; b=cx+NgzkYfu1NcuvbPXjh+WRZm8z+scezSN0etK7ZdfMo//07wPJmJc4PSZJ66dxmfV 1MTqXheD7Tvv/VAnHnQ46Q8RUMo+hb/CqUCIH45mw2iRZJGhhJ84txysrN02pkwtu18d f1tluX3M2myJtgyKfn5WQe8I6xsSOlORneGUfAQSfm4eKluaHppGlh0yReNEmMmCWCn6 ZOJBiu5VZYwCmNe7VacoQqh1+ogOnp6WPepYVG3swkaAxEBaMNXfiltFJKp52NvGQrDX DlyJ7XhHkQRWCBFwH3UwD80aH5A8n8bgax2AbE2eTpK8IkJhtcPMu3VD2PIUJyLnoG2y QoUw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject:github-pr-num :references:in-reply-to:message-id:date:to:from:delivered-to :arc-authentication-results; bh=ZN1y7m9bCit0SPKiP7BZEfdsQFA0fUrJuz8sYglIO5I=; b=iXoTcZYiEibAuCvNf5daHXksyWh6WUoBX0kBWgctc0zv5RF3d6k6btK7UxLMd8iqep SgLIGgLyE/Cg8fxcLdM4JMhqopg72w7qWx4dPZ++NylzqsE5Fv66vYDIQeRp4TbXEBtp I1VCGA3oqUH65ofoHNjoUItP7tmF8fgTlpQkj9pz4e9RgxCXKO7dzMocQ74uZcGSbK2l DcgUlWauawN/wvsi8L3WXYighyVvqQjjLz1qxQXvhbW1Cshh4jAUZ/YSmNydi3oIsE0y uO3zqpU9BId/+EQUlBIK78rbjv+xyh/ltMeA1XWC0h5ndO/2EJdxdBJQ9IviJx+gr9Wy MC5Q== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.197.127.237 as permitted sender) smtp.mailfrom=lng-odp-bounces@lists.linaro.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=yandex.ru Return-Path: Received: from lists.linaro.org (ec2-54-197-127-237.compute-1.amazonaws.com. [54.197.127.237]) by mx.google.com with ESMTP id p6si5440420qtk.282.2018.01.30.08.08.14; Tue, 30 Jan 2018 08:08:14 -0800 (PST) Received-SPF: pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.197.127.237 as permitted sender) client-ip=54.197.127.237; Authentication-Results: mx.google.com; spf=pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.197.127.237 as permitted sender) smtp.mailfrom=lng-odp-bounces@lists.linaro.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=yandex.ru Received: by lists.linaro.org (Postfix, from userid 109) id 27A6B617AD; Tue, 30 Jan 2018 16:08:14 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on ip-10-142-244-252 X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,FREEMAIL_FROM, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2 autolearn=disabled version=3.4.0 Received: from [127.0.0.1] (localhost [127.0.0.1]) by lists.linaro.org (Postfix) with ESMTP id 80D9361761; Tue, 30 Jan 2018 16:01:05 +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 6819360C5D; Tue, 30 Jan 2018 16:00:27 +0000 (UTC) Received: from forward100p.mail.yandex.net (forward100p.mail.yandex.net [77.88.28.100]) by lists.linaro.org (Postfix) with ESMTPS id 1829F614E3 for ; Tue, 30 Jan 2018 16:00:19 +0000 (UTC) Received: from mxback7o.mail.yandex.net (mxback7o.mail.yandex.net [IPv6:2a02:6b8:0:1a2d::21]) by forward100p.mail.yandex.net (Yandex) with ESMTP id 6480F5104C19 for ; Tue, 30 Jan 2018 19:00:17 +0300 (MSK) Received: from smtp4o.mail.yandex.net (smtp4o.mail.yandex.net [2a02:6b8:0:1a2d::28]) by mxback7o.mail.yandex.net (nwsmtp/Yandex) with ESMTP id CdRIPcWAua-0HKGKxdv; Tue, 30 Jan 2018 19:00:17 +0300 Received: by smtp4o.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id Nz8CQ597Mi-0GRCuN1k; Tue, 30 Jan 2018 19:00:16 +0300 (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (Client certificate not present) From: Github ODP bot To: lng-odp@lists.linaro.org Date: Tue, 30 Jan 2018 19:00:07 +0300 Message-Id: <1517328009-16379-10-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1517328009-16379-1-git-send-email-odpbot@yandex.ru> References: <1517328009-16379-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 437 Subject: [lng-odp] [PATCH v1 9/11] validation: pktio: don't pass invalid handle to index conversion X-BeenThere: lng-odp@lists.linaro.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: "The OpenDataPlane \(ODP\) List" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: lng-odp-bounces@lists.linaro.org Sender: "lng-odp" From: Petri Savolainen Fast path functions cannot be expected to always check against invalid handles. Also a handle that has been closed (or destroyed) must not be passed to any API function. Signed-off-by: Petri Savolainen --- /** Email created from pull request 437 (psavol:master-packet-optim) ** https://github.com/Linaro/odp/pull/437 ** Patch: https://github.com/Linaro/odp/pull/437.patch ** Base sha: b95ccd3db6eeb7358a877541747e06354429acdd ** Merge commit sha: ab7875c186fe80cfe103c5be5634b0eda312aed4 **/ test/validation/api/pktio/pktio.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/test/validation/api/pktio/pktio.c b/test/validation/api/pktio/pktio.c index a23641036..b20272ffc 100644 --- a/test/validation/api/pktio/pktio.c +++ b/test/validation/api/pktio/pktio.c @@ -1183,7 +1183,7 @@ void pktio_test_lookup(void) void pktio_test_index(void) { - odp_pktio_t pktio, pktio_inval = ODP_PKTIO_INVALID; + odp_pktio_t pktio; odp_pktio_param_t pktio_param; int ndx; @@ -1195,10 +1195,8 @@ void pktio_test_index(void) ndx = odp_pktio_index(pktio); CU_ASSERT(ndx >= 0); - CU_ASSERT(odp_pktio_index(pktio_inval) < 0); CU_ASSERT(odp_pktio_close(pktio) == 0); - CU_ASSERT(odp_pktio_index(pktio) < 0); } static void pktio_test_print(void)