From patchwork Tue Apr 19 12:15:32 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Elo, Matias \(Nokia - FI/Espoo\)" X-Patchwork-Id: 66087 Delivered-To: patch@linaro.org Received: by 10.140.93.198 with SMTP id d64csp1813782qge; Tue, 19 Apr 2016 05:16:16 -0700 (PDT) X-Received: by 10.107.24.133 with SMTP id 127mr3262888ioy.166.1461068176060; Tue, 19 Apr 2016 05:16:16 -0700 (PDT) Return-Path: Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id 26si27053117iok.23.2016.04.19.05.16.15; Tue, 19 Apr 2016 05:16:16 -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; Authentication-Results: mx.google.com; spf=pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.225.227.206 as permitted sender) smtp.mailfrom=lng-odp-bounces@lists.linaro.org; dmarc=fail (p=NONE dis=NONE) header.from=nokia.com Received: by lists.linaro.org (Postfix, from userid 109) id 8F4F56898E; Tue, 19 Apr 2016 12:16:15 +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=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, URIBL_BLOCKED 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 0CB676898F; Tue, 19 Apr 2016 12:15:43 +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 891BF6898B; Tue, 19 Apr 2016 12:15:36 +0000 (UTC) Received: from demumfd002.nsn-inter.net (demumfd002.nsn-inter.net [93.183.12.31]) by lists.linaro.org (Postfix) with ESMTPS id 9CBB368989 for ; Tue, 19 Apr 2016 12:15:34 +0000 (UTC) Received: from demuprx016.emea.nsn-intra.net ([10.150.129.55]) by demumfd002.nsn-inter.net (8.15.2/8.15.2) with ESMTPS id u3JCFX1O024807 (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Tue, 19 Apr 2016 12:15:33 GMT Received: from 10.144.19.15 ([10.144.104.109]) by demuprx016.emea.nsn-intra.net (8.12.11.20060308/8.12.11) with ESMTP id u3JCFWJl026542 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NO) for ; Tue, 19 Apr 2016 14:15:33 +0200 From: Matias Elo To: lng-odp@lists.linaro.org Date: Tue, 19 Apr 2016 15:15:32 +0300 Message-Id: <1461068132-24306-2-git-send-email-matias.elo@nokia.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1461068132-24306-1-git-send-email-matias.elo@nokia.com> References: <1461068132-24306-1-git-send-email-matias.elo@nokia.com> X-purgate-type: clean X-purgate-Ad: Categorized by eleven eXpurgate (R) http://www.eleven.de X-purgate: clean X-purgate: This mail is considered clean (visit http://www.eleven.de for further information) X-purgate-size: 2213 X-purgate-ID: 151667::1461068133-00002418-CBEFBEED/0/0 X-Topics: patch Subject: [lng-odp] [API-NEXT PATCH 2/2] validation: pktio: add test for odp_pktio_info() 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: , MIME-Version: 1.0 Errors-To: lng-odp-bounces@lists.linaro.org Sender: "lng-odp" Signed-off-by: Matias Elo --- test/validation/pktio/pktio.c | 28 ++++++++++++++++++++++++++++ test/validation/pktio/pktio.h | 1 + 2 files changed, 29 insertions(+) diff --git a/test/validation/pktio/pktio.c b/test/validation/pktio/pktio.c index d52a520..415f8be 100644 --- a/test/validation/pktio/pktio.c +++ b/test/validation/pktio/pktio.c @@ -961,6 +961,33 @@ static void pktio_test_print(void) } } +void pktio_test_info(void) +{ + odp_pktio_t pktio; + odp_pktio_info_t pktio_info; + int i; + + for (i = 0; i < num_ifaces; i++) { + pktio = create_pktio(i, ODP_PKTIN_MODE_QUEUE, + ODP_PKTOUT_MODE_DIRECT); + CU_ASSERT_FATAL(pktio != ODP_PKTIO_INVALID); + + CU_ASSERT_FATAL(odp_pktio_info(pktio, &pktio_info) == 0); + + printf("pktio %d\n name %s\n driver %s\n", i, + pktio_info.name, pktio_info.drv_name); + + CU_ASSERT(strcmp(pktio_info.name, iface_name[i]) == 0); + CU_ASSERT(pktio_info.pool == pool[i]); + CU_ASSERT(pktio_info.param.in_mode == ODP_PKTIN_MODE_QUEUE); + CU_ASSERT(pktio_info.param.out_mode == ODP_PKTOUT_MODE_DIRECT); + + CU_ASSERT(odp_pktio_info(ODP_PKTIO_INVALID, &pktio_info) < 0); + + CU_ASSERT(odp_pktio_close(pktio) == 0); + } +} + void pktio_test_pktin_queue_config_direct(void) { odp_pktio_t pktio; @@ -1771,6 +1798,7 @@ odp_testinfo_t pktio_suite_unsegmented[] = { ODP_TEST_INFO(pktio_test_open), ODP_TEST_INFO(pktio_test_lookup), ODP_TEST_INFO(pktio_test_print), + ODP_TEST_INFO(pktio_test_info), ODP_TEST_INFO(pktio_test_pktin_queue_config_direct), ODP_TEST_INFO(pktio_test_pktin_queue_config_sched), ODP_TEST_INFO(pktio_test_pktin_queue_config_queue), diff --git a/test/validation/pktio/pktio.h b/test/validation/pktio/pktio.h index 14db6e1..8ce3828 100644 --- a/test/validation/pktio/pktio.h +++ b/test/validation/pktio/pktio.h @@ -24,6 +24,7 @@ void pktio_test_mac(void); void pktio_test_inq_remdef(void); void pktio_test_open(void); void pktio_test_lookup(void); +void pktio_test_info(void); void pktio_test_inq(void); void pktio_test_pktin_queue_config_direct(void); void pktio_test_pktin_queue_config_sched(void);