From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM03-DM3-obe.outbound.protection.outlook.com (mail-dm3nam03on0072.outbound.protection.outlook.com [104.47.41.72]) by dpdk.org (Postfix) with ESMTP id 216947CB5 for ; Sun, 28 May 2017 22:01:28 +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=TRmIB6r/CN+NnrjkdK6aDj4amNLUv62lyhU2hZhxM/U=; b=RA+jITXDrapKlIqRQ4F+vjWxJN87KBsXtMgk69ddB0zn7fO3OohWRgq+KsppTKRltYuHFdaeHH6cRuv5oM0j7ac4G6I9mHP4pukEIfZs1Tj0dYFGM2Knusj9RWbO5lTNgHBQjvktTGOp8xULqW0pDDz1ViCWRyediRtJZJqJLvU= Authentication-Results: dpdk.org; dkim=none (message not signed) header.d=none;dpdk.org; dmarc=none action=none header.from=caviumnetworks.com; Received: from jerin.domain.name (111.93.218.67) by CY1PR0701MB1725.namprd07.prod.outlook.com (10.163.21.14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1124.9; Sun, 28 May 2017 20:01:23 +0000 From: Jerin Jacob To: dev@dpdk.org Cc: bruce.richardson@intel.com, harry.van.haaren@intel.com, hemant.agrawal@nxp.com, gage.eads@intel.com, nipun.gupta@nxp.com, narender.vangati@intel.com, nikhil.rao@intel.com, gprathyusha@caviumnetworks.com, Jerin Jacob Date: Mon, 29 May 2017 01:28:39 +0530 Message-Id: <20170528195854.6064-19-jerin.jacob@caviumnetworks.com> X-Mailer: git-send-email 2.13.0 In-Reply-To: <20170528195854.6064-1-jerin.jacob@caviumnetworks.com> References: <20170528195854.6064-1-jerin.jacob@caviumnetworks.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [111.93.218.67] X-ClientProxiedBy: BMXPR01CA0003.INDPRD01.PROD.OUTLOOK.COM (10.174.214.141) To CY1PR0701MB1725.namprd07.prod.outlook.com (10.163.21.14) X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CY1PR0701MB1725: X-MS-Office365-Filtering-Correlation-Id: 0be41bae-d488-41be-a65f-08d4a6045367 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(201703131423075)(201703031133081); SRVR:CY1PR0701MB1725; X-Microsoft-Exchange-Diagnostics: 1; CY1PR0701MB1725; 3:N5ahIBSpWiSz6wXxFP4E5dYddcdf0rsnE+7ARedIUnm1O5PB/ZzPP5AMUKbRRjK8j5r4Y+2PnpVYMJ+uuTBpwAmIUrOJbL7jgarw1sJPGEyOnrmJZD7rCWVazxV8ZvoUeYud+TbQl4kxSnY7YuQxjhESQPMWkP0iPkL2VJnnL0psmusnFVZGQKOjbRWYoNUq1wiU5Gr4wUufjQ8O06gM/RBR1IklOlf0TRfgKHWY+/Gx6WN1M5w8lHByGmCiDqYe678SL1S+kh6tjNvJZ1reweK8OGSZc7gQsW6NJ0DCAbaxoJJ+rhRomWsjITmj0tYizO6Ti2tdDOzwISWV36MDLw==; 25:Q7Z2QlYyeS7aQerpCv6uJ5upe3mBDmV6Lc7MV/4BiJ+ctxyYQXeOr+2LboIUBlP4qwP/VDn+aCghTSaI8pz+q/qEornsD/5Bjh2ymy+K3VRZNAD7KCbTey+OoADIJeaAdDPv7ZZlGA79wzQXDsJ5Dui727fSr9x9cYAgzLiyzpn+iAs/mpBOIx60VrQ03KAyK4RRFupVKvFhmB1rFBx0DEpL01zstSj7O106F2DwfHZfif7WL0nZrV74z2ncGEiWeFzWGtU7gbmAmCPOXL874H7iUMgbUrkVIRbe10Eqil8PQtv/xCClaRqdlrykruV3CUTvjkyFHN3R7uFvvDVIcXMhovv9p766AJoUjVyhDe+ovKTV83slE/BlYwMyxm/1gvK2CYkFlGKinRDldL2X7W5lEbNdDN+gbHs+WaNNh30Znbmtjkx8ci/OyxqL0z3HBsLeU39cvD6U3zLNJJwlCa4dXzTn6v1yL8uqh2sJM7A= X-Microsoft-Exchange-Diagnostics: 1; CY1PR0701MB1725; 31:89W1igCz/Alx58IVmPRGeVNgkTXX8Msw6nGwLbe4ZOUsRcdy9N0PLT7BS15LGibRl4x+lr1dv68tM8MUXF3YtT4Wnn/GTgLWSoO6ZBruEX2zybqKstpuEVAwngGXhqwiWjEAJHC3JAlqYVcbu8nZiU9szn2j+MKDDR5EAcRs9LIMYR/0Wvwyip3h2OLDLstoMPReBFEZRXuT9U+raSbtEt/3FOSAUHwvJ7ztHaym3VM=; 20:nPyOczZYZOGpT/243t6PbXTv2TthDtOl1EIvzMEgN8QBvMJ9iE1T5gUS2cryxsdU4pf3gLEgFKlx7Fm2sso6rfq0J5pU9rxlHUlY9mcltlZI7Iv800OdBxCmAFTcnFjJT42Npb1E5QnGHU7JUdN9/Mj9iadz49JTije8yiU1AB7jK81qY5x6C12nY3zabaZkoXbnXa6tI39inxy2aiABP8m/jIjBYsY1l2ffGUgpr0gnsCUER0Vic05JIPq+k7+ayVCVI7J4BeXjTmjDvZDlXlBPZFWieav5TmJcvhol418pA3m9Csoq1UrPPYXGGDZy2dtzHm4BJopnswv20nhEZchU8nhaMpv7HL2kqhjovHi8d38A/5nokNQZBLEvHz7xlhO32+xJgx24viJkHPeu0TCL1P5aYuvNHjKkNtc4BKSDi6DEcxtXwWWeljht/76Dw/vjrFvQtohJDJnKt6Znvt7sfno3omBY1rQ/R02S9DcmG9ALyNQGLFCqtLYaKDW08mZqHSv+396g/RFNL5lgj04ib4I/3PXs2xCUh72XuPiGNcVJXpGQu2yLOBiikJoqehR9voheR7Q5RknwC4liubzayf1tL6cn7ma3O/MbQxI= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(100000700073)(100105000095)(100000701073)(100105300095)(100000702073)(100105100095)(6040450)(601004)(2401047)(5005006)(8121501046)(3002001)(10201501046)(93006095)(100000703073)(100105400095)(6041248)(20161123562025)(20161123555025)(20161123560025)(20161123564025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123558100)(6072148)(100000704073)(100105200095)(100000705073)(100105500095); SRVR:CY1PR0701MB1725; BCL:0; PCL:0; RULEID:(100000800073)(100110000095)(100000801073)(100110300095)(100000802073)(100110100095)(100000803073)(100110400095)(100000804073)(100110200095)(100000805073)(100110500095); SRVR:CY1PR0701MB1725; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; CY1PR0701MB1725; 4:mWb9ccg1PJ6f0xee2qbsJ/xFa/X04FCNClCj0EPA?= =?us-ascii?Q?BO7YASk067ZcC35yA4awQtWTuUx33fzwOQ4lvQjGS7AKwMT9l/NT3M3+HMbn?= =?us-ascii?Q?TKjD/Dk45cmagUyu8xTu0XsYxveScBnhioSeyWVVu+WclHzW5L2VBiupmcK5?= =?us-ascii?Q?gf1K2F2ivAmUGKVTVXI1a4cYjlofdy6fI3Ol+XiKOOUXPoZTvt9aaTtbH6Kz?= =?us-ascii?Q?xabMYr2T8qltLkFOMwdPiK4i69eG7UTSkvH8RSP8IYwJYJxJlRHLfmCvpCa+?= =?us-ascii?Q?HuZwn97HIB5/Fb3VUmgsBPsNDb4NCLP4/PjdHFdM5x98bBEtaSPjXPubFjoI?= =?us-ascii?Q?/15jiYFO7ySDF8Nti8/zNbdWK0gjI0Vbd+1kiA5sIjv8w1Uizwu38W6hdTYM?= =?us-ascii?Q?dp0hg7B55uxzPxW+ws9DeiVhRKchj3j91Py0RDU7X6/b98lkQnAfb2CHc+1B?= =?us-ascii?Q?8bXoSfW1gjCZkrbW5RyFNIhMOKEWGPANPM35vM8AisTGkoD3RA51lChXfJQT?= =?us-ascii?Q?kay7tTrMuh5G8o11UmZNB5VzhQ3GlEgc8uQAMvxxsKUKT0wtgbzxAHuZwFPg?= =?us-ascii?Q?MkC1lOJYNcpfrb8/G2iF/xqDwJ4u0wuGzhGVK7sOARm/mV6uLStv9OMTvsSv?= =?us-ascii?Q?SRKm8nbUUIgNRp7FKAOPXoIGjJUrebBQF03yFyIPyUE2RTrXjw9j3KYW+gEP?= =?us-ascii?Q?t4bETij6BmEWESozLthWu1aWiJER0E9QZgF2UpFQhz0qxKy/Qxymo2zUWS8g?= =?us-ascii?Q?dBFl8aV1Td/fNIClD6aV58MJyv05NnwmKf4wfUVHv9hSPtvbMNt03u5YAnt3?= =?us-ascii?Q?onjlo+d8gTaKBXuB1jDx1ucwTjuOjfxzFQrttZCacJ7NVWQBCoBE5DtktDey?= =?us-ascii?Q?2mQKQlIy361zjl24fhWc2mQF1Ge8//baOCF7i5rHhGvIojnZOj6DvM2rRIUU?= =?us-ascii?Q?loXDKp6dsahdkOLJql/U9f0UBHvR12Sh+hhMzjeYU4DDYritV2XiTNMFbEJf?= =?us-ascii?Q?/afI8jSZhXQDTKZbdJNchBu0OovQRtYjWJwXP/bkBXSPWp2uuTGE+il5kVGR?= =?us-ascii?Q?ixD+kfXYdqfP5VajiQM64uNUc1ZnaOIrrK6wb1QrMM1lDrSNDFpRaMxb9Mcc?= =?us-ascii?Q?+NpR9Y1YdXA=3D?= X-Forefront-PRVS: 03218BFD9F X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4630300001)(6009001)(39450400003)(39850400002)(39410400002)(39840400002)(39400400002)(81166006)(6486002)(966005)(66066001)(4326008)(50986999)(76176999)(50226002)(189998001)(6306002)(72206003)(53376002)(36756003)(6506006)(38730400002)(5003940100001)(5009440100003)(110136004)(107886003)(42186005)(53416004)(7736002)(8676002)(48376002)(50466002)(1076002)(3846002)(6116002)(6512007)(2361001)(305945005)(2906002)(6666003)(478600001)(25786009)(5660300001)(2351001)(6916009)(42882006)(2950100002)(33646002)(8656002)(47776003)(53936002)(562404015)(563064011); DIR:OUT; SFP:1101; SCL:1; SRVR:CY1PR0701MB1725; H:jerin.domain.name; FPR:; SPF:None; MLV:sfv; LANG:en; X-Microsoft-Exchange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e3RiMPFregxjrX7vA2QSa0J6K8RLs9qJEmnO9DonMNs5XBHQucrM+KvIbTWTsOVrG3Kg0qVMmJvSEhdBbwvn83wE7FvOD8yWaFOUqC2DOp6GhcNM5MYg== X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 May 2017 20:01:23.7904 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY1PR0701MB1725 Subject: [dpdk-dev] [PATCH 18/33] app/testeventdev: add order "all types queue" 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: Sun, 28 May 2017 20:01:29 -0000 This test verifies the same aspects of order_queue test, The difference is the number of queues used, this test operates on a single "all types queue"(atq) instead of two different queues for ordered and atomic. Example command to run order all types queue test: sudo build/app/dpdk-test-eventdev --vdev=event_octeontx --\ --test=order_atq --plcore 1 --wlcores 2,3 Signed-off-by: Jerin Jacob --- app/test-eventdev/Makefile | 1 + app/test-eventdev/test_order_atq.c | 232 +++++++++++++++++++++++++++++++++++++ 2 files changed, 233 insertions(+) create mode 100644 app/test-eventdev/test_order_atq.c diff --git a/app/test-eventdev/Makefile b/app/test-eventdev/Makefile index 37c04c294..93c36e510 100644 --- a/app/test-eventdev/Makefile +++ b/app/test-eventdev/Makefile @@ -45,5 +45,6 @@ SRCS-y += parser.c SRCS-y += test_order_common.c SRCS-y += test_order_queue.c +SRCS-y += test_order_atq.c include $(RTE_SDK)/mk/rte.app.mk diff --git a/app/test-eventdev/test_order_atq.c b/app/test-eventdev/test_order_atq.c new file mode 100644 index 000000000..2d9f05527 --- /dev/null +++ b/app/test-eventdev/test_order_atq.c @@ -0,0 +1,232 @@ +/* + * BSD LICENSE + * + * Copyright (C) Cavium 2017. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Cavium nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include +#include + +#include "test_order_common.h" + +/* See http://dpdk.org/doc/guides/tools/testeventdev.html for test details */ + +static inline __attribute__((always_inline)) void +order_atq_process_stage_0(struct rte_event *const ev) +{ + ev->sub_event_type = 1; /* move to stage 1 (atomic) on the same queue */ + ev->op = RTE_EVENT_OP_FORWARD; + ev->sched_type = RTE_SCHED_TYPE_ATOMIC; + ev->event_type = RTE_EVENT_TYPE_CPU; +} + +static int +order_atq_worker(void *arg) +{ + ORDER_WORKER_INIT; + struct rte_event ev; + + while (t->err == false) { + uint16_t event = rte_event_dequeue_burst(dev_id, port, + &ev, 1, 0); + if (!event) { + if (rte_atomic64_read(outstand_pkts) <= 0) + break; + rte_pause(); + continue; + } + + if (ev.sub_event_type == 0) { /* stage 0 from producer */ + order_atq_process_stage_0(&ev); + while (rte_event_enqueue_burst(dev_id, port, &ev, 1) + != 1) + rte_pause(); + } else if (ev.sub_event_type == 1) { /* stage 1 */ + order_process_stage_1(t, &ev, nb_flows, + expected_flow_seq, outstand_pkts); + } else { + order_process_stage_invalid(t, &ev); + } + } + return 0; +} + +static int +order_atq_worker_burst(void *arg) +{ + ORDER_WORKER_INIT; + struct rte_event ev[BURST_SIZE]; + uint16_t i; + + while (t->err == false) { + uint16_t const nb_rx = rte_event_dequeue_burst(dev_id, port, ev, + BURST_SIZE, 0); + + if (nb_rx == 0) { + if (rte_atomic64_read(outstand_pkts) <= 0) + break; + rte_pause(); + continue; + } + + for (i = 0; i < nb_rx; i++) { + if (ev[i].sub_event_type == 0) { /*stage 0 */ + order_atq_process_stage_0(&ev[i]); + } else if (ev[i].sub_event_type == 1) { /* stage 1 */ + order_process_stage_1(t, &ev[i], nb_flows, + expected_flow_seq, outstand_pkts); + ev[i].op = RTE_EVENT_OP_RELEASE; + } else { + order_process_stage_invalid(t, &ev[i]); + } + } + + uint16_t enq; + + enq = rte_event_enqueue_burst(dev_id, port, ev, nb_rx); + while (enq < nb_rx) { + enq += rte_event_enqueue_burst(dev_id, port, + ev + enq, nb_rx - enq); + } + } + return 0; +} + +static int +worker_wrapper(void *arg) +{ + /* FIXME: probe through device capability */ + const bool burst = 1; + + if (burst) + return order_atq_worker_burst(arg); + else + return order_atq_worker(arg); +} + +static int +order_atq_launch_lcores(struct evt_test *test, struct evt_options *opt) +{ + return order_launch_lcores(test, opt, worker_wrapper); +} + +#define NB_QUEUES 1 +static int +order_atq_eventdev_setup(struct evt_test *test, struct evt_options *opt) +{ + int ret; + + const uint8_t nb_workers = evt_nr_active_lcores(opt->wlcores); + /* number of active worker cores + 1 producer */ + const uint8_t nb_ports = nb_workers + 1; + + const struct rte_event_dev_config config = { + .nb_event_queues = NB_QUEUES,/* one all types queue */ + .nb_event_ports = nb_ports, + .nb_events_limit = 4096, + .nb_event_queue_flows = opt->nb_flows, + .nb_event_port_dequeue_depth = 128, + .nb_event_port_enqueue_depth = 128, + }; + + ret = rte_event_dev_configure(opt->dev_id, &config); + if (ret) { + evt_err("failed to configure eventdev %d", opt->dev_id); + return ret; + } + + /* q0 all types queue configuration */ + struct rte_event_queue_conf q0_conf = { + .priority = RTE_EVENT_DEV_PRIORITY_NORMAL, + .event_queue_cfg = RTE_EVENT_QUEUE_CFG_ALL_TYPES, + .nb_atomic_flows = opt->nb_flows, + .nb_atomic_order_sequences = opt->nb_flows, + }; + ret = rte_event_queue_setup(opt->dev_id, 0, &q0_conf); + if (ret) { + evt_err("failed to setup queue0 eventdev %d", opt->dev_id); + return ret; + } + + /* setup one port per worker, linking to all queues */ + ret = order_event_dev_port_setup(test, opt, nb_workers, NB_QUEUES); + if (ret) + return ret; + + ret = rte_event_dev_start(opt->dev_id); + if (ret) { + evt_err("failed to start eventdev %d", opt->dev_id); + return ret; + } + + return 0; +} + +static void +order_atq_opt_dump(struct evt_options *opt) +{ + order_opt_dump(opt); + evt_dump("nb_evdev_queues", "%d", NB_QUEUES); +} + +static bool +order_atq_capablity_check(struct evt_options *opt) +{ + struct rte_event_dev_info dev_info; + + rte_event_dev_info_get(opt->dev_id, &dev_info); + if (dev_info.max_event_queues < NB_QUEUES || dev_info.max_event_ports < + order_nb_event_ports(opt)) { + evt_err("not enough eventdev queues=%d/%d or ports=%d/%d", + NB_QUEUES, dev_info.max_event_queues, + order_nb_event_ports(opt), dev_info.max_event_ports); + return false; + } + + if (!evt_has_all_types_queue(opt->dev_id)) + return false; + + return true; +} + +static const struct evt_test_ops order_atq = { + .cap_check = order_atq_capablity_check, + .opt_check = order_opt_check, + .opt_dump = order_atq_opt_dump, + .test_setup = order_test_setup, + .mempool_setup = order_mempool_setup, + .eventdev_setup = order_atq_eventdev_setup, + .launch_lcores = order_atq_launch_lcores, + .eventdev_destroy = order_eventdev_destroy, + .mempool_destroy = order_mempool_destroy, + .test_result = order_test_result, + .test_destroy = order_test_destroy, +}; + +EVT_TEST_REGISTER(order_atq); -- 2.13.0