From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM02-BL2-obe.outbound.protection.outlook.com (mail-bl2nam02on0050.outbound.protection.outlook.com [104.47.38.50]) by dpdk.org (Postfix) with ESMTP id 2B7D5FE5 for ; Fri, 31 Mar 2017 21:37:36 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=CAVIUMNETWORKS.onmicrosoft.com; s=selector1-cavium-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=hkbtBB7kfCoq6mx5aYUVFa+UfJHX/KX8Oi4tbQX190M=; b=AJKi7OCBsbe4OVqi+/ROV42/1NTE9itwpT+Om+mkb43Cl7d2AN8vggq0U1gDPKMzDW6izUCprsZ3eBY6LTebRs51tOm5Fn7Fs7F3Vxg4VV4kOXe3TubqxDqG4SOuUiBNr32bomIVXsCebgzniasBmjw4xtVLeqc0UPZf5U7zhFo= Authentication-Results: dpdk.org; dkim=none (message not signed) header.d=none;dpdk.org; dmarc=none action=none header.from=caviumnetworks.com; Received: from localhost.localdomain (14.140.2.178) by BY1PR0701MB1723.namprd07.prod.outlook.com (10.162.111.142) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.991.14; Fri, 31 Mar 2017 19:37:31 +0000 From: Jerin Jacob To: dev@dpdk.org Cc: thomas.monjalon@6wind.com, bruce.richardson@intel.com, harry.van.haaren@intel.com, hemant.agrawal@nxp.com, gage.eads@intel.com, nipun.gupta@nxp.com, santosh.shukla@caviumnetworks.com, Jerin Jacob Date: Sat, 1 Apr 2017 01:04:56 +0530 Message-Id: <1490988905-12584-30-git-send-email-jerin.jacob@caviumnetworks.com> X-Mailer: git-send-email 2.5.5 In-Reply-To: <1490988905-12584-1-git-send-email-jerin.jacob@caviumnetworks.com> References: <1488562101-6658-1-git-send-email-jerin.jacob@caviumnetworks.com> <1490988905-12584-1-git-send-email-jerin.jacob@caviumnetworks.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [14.140.2.178] X-ClientProxiedBy: MAXPR01CA0058.INDPRD01.PROD.OUTLOOK.COM (10.164.146.158) To BY1PR0701MB1723.namprd07.prod.outlook.com (10.162.111.142) X-MS-Office365-Filtering-Correlation-Id: 169fd0d0-b80f-4ecc-f788-08d4786d6142 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(201703131423075)(201703031133081); SRVR:BY1PR0701MB1723; X-Microsoft-Exchange-Diagnostics: 1; BY1PR0701MB1723; 3:+cEivohAlS2Qkp2OkX/7gG+oVhQmSKc7AKiP/R5HVpjkbdlQ6SAlvNbCuqYbUzxf9jYOwkK0lVaeBl8QFrQKvlzVQL7bU51HelU1bPSKhc+ls79sT+ONkNpf00+fzlCd9vzzPkF296Yor+LPmTS3hT+U/WbpaCWZH4lF+oSQrvPICYJhqXi94RsuscIO8C/ipCBWzLA4DUUWSkV3OyJEEP5xE7m07SzkAewvWeRTk1/GpHkNq9MaGl0r0no73dDjSDk89Dvd7yqCIm1y01QYHJuS4vXZX/ZOWNQhncB2QQ4xgXNNFjm1YC8OBPj3vHHabfIFj1kkNgVmsrBTkpqcvA==; 25:wvVNMHKnDqRHIvSpQP7RQfeC1YKO6KUp6NXXUi+mVhyd9JlrT/T/qToQnAsydoR3TnpSA5udwz+St6bILdBadkdl4BHkhpeWeJc0SZi0oiyeB9BHwlLA6rc3s5i4Jj3TfPjIx3lM3cb3Z3I+GDAUFvJole31DzGoJVi9RLi+NFMW6eWEVbzwFaiq0avS3wZAarkOb6wnwThksqm8TgMUjERdPj+S5mpjZ3sypntJsTeU0qjYffaJVddQ0bayWMYwgFJlz6UiyWIyh3mhjeCDRq0XDG7giUdeYg8oifTVb2hR9aGnDiHV4xfASLrZE+fP6owoQMMFmwe+OnYvXC41oBoE9pGf58+B/Wt2gn0ukMjAfDHVgg8nDsWqEJEGm3/fXCk8k+Ux5TWq+QuKa2yMmZsacDc0XZ8Y6ycP1MS/ngGLwoTyiEu0MH2ty+hRRoZrp58g//L1224570d5i06suQ== X-Microsoft-Exchange-Diagnostics: 1; BY1PR0701MB1723; 31:yp4w0QR4Oo2dZI26NMzJqc+vVJ/kNeo8yuh6oAu4T5eH0om8rH5tXi86MjMhqG9hJAsLIHd2rRJkm8a8bX2fwaHvOddM2ITdGcI5kKx7cpqTzKJew8jVh+GaM5+pcDJelmQTpKF9HtP6piTs8RVoDR+htmq1uXtgWHq4uUmynWV2XsyMYnD+qIqcZaEEVN3GKBoK1Y3AhqvpP6tiOPuShPZe1fq+733TUa8SWLMoDc7c8lF7R4NDrbJ2zM7j7thw; 20:vG6DSCt8zm/r7znWlAGv8/I47C7j36hxaUen97Zg4alLLONLDcFg8PJ25OZCg6H0rkqJ1rySJGBQcOBDNaxdenLNYNjxUGKFDvaqE8BNA2DXGDwefkZg7FAPw+75TeBqPIWvM+6+iqwQB1a7O6Euo92Jw2O7Zhe6GbkfAXvaJZS9FKenqq6nMrfcfxsTfggRpYTXzlm4uQ9lUUTE9uBkNPJUMu639ZNyIUGkmepWEm7SYOZKg1eIBvIkQdGvyPvmtYwlFmqKjqPaDy2bKd07IaujZc6zxK8sRCisGEYJFzHmn4C5gv37lbG7VBkV0A7NzPi8AEuuujsHwzPds37pFhTESYYb9avn89m2NABp/fK7lPWqQnlTjqK8KzsRJmi5aWUO7uORPetmsC4lcXY/r+EVqYOvFnGzdQLH3P66sfp8scXpo+84ESdIVoKx4IabSccgUqaSAzuxxxE+q1FHybp6LA+121/SRgFxKmZv9HRRZzJN1r2nt/NW5gkjWSxeb40uSMB2BP++6aCncLtM1XXToO6z65vw1zEFSGVG+Jx29e2ilcZUlqN0I9LNih7xtEKRySFmY0etJ17YqDF94S0EY9DYQsYn1VW502V9dZs= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(228905959029699); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040450)(601004)(2401047)(8121501046)(5005006)(10201501046)(93006095)(3002001)(6041248)(20161123555025)(20161123562025)(201703131423075)(201702281528075)(201703061421075)(20161123560025)(20161123564025)(6072148); SRVR:BY1PR0701MB1723; BCL:0; PCL:0; RULEID:; SRVR:BY1PR0701MB1723; X-Microsoft-Exchange-Diagnostics: 1; BY1PR0701MB1723; 4:LdZMRVUDOgWYsfOHs3I2v3Sc9AqhwtiTcPmD18k+1LES9GT+FweB0kxHNDkK02XQJQ+GchZfWgNlalEOd23kFbQPL8BGCA5reM+w9dsfiYHDHO4cdwrewdjXpVawkvgspU53LZse+uHIkBcfwsnANQiEOjBTbtCCGIKttXbcfq5hSF33dP2s+GuOVR5igE5zxPdS6CFwJ8IX99nGoym5PBcQox9ndeX2Zs68bJy+1BqXOoHtQd1iyrldi9oxuHYrA1JZx6EnLxWLGkrX3n2bw0yJBdca8XkMyMqHTKWhIrHtX06CNizCLpQzt9zyZRFfudpClNqI7n3kz3IbsHqgZnM/ANjuQRO+yBQEfj7hGsMSOKT3UbOPTGBbnzqgmGJ7NrC0NDQcGO507NImIXA0lgX4Tl+KzN2Pmlxga2owifD4eEThcRj0EcPipT/iJOte2P42r9T2D8XDUvLb1p4EK5yJmXDT8h36ThEQh/KGF2K1JM6z3bEVaWhcQ5Ta8piCPsPjpzS2PEGFMZ4vidCf0hizwneFIBER/YMXyTfeXR4WJD2OlixAae/OauHgaagfqKdRrlw4/i04ClS+SaoD6c4WjYIFHy01udPF2dXQft8L84TQDBkAl9DiWIciCcxLcvb9C68/vLFjsYOFLcowQ7vaMW8o1W7l2kODUOwGQR+FVliafr1VT+kGS9Dcc+4iLVJiB9q9X6AXxGjav/23Uskfk02+Xxfi58BMhEGhM7nU3HSIc+/e8nl+iZx3wsLe X-Forefront-PRVS: 02638D901B X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4630300001)(6069001)(6009001)(39450400003)(39410400002)(39400400002)(39850400002)(39840400002)(38730400002)(8676002)(107886003)(110136004)(50466002)(189998001)(305945005)(6506006)(36756003)(50226002)(25786009)(48376002)(6666003)(8656002)(6486002)(7736002)(2950100002)(5660300001)(53936002)(81156014)(81166006)(3846002)(42882006)(6916009)(6116002)(6512007)(42186005)(33646002)(2361001)(2351001)(76176999)(50986999)(551934003)(5003940100001)(47776003)(2906002)(5009440100003)(4326008)(66066001)(110426004); DIR:OUT; SFP:1101; SCL:1; SRVR:BY1PR0701MB1723; H:localhost.localdomain; FPR:; SPF:None; MLV:nov; PTR:InfoNoRecords; LANG:en; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BY1PR0701MB1723; 23:5nxG62h9762w2eQ7Ibn++T0Kuqd/0DdBmwrB6A/?= =?us-ascii?Q?nl531whBTEt5PeB2rP7jWejfS+tlVXMTCOVRkUJB0+Nf+k1AaA39+zDNhxlQ?= =?us-ascii?Q?peoj/IkS7LNHwpdlUw7iVx3jh5ee0zktN+qrz4b+18ps5jCPQ73jWWVVx6UW?= =?us-ascii?Q?6xow4q8eNILLKhbuTuC8pZGh8HWyZQ6ro88RIJtB6ZGfkZto82zKsNIwKxQf?= =?us-ascii?Q?iRIlsMQLJ1/AVLhutPv9/aXzjsprQgTPLeT7rwhnA97g2ZzpaEc0ACn5Cqzi?= =?us-ascii?Q?GKGzOWMdDTkDUB3V45pfV9mYEmx8SlndalUKwZ4NUAMNHoLbKWIj7sUl6MwK?= =?us-ascii?Q?2Ho1jbRRd+34hiO99U2Kt8n3anK0lZhq7xVeMPMbryo5N1Ik4be4xFtUMtcZ?= =?us-ascii?Q?DFPiz0QIn1W15b65DTRWXTzJBX05oKV8uyJdjcysbGuj2JpqhMr5TlgKAwxo?= =?us-ascii?Q?8UCRExb/uQVVh3ChduvYYCp6bNzDRSHKAJJhID5DK+pxUnhQ88nP5J2WWc9d?= =?us-ascii?Q?BioiW7E6v9fM6+GNMAzaEuF7+5JSMby1stR2T9vF8cPkBlRB848LR9XXAe+O?= =?us-ascii?Q?SrXOSFQIB1ElIeAbTGFP+QrcIUNhvK28JlcTbUOrsrf84hVIFdXm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psD3E98g9S3mu9WW3yCpgjnAwY06lbuuXQ2drqga1sq+hcqQDJtp5ZtijRR9/v57Zf10/CejNemn1t5NsEGw==; 5:QcDjZE/CtK9Sl5RzkqgZT6hFCpbkx94EsjuArCQLb/8vA+MlihgPOukgtuicUTrK/2hksUZnZHBCg1PBr2vWq0q1KCQHKWYZdYBXoDwzB+0qL9VbazhNExNf3OicZccfQZ6X3RXax3FwIezYHcgow3UpRAM5/QGUGODCgpzUQTI=; 24:wFpkHp1ysDHtxzgRfe6rFeMrKmSv/8DOFHxuUP1df+EsIZWVcOqzhWGBFXBQM9+vSbNzWk5FAo/pHruZITc1oIAJuWnvZ5drJzMAz/8EqA4= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; BY1PR0701MB1723; 7:MgQAQSEyey7qdwoOeOg13VYcbHhuPNwoZ4JrlWqGtPGYym3srBl1v/++ZKdPhDyz4ilJXuT1BfDcuzbGYjTtoRdXWVH4mxAYhy25JfZPex12MSIYI+b9ZcGdhVGvr0kwr4uxDk8dVICL16HIEZBrHdsez5JW8YGlKUfF3qQocJ5HaB8aLU1yZtGNL7jswZKf475W/YjvlSHrc/T/QlY6AHUfC4qa9JYyXGE4s7FbjpgG9p0cKMmPWTZBC+YpcF/YPpvRwLYcD8fPHi6EVRBycExFFZ0u2ejq+WDjbQtiiOYY/z1hujHPW9Qnzog+xE8QaM6tLcckGXEJmpjCNtS0Gg== X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 31 Mar 2017 19:37:31.0668 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY1PR0701MB1723 Subject: [dpdk-dev] [PATCH v2 29/38] test/test: octeontx flow based two stage sched type test X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 31 Mar 2017 19:37:37 -0000 Add flow based two stage pipeline test with all combination of schedule types. Signed-off-by: Jerin Jacob Acked-by: Harry van Haaren --- test/test/test_eventdev_octeontx.c | 170 +++++++++++++++++++++++++++++++++++++ 1 file changed, 170 insertions(+) diff --git a/test/test/test_eventdev_octeontx.c b/test/test/test_eventdev_octeontx.c index 059257a..d19d351 100644 --- a/test/test/test_eventdev_octeontx.c +++ b/test/test/test_eventdev_octeontx.c @@ -800,6 +800,158 @@ test_queue_to_port_multi_link(void) return TEST_SUCCESS; } +static int +worker_flow_based_pipeline(void *arg) +{ + struct test_core_param *param = arg; + struct rte_event ev; + uint16_t valid_event; + uint8_t port = param->port; + uint8_t new_sched_type = param->sched_type; + rte_atomic32_t *total_events = param->total_events; + uint64_t dequeue_tmo_ticks = param->dequeue_tmo_ticks; + + while (rte_atomic32_read(total_events) > 0) { + valid_event = rte_event_dequeue_burst(evdev, port, &ev, 1, + dequeue_tmo_ticks); + if (!valid_event) + continue; + + /* Events from stage 0 */ + if (ev.sub_event_type == 0) { + /* Move to atomic flow to maintain the ordering */ + ev.flow_id = 0x2; + ev.event_type = RTE_EVENT_TYPE_CPU; + ev.sub_event_type = 1; /* stage 1 */ + ev.sched_type = new_sched_type; + ev.op = RTE_EVENT_OP_FORWARD; + rte_event_enqueue_burst(evdev, port, &ev, 1); + } else if (ev.sub_event_type == 1) { /* Events from stage 1*/ + if (seqn_list_update(ev.mbuf->seqn) == TEST_SUCCESS) { + rte_pktmbuf_free(ev.mbuf); + rte_atomic32_sub(total_events, 1); + } else { + printf("Failed to update seqn_list\n"); + return TEST_FAILED; + } + } else { + printf("Invalid ev.sub_event_type = %d\n", + ev.sub_event_type); + return TEST_FAILED; + } + } + return 0; +} + +static int +test_multiport_flow_sched_type_test(uint8_t in_sched_type, + uint8_t out_sched_type) +{ + const unsigned int total_events = MAX_EVENTS; + uint8_t nr_ports; + int ret; + + nr_ports = RTE_MIN(rte_event_port_count(evdev), rte_lcore_count() - 1); + + if (!nr_ports) { + printf("%s: Not enough ports=%d or workers=%d\n", __func__, + rte_event_port_count(evdev), rte_lcore_count() - 1); + return TEST_SUCCESS; + } + + /* Injects events with m->seqn=0 to total_events */ + ret = inject_events( + 0x1 /*flow_id */, + RTE_EVENT_TYPE_CPU /* event_type */, + 0 /* sub_event_type (stage 0) */, + in_sched_type, + 0 /* queue */, + 0 /* port */, + total_events /* events */); + if (ret) + return TEST_FAILED; + + ret = launch_workers_and_wait(worker_flow_based_pipeline, + worker_flow_based_pipeline, + total_events, nr_ports, out_sched_type); + if (ret) + return TEST_FAILED; + + if (in_sched_type != RTE_SCHED_TYPE_PARALLEL && + out_sched_type == RTE_SCHED_TYPE_ATOMIC) { + /* Check the events order maintained or not */ + return seqn_list_check(total_events); + } + return TEST_SUCCESS; +} + + +/* Multi port ordered to atomic transaction */ +static int +test_multi_port_flow_ordered_to_atomic(void) +{ + /* Ingress event order test */ + return test_multiport_flow_sched_type_test(RTE_SCHED_TYPE_ORDERED, + RTE_SCHED_TYPE_ATOMIC); +} + +static int +test_multi_port_flow_ordered_to_ordered(void) +{ + return test_multiport_flow_sched_type_test(RTE_SCHED_TYPE_ORDERED, + RTE_SCHED_TYPE_ORDERED); +} + +static int +test_multi_port_flow_ordered_to_parallel(void) +{ + return test_multiport_flow_sched_type_test(RTE_SCHED_TYPE_ORDERED, + RTE_SCHED_TYPE_PARALLEL); +} + +static int +test_multi_port_flow_atomic_to_atomic(void) +{ + /* Ingress event order test */ + return test_multiport_flow_sched_type_test(RTE_SCHED_TYPE_ATOMIC, + RTE_SCHED_TYPE_ATOMIC); +} + +static int +test_multi_port_flow_atomic_to_ordered(void) +{ + return test_multiport_flow_sched_type_test(RTE_SCHED_TYPE_ATOMIC, + RTE_SCHED_TYPE_ORDERED); +} + +static int +test_multi_port_flow_atomic_to_parallel(void) +{ + return test_multiport_flow_sched_type_test(RTE_SCHED_TYPE_ATOMIC, + RTE_SCHED_TYPE_PARALLEL); +} + +static int +test_multi_port_flow_parallel_to_atomic(void) +{ + return test_multiport_flow_sched_type_test(RTE_SCHED_TYPE_PARALLEL, + RTE_SCHED_TYPE_ATOMIC); +} + +static int +test_multi_port_flow_parallel_to_ordered(void) +{ + return test_multiport_flow_sched_type_test(RTE_SCHED_TYPE_PARALLEL, + RTE_SCHED_TYPE_ORDERED); +} + +static int +test_multi_port_flow_parallel_to_parallel(void) +{ + return test_multiport_flow_sched_type_test(RTE_SCHED_TYPE_PARALLEL, + RTE_SCHED_TYPE_PARALLEL); +} + static struct unit_test_suite eventdev_octeontx_testsuite = { .suite_name = "eventdev octeontx unit test suite", .setup = testsuite_setup, @@ -821,6 +973,24 @@ static struct unit_test_suite eventdev_octeontx_testsuite = { test_queue_to_port_single_link), TEST_CASE_ST(eventdev_setup, eventdev_teardown, test_queue_to_port_multi_link), + TEST_CASE_ST(eventdev_setup, eventdev_teardown, + test_multi_port_flow_ordered_to_atomic), + TEST_CASE_ST(eventdev_setup, eventdev_teardown, + test_multi_port_flow_ordered_to_ordered), + TEST_CASE_ST(eventdev_setup, eventdev_teardown, + test_multi_port_flow_ordered_to_parallel), + TEST_CASE_ST(eventdev_setup, eventdev_teardown, + test_multi_port_flow_atomic_to_atomic), + TEST_CASE_ST(eventdev_setup, eventdev_teardown, + test_multi_port_flow_atomic_to_ordered), + TEST_CASE_ST(eventdev_setup, eventdev_teardown, + test_multi_port_flow_atomic_to_parallel), + TEST_CASE_ST(eventdev_setup, eventdev_teardown, + test_multi_port_flow_parallel_to_atomic), + TEST_CASE_ST(eventdev_setup, eventdev_teardown, + test_multi_port_flow_parallel_to_ordered), + TEST_CASE_ST(eventdev_setup, eventdev_teardown, + test_multi_port_flow_parallel_to_parallel), TEST_CASES_END() /**< NULL terminate unit test array */ } }; -- 2.5.5