From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM02-BL2-obe.outbound.protection.outlook.com (mail-bl2nam02on0088.outbound.protection.outlook.com [104.47.38.88]) by dpdk.org (Postfix) with ESMTP id 17E172BDF for ; Fri, 31 Mar 2017 21:37:44 +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=I93wlSK07iEWxH2wAuafNP4rimrYL4LIiXcppUvn3/s=; b=F0kG7Z/4CBPyCzFhsj2eeJ94aUt/nOB3T7mMnPu1Ry2tPVY8ZOLpCSrfc+tfOF7HsI1DQjvg4aou3UPWmP4uT8rTbRmmw3EKyvLQ2xZDQH+yjdg3GdJ+K76weUCKpQxR54A0eQ5MMXd57piuBFFeoAUIly0WzqsdNaEtVeXOEgc= 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:39 +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:58 +0530 Message-Id: <1490988905-12584-32-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: 0682fc70-4341-4645-4d38-08d4786d6634 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(201703131423075)(201703031133081); SRVR:BY1PR0701MB1723; X-Microsoft-Exchange-Diagnostics: 1; BY1PR0701MB1723; 3:38NOh++koZ8t+pgQJuyyfecAbktCzJKVsB2C1Isl5Gs9ne6+ZLiPfGtSsLyoC2GQBq6KFfOi7TSLYJJ7628LwagDOkdGDCbv7qQ1aLeXTI0tciwtVgxa7gU8VGE5J41Kcr32rX5eV/4QJcEzavjVyHpehzxMuATk1lfmn+awvLUctkWUrSa2JobFlabfd8FWBl4A+xbQdMKLK/9WNY3U0yBWWK/E6HS9/ckoPMW0Yr2KGofNZUjOACthgWsA9buRNS/YnIg49JMPALeaWorAAE9LxWDE/xDIxCtye28hghSLlWEZPeqJLFtl+yf96Cmadov8pCqL6I3kM3bE4RMglQ==; 25:boJ/DhWTgF9bQPlePB+07ABh6HnJnLXoPF6rHWWNc6EOZoYpC77XIGzFJIMs6K1qUIiD4H3BTmWfObvY7vj/QYREeM63VDeWQqE2W0av4TuNvQhsYLJ/Zc4e60F1hNmm3VfDuXoFcnTfR7TkN8S5PFul0z366JYyEUu36Btr+HSn3z295k0Q6sk1Ic/aYdVa+L3ez17HkTVvtm/K93z+hBne6SSq/pHxhXI/2vEjpo9RDhhf2Gl94J9lluk321OkGNJ15pt+kK7GiA6FO8FK2a1Or9S7VpnHXWPmqqUZPBXjPzgI+ZROlBgzzX0t5APK3XrvYMXzlUDBRFQw9KLJLxLMeXuu3dWP5SOL+uBULqJ12rACZtLn+LuF6lxbqfmbqTW1NDrRWAS9Kx8M4NaX0T/bvlTXWWQ3HoCBYR2dQ9C6/buKtgbKQtAV1L3/FQ9VlwYxStolyfqHV9Ai+AVjKg== X-Microsoft-Exchange-Diagnostics: 1; BY1PR0701MB1723; 31:fYFVfECfBpmquo9ifLBFl15r8bK54+lg5qggpyH31zrLTWcv+TkZIWgLX3xn7BrBwvEoLnVIf1XIEgDgvVfgPL8EQv1JgIiaONb39rvD9N52y+4+g0dYanPbifjDgdd2cB6OQrC1OC3aEX5OXp4pRWHHZr24tQWjCaDZps97Fzbf3PCdhv7Z/AWD+gXQVEecbNr/evYKpSI520V4K+PyCDkPowA5vzL92ya9ooJ2AKM=; 20:eOSLthc5+tSEsCoy7WU1u25EXesPJGcba8tzbwgBOAqwXWfqXupu2crwUR1Q4SAEo/9IpqvC/D7yjlKWAgCcnVZiwySs26ZMXkYvgJ73a6D28BNHvBvsCJPTvB5C+Q2v6RYEAtOUKFoe2chQ/BUMlXrPBoTTW/EkTZUyzM12eKu/fXYxgvgSwn0t7ijQx/fCqadKwJuxsoJQBshByCDFOrRMWMQgi3K2n/zSbwpmWc8XsXgvlRMeHDa4O5LOoA2geYuvCJq/CjNWmwgvfDJDgCY5g6HeYUApQTNU+YGJwJ2xin6yxL70y6IBaO+eQEtqkMeDi87VykBSvvObbMWlJMntg6aKjUh2K75T+dAY+Y/v8MLWC1t2daZfErB9FZzvujwMZGR7X6QfxYIS/QubxTedmDoz75MEmMBHnptsbB0/3tL39BByWQ0k1YMF7B9S0Kq260SVkGIKXbbz/U+gqpEArdhxBLJwwgsGNHnyZpqf0VLj6sYSSEu/nBaBM+MK6mK9UeLg072eIgtohye3/QhZLyIq/C8KLb1Ujba1OxoTClLYTX8WDjZ4V3VHVGjqxnz8t7rSdiW35xVRhBSPeLmpPgHeYWRVXeFLqkCJxr8= 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:PfXvHpprTz5exUb/dMdbQ4457SSPRduBpmFBDr237D5F+Lv2uER/2Vf7S47837pf4C4Hp9jR17obs4XiJybSjv8hBxZKc+c6hZ6Eu2hl8lw2Fxfrczf5uW+cQib1h0kRafsum9bSDkFiaT5cdOQ3sbqFSjywzLHaDFdMviFpaipu2vgjeX+ppf6X6hGehZPMlKyAS/OOBkeSm3meRJU8/cSRXdwnSuIEWvnrF92q3oIn6l2R2fcpBpIbd2plDwvA9+TY+XIqJZ1urEX8uLAOuvNOp9K+q867CvrTqSnE2vgfxqTPRNnS2EYIXqYABbsnTmQQl4vTDIPhbmXhUG7AburA47sxt2vlJNzIMMwFLtoUHt9G+p5tMKBRrZt0brTVIpaGRvnDqWOI7l1wMQgTbnoTCdxrsawb/13Sh/kwUn/h0KfSlDEH0fXqAql3KoOsbwUPGO2mXlhmLJQ0BrH6+zuOXP9T54yB6HMoFDsa/qRP13IvW2KWrgD/g9v/z0zHKcZQEHAbBC6wadRNXy4NhrOTuKKF11owMTh/QPSoM3fkNEX/RfMhynKgiMNM7aM5UWjf2FoQtx5B3fqJ79PAGwbA7Tknd92U1fDkMUWt1cVSu6SaTydlbvOFtB7C5ZHGginaSzmg6v2dW8ZnDVSvQ/o6hGlSez7R7ZPWQQz25aRVAdObG2+W9/CXUXQxgHabcKk0YlCrv9dURu6NwhIKNHVFh67IyVT2nslUW429yhcDoGuaObVQ47LefIobzgz0 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)(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:QXBpwnedYZqoxIj+sZ02VjnBveqVTe07ePU9kxZ?= =?us-ascii?Q?AfQAfhQIpWgLJLPFPDDdibpGh5Rt9JhY6I6FU130Yv74kSdynQpy9njJdr1B?= =?us-ascii?Q?Qt6iFWxYYjgCZ1lPWxSysrCqwQSFidu8iGHDHkyty21oDCXN5FsgMUybwBjm?= =?us-ascii?Q?fTQRiLCDA/yF9igxXThiox46JOQzL2MIN5ZeCIxB+IA9Xw3/2qMzlzutmUs+?= =?us-ascii?Q?O139wq0dGSYgpXHs5xz/1D5o99FJ0zerqDSx9jYqtXBZhV6yCTuY/L3dHbSA?= =?us-ascii?Q?Utz3U4hD7MLBHA3HbkrjyEKKZK/PT790iaXPJ7W0eNL7SUog5EafMQwbjiN2?= =?us-ascii?Q?rTyMq2CZjhHV1y6RNFDpR9WXhzAmeefrutgWfJuyTznfYGVqZ1GRgNomeGYp?= =?us-ascii?Q?0xUgsFav89OwF5pO5W1KCa5JcPR4cSbyh2DtVx4pZVFpXhucjlNCDnBrtiyt?= =?us-ascii?Q?Aa5ktbKaVMILuP6NrTJig7TIAjrcmwsIhTm9KVTh2u5BGoPDDT2YfCsnKIT9?= =?us-ascii?Q?njCiDIWjMjzrEyyI21eWa0OUXBRTl1pgl+wJcTTpnU3UAHVE6skMhM1fJeNI?= =?us-ascii?Q?k6XIOxAOMMzfDGxy+8huyqJnFyiaJthVJE5bxMXPuYHaBaRt89OQGcRBAylR?= =?us-ascii?Q?fM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Klem+Zy1laOJYmEPT3TSR0cGE+bzFCdP55iRDYqB1QeOAnrfvcsfwFWoCZwgAvz7G+7g==; 5:LSEyMRomy4J3AgjItVTI7GCXwywJpXzC3ZTu8Z0LSWwxG8L3WWeHLG/DDWmUXuqJV8hqa/VKLN5ln5ZFBJ/6uWxNpJYOqxcv6fYb4xehoVh4f55hFhmBqnuoMS2GvEp1ba1+7i6qeC2GOG6m7gZQPKQ63CXnykYwYJUyEVGFA90=; 24:ydcG4Cel2wPkT3MA0TKSIfmWpexZ/nOLkA4p1AVexHg7x7NqweySAsqVeHr0ZIz1Ocli8xreWui3hEpzTeGLyNEQ3S+nW2ozM1stDXFMTgA= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; BY1PR0701MB1723; 7:rMCbdLjMJ98sdPEKznNn3W/moN6QI/1n22+4gklYzSdvuM4Fs0gyMRVQaXNLAmiMwFK9gCGh2SYRR5ToWzIIrpy6xxBFWju+5LfLEPApPmdkc286s9kF3fPZeBwfrYzIQaPzvZ5eNNY5KAd7P30KYU9NkOD4gXOd4FJDhLTr5Loa48Bh+04Np1NWU4pAyuRyFjvMWY8qXCE4nj8u2n5eP+kTx8Dyz3exT/Qsg4hrRi9rMYZCLKUTl9xTGJtfAuUPhymjdv5zQcKulhegI/7nqkSzg9peTuJRvBwb48L4ede2TEQaLMBWxIPTMjkHUZfUMVMf+SR/a8WWtO6G3WVw7g== X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 31 Mar 2017 19:37:39.2552 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY1PR0701MB1723 Subject: [dpdk-dev] [PATCH v2 31/38] test/test: octeontx flow based maximum stage pipeline 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:45 -0000 Add flow based pipeline test with maximum number of stages available in the device. Signed-off-by: Jerin Jacob Acked-by: Harry van Haaren --- test/test/test_eventdev_octeontx.c | 70 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 70 insertions(+) diff --git a/test/test/test_eventdev_octeontx.c b/test/test/test_eventdev_octeontx.c index 06ac409..d7eb6de 100644 --- a/test/test/test_eventdev_octeontx.c +++ b/test/test/test_eventdev_octeontx.c @@ -1103,6 +1103,74 @@ test_multi_port_queue_parallel_to_parallel(void) return test_multiport_queue_sched_type_test(RTE_SCHED_TYPE_PARALLEL, RTE_SCHED_TYPE_PARALLEL); } + +static int +worker_flow_based_pipeline_max_stages_rand_sched_type(void *arg) +{ + struct test_core_param *param = arg; + struct rte_event ev; + uint16_t valid_event; + uint8_t port = param->port; + rte_atomic32_t *total_events = param->total_events; + + while (rte_atomic32_read(total_events) > 0) { + valid_event = rte_event_dequeue_burst(evdev, port, &ev, 1, 0); + if (!valid_event) + continue; + + if (ev.sub_event_type == 255) { /* last stage */ + rte_pktmbuf_free(ev.mbuf); + rte_atomic32_sub(total_events, 1); + } else { + ev.event_type = RTE_EVENT_TYPE_CPU; + ev.sub_event_type++; + ev.sched_type = + rte_rand() % (RTE_SCHED_TYPE_PARALLEL + 1); + ev.op = RTE_EVENT_OP_FORWARD; + rte_event_enqueue_burst(evdev, port, &ev, 1); + } + } + return 0; +} + +static int +launch_multi_port_max_stages_random_sched_type(int (*fn)(void *)) +{ + 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) */, + rte_rand() % (RTE_SCHED_TYPE_PARALLEL + 1) /* sched_type */, + 0 /* queue */, + 0 /* port */, + MAX_EVENTS /* events */); + if (ret) + return TEST_FAILED; + + return launch_workers_and_wait(fn, fn, MAX_EVENTS, nr_ports, + 0xff /* invalid */); +} + +/* Flow based pipeline with maximum stages with random sched type */ +static int +test_multi_port_flow_max_stages_random_sched_type(void) +{ + return launch_multi_port_max_stages_random_sched_type( + worker_flow_based_pipeline_max_stages_rand_sched_type); +} + static struct unit_test_suite eventdev_octeontx_testsuite = { .suite_name = "eventdev octeontx unit test suite", .setup = testsuite_setup, @@ -1160,6 +1228,8 @@ static struct unit_test_suite eventdev_octeontx_testsuite = { test_multi_port_queue_parallel_to_ordered), TEST_CASE_ST(eventdev_setup, eventdev_teardown, test_multi_port_queue_parallel_to_parallel), + TEST_CASE_ST(eventdev_setup, eventdev_teardown, + test_multi_port_flow_max_stages_random_sched_type), TEST_CASES_END() /**< NULL terminate unit test array */ } }; -- 2.5.5