From patchwork Tue Nov 17 06:16:52 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Balasubramanian Manoharan X-Patchwork-Id: 56706 Delivered-To: patch@linaro.org Received: by 10.112.155.196 with SMTP id vy4csp1742423lbb; Mon, 16 Nov 2015 22:20:40 -0800 (PST) X-Received: by 10.140.158.11 with SMTP id e11mr42177758qhe.81.1447741240739; Mon, 16 Nov 2015 22:20:40 -0800 (PST) Return-Path: Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id d81si28818117qkb.124.2015.11.16.22.20.40; Mon, 16 Nov 2015 22:20:40 -0800 (PST) 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; dkim=neutral (body hash did not verify) header.i=@linaro_org.20150623.gappssmtp.com Received: by lists.linaro.org (Postfix, from userid 109) id 528CE61C7E; Tue, 17 Nov 2015 06:20:40 +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.5 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_LOW,RCVD_IN_MSPIKE_H2,T_DKIM_INVALID,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 18EBD61CE0; Tue, 17 Nov 2015 06:18:17 +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 5FE3761CC1; Tue, 17 Nov 2015 06:18:08 +0000 (UTC) Received: from mail-pa0-f43.google.com (mail-pa0-f43.google.com [209.85.220.43]) by lists.linaro.org (Postfix) with ESMTPS id 1B24161CC8 for ; Tue, 17 Nov 2015 06:17:13 +0000 (UTC) Received: by pacej9 with SMTP id ej9so94063099pac.2 for ; Mon, 16 Nov 2015 22:17:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro_org.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=+sQC4Iarj++W2YQHxEBl3DQJqz4nbFF4dCV1YumIcxY=; b=xeaULo2XuWAAVXdW1LLHbEOsP6IfiLSlLULNmOB9QT/FTgO0z9j1zFCYGPuzxcrdYH wUtQb9vkmJwdug2h96ymLhoEWGQJ2/oO5uoVJGAHsJINCes6iRsXi2sfxjn7TUAXJSEZ 6Vh0SR0somYHb2bazJPgUmneg1Jcvrq7b7LhZnx77B5tfdbQHDUJrlvCZ5iv8i3+BGQ7 PFS7yEIifcue7udaQN15+QfDf8VUoySTGs3PU5TqEEj3kpEbcphabCUkqCf3HW4mPutU Mmc/6mnGBZ817hje0yYtzW5vgoUkfqyM6NSojZVhpOMKV84wZNhattHg9yPDpLcSzuFy ozkw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=+sQC4Iarj++W2YQHxEBl3DQJqz4nbFF4dCV1YumIcxY=; b=PAnNCYQXmJOCnk9iFdeT1JyB/wiEQUX/usDtDFDXR+QPGyg6PVqIkgxtk2JZFMWX6q pFm9x5Noyx9zW72S4bosRac9wuW1xgpEG6tzamMN3MtN8ABlf5Y6WrsGhVyKyiDqBx4U cQAULYuWxrWo2zPUESRZAc0eNXyIwoiMJEch2tomy+AJrJ+XxFVDjGJ8t8rBSjZa+JI/ GKhrwcnEpkUzCIQv734pYDhP0LjGtIhHvrw9RPXaVx0mNhRI6wP58TFzPVxqkg+ksp4Z IrT0965mcE/SVmGoq3IPMmAKQSH5I3jtq2TuXVBogw6D8K6kKotZ1d2Lb4nwS059zYTB ou0g== X-Gm-Message-State: ALoCoQnjbiYnpaEsnBwGkFuybK17gyH4m6cNLMPYheCuamqOPjj26Tt8sN79L8ZN92Cm4dRGIUQO X-Received: by 10.68.112.37 with SMTP id in5mr60332673pbb.88.1447741032373; Mon, 16 Nov 2015 22:17:12 -0800 (PST) Received: from localhost.localdomain ([122.166.219.57]) by smtp.gmail.com with ESMTPSA id tp6sm40199084pbc.81.2015.11.16.22.17.10 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 16 Nov 2015 22:17:11 -0800 (PST) From: Balasubramanian Manoharan To: lng-odp@lists.linaro.org Date: Tue, 17 Nov 2015 11:46:52 +0530 Message-Id: <1447741013-7333-4-git-send-email-bala.manoharan@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1447741013-7333-1-git-send-email-bala.manoharan@linaro.org> References: <1447741013-7333-1-git-send-email-bala.manoharan@linaro.org> X-Topics: Classification patch Subject: [lng-odp] [PATCH 4/5] validation: classification: add odp_cls_cos_pool_set() api 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" Assigns a packet pool to CoS using odp_cls_cos_pool_set() api. Signed-off-by: Balasubramanian Manoharan --- .../classification/odp_classification_test_pmr.c | 15 ++++++++++++++ .../classification/odp_classification_tests.c | 24 ++++++++++++++++++++++ 2 files changed, 39 insertions(+) diff --git a/test/validation/classification/odp_classification_test_pmr.c b/test/validation/classification/odp_classification_test_pmr.c index 3f49d4c..5f51a03 100644 --- a/test/validation/classification/odp_classification_test_pmr.c +++ b/test/validation/classification/odp_classification_test_pmr.c @@ -153,6 +153,9 @@ static void classification_test_pmr_term_tcp_dport(void) queue = queue_create(queuename, true); CU_ASSERT(queue != ODP_QUEUE_INVALID); + retval = odp_cls_cos_pool_set(cos, pool_default); + CU_ASSERT(retval == 0); + retval = odp_cos_queue_set(cos, queue); CU_ASSERT(retval == 0); @@ -240,6 +243,9 @@ static void classification_test_pmr_term_tcp_sport(void) queue = queue_create(queuename, true); CU_ASSERT_FATAL(queue != ODP_QUEUE_INVALID); + retval = odp_cls_cos_pool_set(cos, pool_default); + CU_ASSERT(retval == 0); + retval = odp_cos_queue_set(cos, queue); CU_ASSERT(retval == 0); @@ -328,6 +334,9 @@ static void classification_test_pmr_term_udp_dport(void) retval = odp_cos_queue_set(cos, queue); CU_ASSERT(retval == 0); + retval = odp_cls_cos_pool_set(cos, pool_default); + CU_ASSERT(retval == 0); + retval = odp_pktio_pmr_cos(pmr, pktio, cos); CU_ASSERT(retval == 0); @@ -414,6 +423,9 @@ static void classification_test_pmr_term_udp_sport(void) retval = odp_cos_queue_set(cos, queue); CU_ASSERT(retval == 0); + retval = odp_cls_cos_pool_set(cos, pool_default); + CU_ASSERT(retval == 0); + retval = odp_pktio_pmr_cos(pmr, pktio, cos); CU_ASSERT(retval == 0); @@ -498,6 +510,9 @@ static void classification_test_pmr_term_ipproto(void) retval = odp_cos_queue_set(cos, queue); CU_ASSERT(retval == 0); + retval = odp_cls_cos_pool_set(cos, pool_default); + CU_ASSERT(retval == 0); + retval = odp_pktio_pmr_cos(pmr, pktio, cos); CU_ASSERT(retval == 0); diff --git a/test/validation/classification/odp_classification_tests.c b/test/validation/classification/odp_classification_tests.c index 3944d94..bec7053 100644 --- a/test/validation/classification/odp_classification_tests.c +++ b/test/validation/classification/odp_classification_tests.c @@ -154,6 +154,10 @@ void configure_cls_pmr_chain(void) queue_list[CLS_PMR_CHAIN_SRC]); CU_ASSERT(retval == 0); + retval = odp_cls_cos_pool_set(cos_list[CLS_PMR_CHAIN_SRC], + pool_default); + CU_ASSERT(retval == 0); + sprintf(cosname, "DstCos"); cos_list[CLS_PMR_CHAIN_DST] = odp_cos_create(cosname); CU_ASSERT_FATAL(cos_list[CLS_PMR_CHAIN_DST] != ODP_COS_INVALID); @@ -173,6 +177,10 @@ void configure_cls_pmr_chain(void) queue_list[CLS_PMR_CHAIN_DST]); CU_ASSERT(retval == 0); + retval = odp_cls_cos_pool_set(cos_list[CLS_PMR_CHAIN_DST], + pool_default); + CU_ASSERT(retval == 0); + parse_ipv4_string(CLS_PMR_CHAIN_SADDR, &addr, &mask); match.term = ODP_PMR_SIP_ADDR; match.val = &addr; @@ -273,6 +281,9 @@ void configure_pktio_default_cos(void) queue_list[CLS_DEFAULT]); CU_ASSERT(retval == 0); + retval = odp_cls_cos_pool_set(cos_list[CLS_DEFAULT], pool_default); + CU_ASSERT(retval == 0); + retval = odp_pktio_default_cos_set(pktio_loop, cos_list[CLS_DEFAULT]); CU_ASSERT(retval == 0); } @@ -323,6 +334,9 @@ void configure_pktio_error_cos(void) retval = odp_cos_queue_set(cos_list[CLS_ERROR], queue_list[CLS_ERROR]); CU_ASSERT(retval == 0); + retval = odp_cls_cos_pool_set(cos_list[CLS_ERROR], pool_default); + CU_ASSERT(retval == 0); + retval = odp_pktio_error_cos_set(pktio_loop, cos_list[CLS_ERROR]); CU_ASSERT(retval == 0); } @@ -411,6 +425,10 @@ void configure_cos_with_l2_priority(void) queue_list[CLS_L2_QOS_0 + i] = queue_tbl[i]; retval = odp_cos_queue_set(cos_tbl[i], queue_tbl[i]); CU_ASSERT(retval == 0); + + retval = odp_cls_cos_pool_set(cos_tbl[i], pool_default); + CU_ASSERT(retval == 0); + qos_tbl[i] = i; } /* count 'i' is passed instead of num_qos to handle the rare scenario @@ -483,6 +501,9 @@ void configure_pmr_cos(void) queue_list[CLS_PMR]); CU_ASSERT(retval == 0); + retval = odp_cls_cos_pool_set(cos_list[CLS_PMR], pool_default); + CU_ASSERT(retval == 0); + retval = odp_pktio_pmr_cos(pmr_list[CLS_PMR], pktio_loop, cos_list[CLS_PMR]); CU_ASSERT(retval == 0); @@ -557,6 +578,9 @@ void configure_pktio_pmr_match_set_cos(void) queue_list[CLS_PMR_SET]); CU_ASSERT(retval == 0); + retval = odp_cls_cos_pool_set(cos_list[CLS_PMR_SET], pool_default); + CU_ASSERT(retval == 0); + retval = odp_pktio_pmr_match_set_cos(pmr_set, pktio_loop, cos_list[CLS_PMR_SET]); CU_ASSERT(retval == 0);