From patchwork Thu Feb 15 14:00:04 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: 128434 Delivered-To: patch@linaro.org Received: by 10.46.124.24 with SMTP id x24csp1782502ljc; Thu, 15 Feb 2018 06:02:53 -0800 (PST) X-Google-Smtp-Source: AH8x227vVWCgUCxzCuN3Xsex+RmxPGQb6t2uou4P0ekruwqsmgPNyBumqNli1pMWGSolS0YahJFk X-Received: by 10.37.2.4 with SMTP id 4mr202274ybc.372.1518703373795; Thu, 15 Feb 2018 06:02:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518703373; cv=none; d=google.com; s=arc-20160816; b=drbH7cSn4oZDLJwCB94dn6wt+VvP4Q2lGTGgTnLZzMuXYp+glyDSi8ysdV2xqPjXzF 1MdB96SU0Sa+UumYGzRUuowjSAkTLwZ9ae9bPKxZ5WF0bPqDTbINbciTBJ17KoAaOOIf 6GgOHdtGk/dAJL3fTI7AZimEGpfkT/cXJObf+hAbZHRsZoo+fQ89tabnIe2b5GgGJkJx voSEcsxEf6eAotd2Gyt5JiLuXBmuvizDysKBoNNfqmvcuzuy5wYQR82qesNvOFVexPR6 T1xDhjqkj2JMruieT2TxuUhYK8VSlX/r626Fj0D+xZfDalVelO3fMicUajLK06lqFfwH MpSw== 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=5lRowbh6vbKRYcLpcrsuW/b4tF6G4zHW2uM/zhoYScM=; b=gBQ6FTzPqW2pYUCOkfVvlxKZakxQwZ0Fd9M0geXrmqNygybd6UvV4qSTp9I3RXEWkf m1i6d9W0OdnPSt3S+icQcZ0KmlEKw+H/XngdXJbz7uW0Roc3QMx6zSc5k9I5Yz4GYIYd 7GLf8LYOlIxd6osdE/U0mH4ojYsDOST07Cdv1ajesLz+DUjAmu0pXlAkI2DkWpsEItsv EtSZPVWul4w9LsfUytGK2bkVAMvdLG+7LZefWQpALx8loofw/RjLKidKTMgP0rt9/A/m uUaZevZl/uKr7yBkjdMUfDBY17poRcIinQrtYEi24BVBpt0jhObXnSFmk3qyi6w8W5bK skAg== 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 a15si1100399qkj.271.2018.02.15.06.02.53; Thu, 15 Feb 2018 06:02:53 -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 674096176B; Thu, 15 Feb 2018 14:02:53 +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 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 C88A360BF4; Thu, 15 Feb 2018 14:02:39 +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 B190760722; Thu, 15 Feb 2018 14:02:31 +0000 (UTC) Received: from forward103o.mail.yandex.net (forward103o.mail.yandex.net [37.140.190.177]) by lists.linaro.org (Postfix) with ESMTPS id 72E2360722 for ; Thu, 15 Feb 2018 14:01:05 +0000 (UTC) Received: from mxback9g.mail.yandex.net (mxback9g.mail.yandex.net [IPv6:2a02:6b8:0:1472:2741:0:8b7:170]) by forward103o.mail.yandex.net (Yandex) with ESMTP id 2A2055880F7E for ; Thu, 15 Feb 2018 17:00:09 +0300 (MSK) Received: from smtp2o.mail.yandex.net (smtp2o.mail.yandex.net [2a02:6b8:0:1a2d::26]) by mxback9g.mail.yandex.net (nwsmtp/Yandex) with ESMTP id FbNXROEekY-09E4leC8; Thu, 15 Feb 2018 17:00:09 +0300 Received: by smtp2o.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id yLwPeDorb6-08KSE3YO; Thu, 15 Feb 2018 17:00:08 +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: Thu, 15 Feb 2018 17:00:04 +0300 Message-Id: <1518703206-19713-2-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1518703206-19713-1-git-send-email-odpbot@yandex.ru> References: <1518703206-19713-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 484 Subject: [lng-odp] [PATCH v1 1/3] validation: sched: add order_unlock_lock test 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 Added simple ordered lock test, so that new ordered_unlock_lock function is tested at least on single thread. Signed-off-by: Petri Savolainen --- /** Email created from pull request 484 (psavol:master-missing-validation) ** https://github.com/Linaro/odp/pull/484 ** Patch: https://github.com/Linaro/odp/pull/484.patch ** Base sha: 41b3fa2cd994a7ef68290a07dcde5564e4640847 ** Merge commit sha: 595ea205e4c4680f6a9a674fbe637dcab24b038e **/ test/validation/api/scheduler/scheduler.c | 71 +++++++++++++++++++++++++++++++ 1 file changed, 71 insertions(+) diff --git a/test/validation/api/scheduler/scheduler.c b/test/validation/api/scheduler/scheduler.c index 2c0d44100..0be6ce3f8 100644 --- a/test/validation/api/scheduler/scheduler.c +++ b/test/validation/api/scheduler/scheduler.c @@ -1336,6 +1336,76 @@ void scheduler_test_pause_resume(void) CU_ASSERT(ret == 0); } +/* Basic, single threaded ordered lock API testing */ +static void scheduler_test_ordered_lock(void) +{ + odp_queue_t queue; + odp_buffer_t buf; + odp_event_t ev; + odp_queue_t from; + int i; + int ret; + uint32_t lock_count; + + queue = odp_queue_lookup("sched_0_0_o"); + CU_ASSERT_FATAL(queue != ODP_QUEUE_INVALID); + CU_ASSERT_FATAL(odp_queue_type(queue) == ODP_QUEUE_TYPE_SCHED); + CU_ASSERT_FATAL(odp_queue_sched_type(queue) == ODP_SCHED_SYNC_ORDERED); + + lock_count = odp_queue_lock_count(queue); + + if (lock_count == 0) { + printf(" NO ORDERED LOCKS. Ordered locks not tested.\n"); + return; + } + + pool = odp_pool_lookup(MSG_POOL_NAME); + CU_ASSERT_FATAL(pool != ODP_POOL_INVALID); + + for (i = 0; i < BUFS_PER_QUEUE; i++) { + buf = odp_buffer_alloc(pool); + CU_ASSERT_FATAL(buf != ODP_BUFFER_INVALID); + ev = odp_buffer_to_event(buf); + ret = odp_queue_enq(queue, ev); + CU_ASSERT(ret == 0); + + if (ret) + odp_buffer_free(buf); + } + + for (i = 0; i < BUFS_PER_QUEUE / 2; i++) { + from = ODP_QUEUE_INVALID; + ev = odp_schedule(&from, ODP_SCHED_WAIT); + CU_ASSERT_FATAL(ev != ODP_EVENT_INVALID); + CU_ASSERT(from == queue); + buf = odp_buffer_from_event(ev); + odp_schedule_order_lock(0); + odp_schedule_order_unlock(0); + odp_buffer_free(buf); + } + + if (lock_count < 2) { + printf(" ONLY ONE ORDERED LOCK. Unlock_lock not tested.\n"); + return; + } + + for (i = 0; i < BUFS_PER_QUEUE / 2; i++) { + from = ODP_QUEUE_INVALID; + ev = odp_schedule(&from, ODP_SCHED_WAIT); + CU_ASSERT_FATAL(ev != ODP_EVENT_INVALID); + CU_ASSERT(from == queue); + buf = odp_buffer_from_event(ev); + odp_schedule_order_lock(0); + odp_schedule_order_unlock_lock(0, 1); + odp_schedule_order_unlock(1); + odp_buffer_free(buf); + } + + ret = exit_schedule_loop(); + + CU_ASSERT(ret == 0); +} + static int create_queues(void) { int i, j, prios, rc; @@ -1618,6 +1688,7 @@ odp_testinfo_t scheduler_suite[] = { ODP_TEST_INFO(scheduler_test_queue_destroy), ODP_TEST_INFO(scheduler_test_groups), ODP_TEST_INFO(scheduler_test_pause_resume), + ODP_TEST_INFO(scheduler_test_ordered_lock), ODP_TEST_INFO(scheduler_test_parallel), ODP_TEST_INFO(scheduler_test_atomic), ODP_TEST_INFO(scheduler_test_ordered), From patchwork Thu Feb 15 14:00:05 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: 128435 Delivered-To: patch@linaro.org Received: by 10.46.124.24 with SMTP id x24csp1783496ljc; Thu, 15 Feb 2018 06:03:37 -0800 (PST) X-Google-Smtp-Source: AH8x225cImbs7bXCmUHR7c1M0orM6EXxzCdtIez3Vx+B+QvAz9i+cuogUbUoU1fHknLRzt2i+UKZ X-Received: by 10.200.0.17 with SMTP id a17mr4477540qtg.46.1518703416840; Thu, 15 Feb 2018 06:03:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518703416; cv=none; d=google.com; s=arc-20160816; b=WzvXcvF4MXxQWjJtZWOWAxAJ/ZkKksr6uuce8Pwfw8do+i2hBSfIvud/uo4i+rbKxC b8ZMmgiOiQQlffKg4dqibaMKqeH48N4mrYwfyu2mg7w4IX28w9M26q0jt2b3/V+mSc7x AgEezioimBjNkvjur9LTXXDuRqBcYG+sqkcJ3PeA8DQfBsIlNEw9TdTCsXG8XWcaMdbd I9Ko6JooJT3MCb4gOux6XmBaYU3x95p18xRziqPvt6gNRV+tTA5NslBuoHitsGwX6vsf VMAD/ldKTjLOr+cLOweTTebVzC+rrjDeKAPi4IOSHT6+pj/j/b/CCj9ZMl2TIP0vAjv8 hwmQ== 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=G7o7F5BxzM2qX315Hw81szyPwO1hR2INa5qmg/A+OPg=; b=zNmeO6/mOA/WTY5OmeSdg2WOpgppoBcOvD5jFLPBD/K/VDoehMJvOVLkeIPXvWe5DO ZsTZRFB4gKSPaHnHwlceR8ifoO6b/5v9u9vsiDMBZm0Zii+asYbT2vHT3JNTq1HXh6gv tz/rYWEiztBs5keDwk4qY0bvlPf6voHrOnQAjm3xSZ7RtPWJowuHb5jFppZV5HiYUD7K SmK0pqGCykAArESEA2thwbJRes8Ms4YeN1lYeLoFJTjuEOwLQGUXvOsxPgJmkoa4LSTy 5hozWvvTC8eqnz5MGO4UvrUP9RLw6VSH9roBuB5Ijf7ya7DKRz7xSIbxkwxoO6kbAAOa 7zLQ== 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 l4si3141022qtn.22.2018.02.15.06.03.36; Thu, 15 Feb 2018 06:03:36 -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 6550961701; Thu, 15 Feb 2018 14:03:36 +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 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 7AF4460722; Thu, 15 Feb 2018 14:02:50 +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 9124461745; Thu, 15 Feb 2018 14:02:42 +0000 (UTC) Received: from forward103o.mail.yandex.net (forward103o.mail.yandex.net [37.140.190.177]) by lists.linaro.org (Postfix) with ESMTPS id 17A6D60919 for ; Thu, 15 Feb 2018 14:02:00 +0000 (UTC) Received: from mxback3j.mail.yandex.net (mxback3j.mail.yandex.net [IPv6:2a02:6b8:0:1619::10c]) by forward103o.mail.yandex.net (Yandex) with ESMTP id 11063588677B for ; Thu, 15 Feb 2018 17:00:10 +0300 (MSK) Received: from smtp2o.mail.yandex.net (smtp2o.mail.yandex.net [2a02:6b8:0:1a2d::26]) by mxback3j.mail.yandex.net (nwsmtp/Yandex) with ESMTP id dC3Oui5pJa-09qO8bj0; Thu, 15 Feb 2018 17:00:10 +0300 Received: by smtp2o.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id yLwPeDorb6-09KOeEb7; Thu, 15 Feb 2018 17:00:09 +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: Thu, 15 Feb 2018 17:00:05 +0300 Message-Id: <1518703206-19713-3-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1518703206-19713-1-git-send-email-odpbot@yandex.ru> References: <1518703206-19713-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 484 Subject: [lng-odp] [PATCH v1 2/3] linux-gen: cls: fix single queue bugs 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 odp_cls_cos_num_queue() and odp_cls_cos_queues() returned 0 for single queue CoS. Signed-off-by: Petri Savolainen --- /** Email created from pull request 484 (psavol:master-missing-validation) ** https://github.com/Linaro/odp/pull/484 ** Patch: https://github.com/Linaro/odp/pull/484.patch ** Base sha: 41b3fa2cd994a7ef68290a07dcde5564e4640847 ** Merge commit sha: 595ea205e4c4680f6a9a674fbe637dcab24b038e **/ platform/linux-generic/odp_classification.c | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/platform/linux-generic/odp_classification.c b/platform/linux-generic/odp_classification.c index f22dd091c..ceef1fc13 100644 --- a/platform/linux-generic/odp_classification.c +++ b/platform/linux-generic/odp_classification.c @@ -250,11 +250,12 @@ odp_cos_t odp_cls_cos_create(const char *name, odp_cls_cos_param_t *param) cos->s.linked_cos[j] = NULL; } + cos->s.num_queue = param->num_queue; + if (param->num_queue > 1) { odp_queue_param_init(&cos->s.queue_param); cos->s.queue_group = true; cos->s.queue = ODP_QUEUE_INVALID; - cos->s.num_queue = param->num_queue; _odp_cls_update_hash_proto(cos, param->hash_proto); tbl_index = i * CLS_COS_QUEUE_MAX; @@ -358,6 +359,12 @@ int odp_cos_queue_set(odp_cos_t cos_id, odp_queue_t queue_id) ODP_ERR("Invalid odp_cos_t handle"); return -1; } + + if (cos->s.num_queue != 1) { + ODP_ERR("Hashing enabled, cannot set queue"); + return -1; + } + /* Locking is not required as intermittent stale data during CoS modification is acceptable*/ cos->s.queue = queue_id; @@ -402,6 +409,14 @@ uint32_t odp_cls_cos_queues(odp_cos_t cos_id, odp_queue_t queue[], return 0; } + if (cos->s.num_queue == 1) { + if (num == 0) + return 1; + + queue[0] = cos->s.queue; + return 1; + } + if (num < cos->s.num_queue) num_queues = num; else From patchwork Thu Feb 15 14:00:06 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: 128432 Delivered-To: patch@linaro.org Received: by 10.46.124.24 with SMTP id x24csp1780279ljc; Thu, 15 Feb 2018 06:01:13 -0800 (PST) X-Google-Smtp-Source: AH8x226+TwlLe5nskr2oem93PxXU2wCscJDbAYlqGevfuQNVlpCUjJEJWKF9McP6uT33I1FSSNX9 X-Received: by 10.55.13.206 with SMTP id 197mr4290325qkn.115.1518703273542; Thu, 15 Feb 2018 06:01:13 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518703273; cv=none; d=google.com; s=arc-20160816; b=ZtpkCIURNCpdh8U3bWA4e+CQEGo2bZ0iRvXbRhLA1SgxY+EnIijqjHEqd6VHCnzawp tJ0rrehSLUu7EUU6R1XxBXpzxrtgEmnGRIb5rrh/BhAmTIwB1m1fNnWyu1GP66uIjXdY lOHaPStF00Us4mPQTGUvYTgO1Ybq/izVac0p9xSRmw8+vft11fUz4j6dNdO9wjJunVXd IEa/eaFPHFHbV17SFCB2vIM+LhvOILCIqoRm+Sb6YoUrrtX2rCTS0ASLS3FgVt9nmkpJ 9zNeaAH3uW8vGrrYBWWeZ5ltGy7ykneRF9uQnLtlBIYBA6itIVEgI2bSnxGwk9fNO1QO IUiQ== 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=aOGlqVN6yxckcg7jhT8V42lHFKeAPcwf3jEo6P5nP1I=; b=NrxYKm6nxbma6NbLmhV2BITQFHvoyxEOb4GdFPSigkSUiIsWOLZTRs608Mvcpj6rtP vKZqZIMfYQMbbHlQov/5EzVJ01+YFed2qvw48DrJaitij//RkPow2A33WgeDtdFuFL0y oUbx1kejqEBeQS3cy/EQvQEuPR0Gc0MVyHiA2hHM7Op85laOKD7M5jqr6hX91by0xOc7 P/QrojaioyrAC13yQKBF5H8Nr+l8W4XDw+DJKXdr8C9hlSoBRO3VL/V0Q/H825Sucf+o JbEuXnesjaz8KOpWjGwbLlEQJOOmnYVKV/b5WXDukkMDgwpmmQq3bsGPQZmTewQDxI1D 2lpw== 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 k7si2107359qtk.422.2018.02.15.06.01.13; Thu, 15 Feb 2018 06:01:13 -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 0B47461755; Thu, 15 Feb 2018 14:01:13 +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 646786087B; Thu, 15 Feb 2018 14:00:25 +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 0680061745; Thu, 15 Feb 2018 14:00:14 +0000 (UTC) Received: from forward104o.mail.yandex.net (forward104o.mail.yandex.net [37.140.190.179]) by lists.linaro.org (Postfix) with ESMTPS id A6F1061701 for ; Thu, 15 Feb 2018 14:00:12 +0000 (UTC) Received: from mxback11j.mail.yandex.net (mxback11j.mail.yandex.net [IPv6:2a02:6b8:0:1619::84]) by forward104o.mail.yandex.net (Yandex) with ESMTP id E03FE703BE9 for ; Thu, 15 Feb 2018 17:00:10 +0300 (MSK) Received: from smtp2o.mail.yandex.net (smtp2o.mail.yandex.net [2a02:6b8:0:1a2d::26]) by mxback11j.mail.yandex.net (nwsmtp/Yandex) with ESMTP id DRAcdKbhGA-0A50BbVr; Thu, 15 Feb 2018 17:00:10 +0300 Received: by smtp2o.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id yLwPeDorb6-0AKaVroG; Thu, 15 Feb 2018 17:00:10 +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: Thu, 15 Feb 2018 17:00:06 +0300 Message-Id: <1518703206-19713-4-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1518703206-19713-1-git-send-email-odpbot@yandex.ru> References: <1518703206-19713-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 484 Subject: [lng-odp] [PATCH v1 3/3] validation: cls: test cos_num_queue and cos_queues 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 Added single queue tests for cos_num_queue and cos_queues. This way functions are called at least once from validation test suite. Signed-off-by: Petri Savolainen --- /** Email created from pull request 484 (psavol:master-missing-validation) ** https://github.com/Linaro/odp/pull/484 ** Patch: https://github.com/Linaro/odp/pull/484.patch ** Base sha: 41b3fa2cd994a7ef68290a07dcde5564e4640847 ** Merge commit sha: 595ea205e4c4680f6a9a674fbe637dcab24b038e **/ test/validation/api/classification/odp_classification_basic.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/test/validation/api/classification/odp_classification_basic.c b/test/validation/api/classification/odp_classification_basic.c index c31a7530e..20f073740 100644 --- a/test/validation/api/classification/odp_classification_basic.c +++ b/test/validation/api/classification/odp_classification_basic.c @@ -149,6 +149,7 @@ void classification_test_cos_set_queue(void) odp_queue_t queue_cos; odp_cos_t cos_queue; odp_queue_t recvqueue; + odp_queue_t queue_out = ODP_QUEUE_INVALID; pool = pool_create("cls_basic_pool"); CU_ASSERT_FATAL(pool != ODP_POOL_INVALID); @@ -171,6 +172,9 @@ void classification_test_cos_set_queue(void) CU_ASSERT(retval == 0); recvqueue = odp_cos_queue(cos_queue); CU_ASSERT(recvqueue == queue_cos); + CU_ASSERT(odp_cls_cos_num_queue(cos_queue) == 1); + CU_ASSERT(odp_cls_cos_queues(cos_queue, &queue_out, 1) == 1); + CU_ASSERT(queue_out == queue_cos); odp_cos_destroy(cos_queue); odp_queue_destroy(queue_cos);