From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM02-BL2-obe.outbound.protection.outlook.com (mail-bl2nam02on0074.outbound.protection.outlook.com [104.47.38.74]) by dpdk.org (Postfix) with ESMTP id 3B7D11B286 for ; Wed, 10 Jan 2018 15:52:43 +0100 (CET) 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=RnVapd7FV246MAoWhXXRq8aftHmbMRnzvCoEj/ar9ag=; b=Qhj4OwHdvMY5GKEfSFY2yvoz0RYng95eI+4IuqHMUy1geF6Glo7qq4Qp/88jJhzxAKqMQpn6uYR/q/SiVRj60zKw3OpvUV9n1TvyPoCSAVgMj/dMpkgceZJMhEIu5mwkE5KOC9GOYzEki49OMPrp+1ZCWiW3piPUbbfXpuM2lqA= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Pavan.Bhagavatula@cavium.com; Received: from Pavan-LT.caveonetworks.com (111.93.218.67) by DM5PR07MB3466.namprd07.prod.outlook.com (10.164.153.21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.386.5; Wed, 10 Jan 2018 14:52:38 +0000 From: Pavan Nikhilesh To: jerin.jacob@caviumnetworks.com, santosh.shukla@caviumnetworks.com, harry.van.haaren@intel.com, gage.eads@intel.com, hemant.agrawal@nxp.com, nipun.gupta@nxp.com, liang.j.ma@intel.com Cc: dev@dpdk.org, Pavan Nikhilesh Date: Wed, 10 Jan 2018 20:21:40 +0530 Message-Id: <20180110145144.28403-8-pbhagavatula@caviumnetworks.com> X-Mailer: git-send-email 2.14.1 In-Reply-To: <20180110145144.28403-1-pbhagavatula@caviumnetworks.com> References: <20171130072406.15605-1-pbhagavatula@caviumnetworks.com> <20180110145144.28403-1-pbhagavatula@caviumnetworks.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [111.93.218.67] X-ClientProxiedBy: BN6PR16CA0009.namprd16.prod.outlook.com (10.172.212.147) To DM5PR07MB3466.namprd07.prod.outlook.com (10.164.153.21) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: f472b185-c53e-43c5-9e8b-08d55839cceb X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(4534020)(4602075)(4627115)(201703031133081)(201702281549075)(5600026)(4604075)(2017052603307)(7153060)(7193020); SRVR:DM5PR07MB3466; X-Microsoft-Exchange-Diagnostics: 1; DM5PR07MB3466; 3:zVIjbhg0BjvbDuKFNJbKY8D9wUEj/M+Zt3ClziZuEupJ3FR1G3Pry6ZDTs6vrIFLte8Zp5JGbiFJuH8kXjkGp7Wit1WjmPvi3HmJ+/io2G63NPZpg4hRQmX9DLF8xAANB66EfiPg26PQU3xw7u0TAnUbBf87kyUAHRNff2k/RMXuHr7Sau0yrZY0+jsQj6BMy6i5cS6H0sx4yXTOyB5bFa3F1jK4i88pzrRSXbI5NtC1yBmaD9g5QcruFnhkZMjI; 25:PULtFIOfwbsI2qUmADgtLzRUHHrKyvnw7YQgbdxuRKZN8wIKZPDztopdndPwd9CoQhGcV1PTIE65lx/kVKs6tiMZ+AdByWpgUv7gUOQYF7nlDuSujQCHmAQ0kth/ceapVm2xasScUtZspYOAcidD7cyRSNJg02tlhbzh4hcXKBE3+N/lmSoQGsSOIym9ulVn6mWuxF5jvIGWh/XKFvSnJpxZCdzQHrpGcqaNNv/5Ll62Ve07E8dLvit9r4bd27oaQzyXEoSD6JBPWVcdVsvmp3+EgFmrq2ntMRZbMjuWYzMQgEh/85feLj7jCN6lLklFXG7IWDpp3G3/TIuZ9lHKJg==; 31:z3WDeOi9i7pysUDk3q+YivQZ4I6fe54+iTj7gWY9xLlS+GN9Y2CADjUV5+pbops1rK07qyrMC7MMf8UD1hNrYU+c4hYXGiyw6msdXbllXclh0Y/AdAM+xH9iFTayPXMCy29oiqxJxTUbKEulYcO64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: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040470)(2401047)(5005006)(8121501046)(10201501046)(3002001)(93006095)(3231023)(944501075)(6041268)(20161123560045)(20161123564045)(20161123558120)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123562045)(6072148)(201708071742011); SRVR:DM5PR07MB3466; BCL:0; PCL:0; RULEID:(100000803101)(100110400095); SRVR:DM5PR07MB3466; X-Forefront-PRVS: 0548586081 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(39860400002)(346002)(366004)(376002)(396003)(39380400002)(199004)(189003)(76176011)(25786009)(53376002)(107886003)(4326008)(6666003)(2950100002)(106356001)(42882006)(8656006)(8676002)(59450400001)(105586002)(53936002)(6486002)(52116002)(53416004)(6512007)(50466002)(47776003)(5009440100003)(19273905006)(305945005)(68736007)(6306002)(51416003)(386003)(6506007)(966005)(69596002)(36756003)(72206003)(2906002)(16586007)(50226002)(316002)(478600001)(7736002)(48376002)(3846002)(1076002)(6116002)(5660300001)(66066001)(16526018)(81166006)(97736004)(81156014)(8936002)(562404015)(42262002)(563064011); DIR:OUT; SFP:1101; SCL:1; SRVR:DM5PR07MB3466; H:Pavan-LT.caveonetworks.com; FPR:; SPF:None; PTR:InfoNoRecords; A:1; MX:1; LANG:en; Received-SPF: None (protection.outlook.com: cavium.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; DM5PR07MB3466; 23:KIhUlDq1hgQt4EqwGv0QnJPfA8yHu1EaiPod2Id6X?= =?us-ascii?Q?s93yUysVxyoszUflEmgQ+DndraXm6h5PSxbO6naiS5K3RxnP5fnJXkkVkDN7?= =?us-ascii?Q?Lm/hWYIv8bZbQjExfFW+wkQ4CNRDVzkefG8Q6OMz/tFOxmxyXc3WxaHWGzZE?= =?us-ascii?Q?kQui5POOQUprmfLufVWBq8ckrhr8DM8wgbt1+t/sPJXahAx4SIm4/oD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JaM7dFL60yD6sQcM5dUHLOhupBhGpckzaGyenpAQIKMhO48n3PMyKxYlI5OkFM5XiPLwSNa1Snfa1oemcaD64gI9Nf36tPEIC3P9jnYhATlkKs3teI4jADTKSJRFdKBpE2hGEBJBwB0Cd+7vLH5tI+crYMxuN3Gn53VDyd6V8BPPMVacNjlVkCMZvAsNOVLVoMFViueyQhR8oiYYkJKdUODHJiQtZL4zX42HbF/9bdT6Xkzbk0UBhIuXzKc2nHb SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Jan 2018 14:52:38.1541 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: f472b185-c53e-43c5-9e8b-08d55839cceb X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 711e4ccf-2e9b-4bcf-a551-4094005b6194 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR07MB3466 Subject: [dpdk-dev] [PATCH v3 08/12] app/eventdev: add pipeline 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: Wed, 10 Jan 2018 14:52:44 -0000 This is a pipeline queue test case that aims at testing the following: 1. Measure the end-to-end performance of an event dev with a ethernet dev. 2. Maintain packet ordering from Rx to Tx. The pipeline queue test configures the eventdev with Q queues and P ports, where Q is (nb_ethdev * nb_stages) + nb_ethdev and P is nb_workers. The user can choose the number of workers and number of stages through the --wlcores and the --stlist application command line arguments respectively. The probed ethernet devices act as producer(s) for this application. The ethdevs are configured as event Rx adapters that enables them to injects events to eventdev based the first stage schedule type list requested by the user through --stlist the command line argument. Based on the number of stages to process(selected through --stlist), the application forwards the event to next upstream queue and when it reaches last stage in the pipeline if the event type is ATOMIC it is enqueued onto ethdev Tx queue else to maintain ordering the event type is set to ATOMIC and enqueued onto the last stage queue. On packet Tx, application increments the number events processed and print periodically in one second to get the number of events processed in one second. Note: The --prod_type_ethdev is mandatory for running the application. Example command to run pipeline queue test: sudo build/app/dpdk-test-eventdev -c 0xf -s 0x8 --vdev=event_sw0 -- \ --test=pipeline_queue --wlcore=1 --prod_type_ethdev --stlist=ao Signed-off-by: Pavan Nikhilesh --- v3 Changes: - add SPDX licence tags app/test-eventdev/Makefile | 1 + app/test-eventdev/test_pipeline_queue.c | 166 ++++++++++++++++++++++++++++++++ 2 files changed, 167 insertions(+) create mode 100644 app/test-eventdev/test_pipeline_queue.c diff --git a/app/test-eventdev/Makefile b/app/test-eventdev/Makefile index f2fb665d8..30bebfb2f 100644 --- a/app/test-eventdev/Makefile +++ b/app/test-eventdev/Makefile @@ -52,5 +52,6 @@ SRCS-y += test_perf_queue.c SRCS-y += test_perf_atq.c SRCS-y += test_pipeline_common.c +SRCS-y += test_pipeline_queue.c include $(RTE_SDK)/mk/rte.app.mk diff --git a/app/test-eventdev/test_pipeline_queue.c b/app/test-eventdev/test_pipeline_queue.c new file mode 100644 index 000000000..4b50e7b54 --- /dev/null +++ b/app/test-eventdev/test_pipeline_queue.c @@ -0,0 +1,166 @@ +/* + * SPDX-License-Identifier: BSD-3-Clause + * Copyright 2017 Cavium, Inc. + */ + +#include "test_pipeline_common.h" + +/* See http://dpdk.org/doc/guides/tools/testeventdev.html for test details */ + +static __rte_always_inline int +pipeline_queue_nb_event_queues(struct evt_options *opt) +{ + uint16_t eth_count = rte_eth_dev_count(); + + return (eth_count * opt->nb_stages) + eth_count; +} + +static int +worker_wrapper(void *arg) +{ + RTE_SET_USED(arg); + rte_panic("invalid worker\n"); +} + +static int +pipeline_queue_launch_lcores(struct evt_test *test, struct evt_options *opt) +{ + return pipeline_launch_lcores(test, opt, worker_wrapper); +} + +static int +pipeline_queue_eventdev_setup(struct evt_test *test, struct evt_options *opt) +{ + int ret; + int nb_ports; + int nb_queues; + int nb_stages = opt->nb_stages; + uint8_t queue; + struct rte_event_dev_info info; + + nb_ports = evt_nr_active_lcores(opt->wlcores); + nb_queues = rte_eth_dev_count() * (nb_stages); + nb_queues += rte_eth_dev_count(); + + rte_event_dev_info_get(opt->dev_id, &info); + + const struct rte_event_dev_config config = { + .nb_event_queues = nb_queues, + .nb_event_ports = nb_ports, + .nb_events_limit = info.max_num_events, + .nb_event_queue_flows = opt->nb_flows, + .nb_event_port_dequeue_depth = + info.max_event_port_dequeue_depth, + .nb_event_port_enqueue_depth = + info.max_event_port_enqueue_depth, + }; + ret = rte_event_dev_configure(opt->dev_id, &config); + if (ret) { + evt_err("failed to configure eventdev %d", opt->dev_id); + return ret; + } + + struct rte_event_queue_conf q_conf = { + .priority = RTE_EVENT_DEV_PRIORITY_NORMAL, + .nb_atomic_flows = opt->nb_flows, + .nb_atomic_order_sequences = opt->nb_flows, + }; + /* queue configurations */ + for (queue = 0; queue < nb_queues; queue++) { + uint8_t slot; + + slot = queue % (nb_stages + 1); + q_conf.schedule_type = slot == nb_stages ? + RTE_SCHED_TYPE_ATOMIC : + opt->sched_type_list[slot]; + + ret = rte_event_queue_setup(opt->dev_id, queue, &q_conf); + if (ret) { + evt_err("failed to setup queue=%d", queue); + return ret; + } + } + + /* port configuration */ + const struct rte_event_port_conf p_conf = { + .dequeue_depth = opt->wkr_deq_dep, + .enqueue_depth = info.max_event_port_dequeue_depth, + .new_event_threshold = info.max_num_events, + }; + + ret = pipeline_event_port_setup(test, opt, nb_queues, p_conf); + if (ret) + return ret; + + ret = pipeline_event_rx_adapter_setup(opt, nb_stages + 1, + p_conf); + if (ret) + return ret; + + if (!evt_has_distributed_sched(opt->dev_id)) { + uint32_t service_id; + rte_event_dev_service_id_get(opt->dev_id, &service_id); + ret = evt_service_setup(service_id); + if (ret) { + evt_err("No service lcore found to run event dev."); + 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 +pipeline_queue_opt_dump(struct evt_options *opt) +{ + pipeline_opt_dump(opt, pipeline_queue_nb_event_queues(opt)); +} + +static int +pipeline_queue_opt_check(struct evt_options *opt) +{ + return pipeline_opt_check(opt, pipeline_queue_nb_event_queues(opt)); +} + +static bool +pipeline_queue_capability_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 < pipeline_queue_nb_event_queues(opt) || + dev_info.max_event_ports < + evt_nr_active_lcores(opt->wlcores)) { + evt_err("not enough eventdev queues=%d/%d or ports=%d/%d", + pipeline_queue_nb_event_queues(opt), + dev_info.max_event_queues, + evt_nr_active_lcores(opt->wlcores), + dev_info.max_event_ports); + } + + return true; +} + +static const struct evt_test_ops pipeline_queue = { + .cap_check = pipeline_queue_capability_check, + .opt_check = pipeline_queue_opt_check, + .opt_dump = pipeline_queue_opt_dump, + .test_setup = pipeline_test_setup, + .mempool_setup = pipeline_mempool_setup, + .ethdev_setup = pipeline_ethdev_setup, + .eventdev_setup = pipeline_queue_eventdev_setup, + .launch_lcores = pipeline_queue_launch_lcores, + .eventdev_destroy = pipeline_eventdev_destroy, + .mempool_destroy = pipeline_mempool_destroy, + .ethdev_destroy = pipeline_ethdev_destroy, + .test_result = pipeline_test_result, + .test_destroy = pipeline_test_destroy, +}; + +EVT_TEST_REGISTER(pipeline_queue); -- 2.15.1