From patchwork Tue Jan 12 18:11:47 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ivan Khoronzhuk X-Patchwork-Id: 59637 Delivered-To: patch@linaro.org Received: by 10.112.130.2 with SMTP id oa2csp2894714lbb; Tue, 12 Jan 2016 10:15:47 -0800 (PST) X-Received: by 10.140.128.8 with SMTP id 8mr154914397qha.54.1452622547648; Tue, 12 Jan 2016 10:15:47 -0800 (PST) Return-Path: Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id t125si91765345qhc.129.2016.01.12.10.15.47; Tue, 12 Jan 2016 10:15:47 -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 Received: by lists.linaro.org (Postfix, from userid 109) id 2322561736; Tue, 12 Jan 2016 18:15:47 +0000 (UTC) Authentication-Results: lists.linaro.org; dkim=fail reason="verification failed; unprotected key" header.d=linaro.org header.i=@linaro.org header.b=JDsOTgBE; dkim-adsp=none (unprotected policy); dkim-atps=neutral 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_H3, RCVD_IN_MSPIKE_WL, 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 52AC6616FD; Tue, 12 Jan 2016 18:12:38 +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 B8F1B61709; Tue, 12 Jan 2016 18:12:33 +0000 (UTC) Received: from mail-lb0-f180.google.com (mail-lb0-f180.google.com [209.85.217.180]) by lists.linaro.org (Postfix) with ESMTPS id C09BB616E8 for ; Tue, 12 Jan 2016 18:12:03 +0000 (UTC) Received: by mail-lb0-f180.google.com with SMTP id cl12so59790727lbc.1 for ; Tue, 12 Jan 2016 10:12:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=i0isbmP02He1tv2TuxH/L21aqMuV34ghnFSfbaMgxT0=; b=JDsOTgBEGgtcUrwW4BEgrAhv9VStT2oE8JhL95q3HAqJQaDMYV8bYI6UsKvYzr5RVb PBIby3ieWAo5S33ariBsgySKImVvk/EWuRrtN+RHz6Ib9IE6vlWDXLifXkPOBYeMYab2 0EnD6Eb4ORSV7Icdp2SE2b4EFfqndaRcuA168= 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=i0isbmP02He1tv2TuxH/L21aqMuV34ghnFSfbaMgxT0=; b=iD99OABoJKgmWTrX6yxXyi/nJtKAK6CcWPAQ/4U4NxDONSTkVowy/ts60sk0b8p+Vn CP6L6be2uf7E3agBohgN25dw6NWS0sKTRtQAh3TuGRP/lHzlisIPZHJqm6avmFUlvvi8 fCcZ/973qOilYFeZN2+kohEtGbICI8itB3W7+UH64EPKXLHFWO0+XM8rCiGH0UKbzeU9 uld0+VvSTxb+QEFLmKteTTxPi7yTIFLwwpIXrZ4xPjsphkttvV+wwOsT7UiFB228cNzN ZvwbK1F4qT9ycYHdh/AHMahpN7XC0KJqKkniK9vqPSxZR6nCvEZxwhNQlIuRL7wMAeSV eiew== X-Gm-Message-State: ALoCoQnj9YaNYTDx8F8JOyGpai0Q6P2wJytMMhvsULynWIVRUc7DU7jbSTRbrpBzIoAMmLD90JnsF2oaO0qObimBC03jwBtFsg== X-Received: by 10.112.146.67 with SMTP id ta3mr31761520lbb.98.1452622322689; Tue, 12 Jan 2016 10:12:02 -0800 (PST) Received: from localhost.localdomain ([195.238.92.128]) by smtp.gmail.com with ESMTPSA id o9sm3340536lfe.15.2016.01.12.10.12.01 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 12 Jan 2016 10:12:02 -0800 (PST) From: Ivan Khoronzhuk To: lng-odp@lists.linaro.org Date: Tue, 12 Jan 2016 20:11:47 +0200 Message-Id: <1452622307-18379-6-git-send-email-ivan.khoronzhuk@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1452622307-18379-1-git-send-email-ivan.khoronzhuk@linaro.org> References: <1452622307-18379-1-git-send-email-ivan.khoronzhuk@linaro.org> X-Topics: patch Subject: [lng-odp] [PATCH 5/5] validation: cls: split pmr chain 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: , MIME-Version: 1.0 Errors-To: lng-odp-bounces@lists.linaro.org Sender: "lng-odp" These tests are simple classification tests and better to see results for each of them separately. Signed-off-by: Ivan Khoronzhuk --- test/validation/classification/classification.h | 22 ++++--- .../classification/odp_classification_tests.c | 72 ++++++++-------------- 2 files changed, 38 insertions(+), 56 deletions(-) diff --git a/test/validation/classification/classification.h b/test/validation/classification/classification.h index f363812..6d2e55f 100644 --- a/test/validation/classification/classification.h +++ b/test/validation/classification/classification.h @@ -13,7 +13,6 @@ #define SHM_PKT_BUF_SIZE 1024 /* Config values for Default CoS */ -#define TEST_DEFAULT 1 #define CLS_DEFAULT 0 #define CLS_DEFAULT_SADDR "10.0.0.1/32" #define CLS_DEFAULT_DADDR "10.0.0.100/32" @@ -21,29 +20,24 @@ #define CLS_DEFAULT_DPORT 2048 /* Config values for Error CoS */ -#define TEST_ERROR 1 #define CLS_ERROR 1 /* Config values for PMR_CHAIN */ -#define TEST_PMR_CHAIN 1 #define CLS_PMR_CHAIN_SRC 2 #define CLS_PMR_CHAIN_DST 3 #define CLS_PMR_CHAIN_SADDR "10.0.0.5/32" #define CLS_PMR_CHAIN_PORT 3000 /* Config values for PMR */ -#define TEST_PMR 1 #define CLS_PMR 4 #define CLS_PMR_PORT 4000 /* Config values for PMR SET */ -#define TEST_PMR_SET 1 #define CLS_PMR_SET 5 #define CLS_PMR_SET_SADDR "10.0.0.6/32" #define CLS_PMR_SET_PORT 5000 /* Config values for CoS L2 Priority */ -#define TEST_L2_QOS 1 #define CLS_L2_QOS_0 6 #define CLS_L2_QOS_MAX 5 @@ -68,8 +62,20 @@ void classification_test_pktio_set_skip(void); void classification_test_pktio_set_headroom(void); void classification_test_pmr_terms_avail(void); void classification_test_pmr_terms_cap(void); -void classification_test_pktio_configure(void); -void classification_test_pktio_test(void); + +void classification_test_configure_pktio_default_cos(void); +void classification_test_configure_pktio_error_cos(void); +void classification_test_configure_cls_pmr_chain(void); +void classification_test_configure_cos_with_l2_priority(void); +void classification_test_configure_pmr_cos(void); +void classification_test_configure_pktio_pmr_match_set_cos(void); + +void classification_test_pktio_default_cos(void); +void classification_test_pktio_error_cos(void); +void classification_test_cls_pmr_chain(void); +void classification_test_cos_with_l2_priority(void); +void classification_test_pmr_cos(void); +void classification_test_pktio_pmr_match_set_cos(void); void classification_test_pmr_term_tcp_dport(void); void classification_test_pmr_term_tcp_sport(void); diff --git a/test/validation/classification/odp_classification_tests.c b/test/validation/classification/odp_classification_tests.c index 34fc570..482e2d0 100644 --- a/test/validation/classification/odp_classification_tests.c +++ b/test/validation/classification/odp_classification_tests.c @@ -133,7 +133,7 @@ cls_create_packet(bool vlan, odp_atomic_u32_t *seq, bool flag_udp) return pkt; } -void configure_cls_pmr_chain(void) +void classification_test_configure_cls_pmr_chain(void) { /* PKTIO --> PMR_SRC(SRC IP ADDR) --> PMR_DST (TCP SPORT) */ @@ -230,7 +230,7 @@ void configure_cls_pmr_chain(void) CU_ASSERT(retval == 0); } -void test_cls_pmr_chain(void) +void classification_test_cls_pmr_chain(void) { odp_packet_t pkt; odph_ipv4hdr_t *ip; @@ -284,7 +284,7 @@ void test_cls_pmr_chain(void) odp_packet_free(pkt); } -void configure_pktio_default_cos(void) +void classification_test_configure_pktio_default_cos(void) { int retval; odp_queue_param_t qparam; @@ -318,7 +318,7 @@ void configure_pktio_default_cos(void) CU_ASSERT(retval == 0); } -void test_pktio_default_cos(void) +void classification_test_pktio_default_cos(void) { odp_packet_t pkt; odp_queue_t queue; @@ -344,7 +344,7 @@ void test_pktio_default_cos(void) odp_packet_free(pkt); } -void configure_pktio_error_cos(void) +void classification_test_configure_pktio_error_cos(void) { int retval; odp_queue_param_t qparam; @@ -380,7 +380,7 @@ void configure_pktio_error_cos(void) CU_ASSERT(retval == 0); } -void test_pktio_error_cos(void) +void classification_test_pktio_error_cos(void) { odp_queue_t queue; odp_packet_t pkt; @@ -434,7 +434,7 @@ void classification_test_pktio_set_headroom(void) CU_ASSERT(retval < 0); } -void configure_cos_with_l2_priority(void) +void classification_test_configure_cos_with_l2_priority(void) { uint8_t num_qos = CLS_L2_QOS_MAX; odp_cos_t cos_tbl[CLS_L2_QOS_MAX]; @@ -487,7 +487,7 @@ void configure_cos_with_l2_priority(void) CU_ASSERT(retval == 0); } -void test_cos_with_l2_priority(void) +void classification_test_cos_with_l2_priority(void) { odp_packet_t pkt; odph_ethhdr_t *ethhdr; @@ -516,7 +516,7 @@ void test_cos_with_l2_priority(void) } } -void configure_pmr_cos(void) +void classification_test_configure_pmr_cos(void) { uint16_t val; uint16_t mask; @@ -566,7 +566,7 @@ void configure_pmr_cos(void) CU_ASSERT(retval == 0); } -void test_pmr_cos(void) +void classification_test_pmr_cos(void) { odp_packet_t pkt; odp_queue_t queue; @@ -588,7 +588,7 @@ void test_pmr_cos(void) odp_packet_free(pkt); } -void configure_pktio_pmr_match_set_cos(void) +void classification_test_configure_pktio_pmr_match_set_cos(void) { int retval; odp_pmr_match_t pmr_terms[2]; @@ -648,7 +648,7 @@ void configure_pktio_pmr_match_set_cos(void) CU_ASSERT(retval == 0); } -void test_pktio_pmr_match_set_cos(void) +void classification_test_pktio_pmr_match_set_cos(void) { uint32_t addr = 0; uint32_t mask; @@ -697,46 +697,22 @@ void classification_test_pmr_terms_cap(void) CU_ASSERT(retval & (1 << ODP_PMR_IPPROTO)); } -void classification_test_pktio_configure(void) -{ - /* Configure the Different CoS for the pktio interface */ - if (TEST_DEFAULT) - configure_pktio_default_cos(); - if (TEST_ERROR) - configure_pktio_error_cos(); - if (TEST_PMR_CHAIN) - configure_cls_pmr_chain(); - if (TEST_L2_QOS) - configure_cos_with_l2_priority(); - if (TEST_PMR) - configure_pmr_cos(); - if (TEST_PMR_SET) - configure_pktio_pmr_match_set_cos(); -} - -void classification_test_pktio_test(void) -{ - /* Test Different CoS on the pktio interface */ - if (TEST_DEFAULT) - test_pktio_default_cos(); - if (TEST_ERROR) - test_pktio_error_cos(); - if (TEST_PMR_CHAIN) - test_cls_pmr_chain(); - if (TEST_L2_QOS) - test_cos_with_l2_priority(); - if (TEST_PMR) - test_pmr_cos(); - if (TEST_PMR_SET) - test_pktio_pmr_match_set_cos(); -} - odp_testinfo_t classification_suite[] = { ODP_TEST_INFO(classification_test_pmr_terms_avail), ODP_TEST_INFO(classification_test_pktio_set_skip), ODP_TEST_INFO(classification_test_pktio_set_headroom), ODP_TEST_INFO(classification_test_pmr_terms_cap), - ODP_TEST_INFO(classification_test_pktio_configure), - ODP_TEST_INFO(classification_test_pktio_test), + ODP_TEST_INFO(classification_test_configure_pktio_default_cos), + ODP_TEST_INFO(classification_test_configure_pktio_error_cos), + ODP_TEST_INFO(classification_test_configure_cls_pmr_chain), + ODP_TEST_INFO(classification_test_configure_cos_with_l2_priority), + ODP_TEST_INFO(classification_test_configure_pmr_cos), + ODP_TEST_INFO(classification_test_configure_pktio_pmr_match_set_cos), + ODP_TEST_INFO(classification_test_pktio_default_cos), + ODP_TEST_INFO(classification_test_pktio_error_cos), + ODP_TEST_INFO(classification_test_cls_pmr_chain), + ODP_TEST_INFO(classification_test_cos_with_l2_priority), + ODP_TEST_INFO(classification_test_pmr_cos), + ODP_TEST_INFO(classification_test_pktio_pmr_match_set_cos), ODP_TEST_INFO_NULL, };