From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM01-BY2-obe.outbound.protection.outlook.com (mail-by2nam01on0045.outbound.protection.outlook.com [104.47.34.45]) by dpdk.org (Postfix) with ESMTP id 6A2941AEEE for ; Mon, 11 Dec 2017 16:14:14 +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=LSZQ5eljRYFCV9qNOZ37LllgEHvhrAwvqxoWUSH3zd4=; b=elZVq+VtjyKKP2iDJEkMPhY0TrAtRUAHlXCtBwtEb1EqsebjcvJvZEam+2c7ZrfGGLoibFFNLefbS9egUFKHEM6pkojF/3U0iova/RJJdpUJ46CbtfYg68n3wS3Tjl5+L/uQoeV5wReGeCmZvkW11C7ANEt+ekRLCRGig4+NHYk= Received: from Pavan-LT.caveonetworks.com (111.93.218.67) by CY4PR07MB3463.namprd07.prod.outlook.com (10.171.252.144) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.302.9; Mon, 11 Dec 2017 15:14:09 +0000 From: Pavan Nikhilesh To: jerin.jacob@caviumnetworks.com, bruce.richardson@intel.com, harry.van.haaren@intel.com, gage.eads@intel.com, hemant.agrawal@nxp.com, nipun.gupta@nxp.com, nikhil.rao@intel.com, santosh.shukla@caviumnetworks.com Cc: dev@dpdk.org, Pavan Nikhilesh Date: Mon, 11 Dec 2017 20:43:40 +0530 Message-Id: <20171211151346.14405-2-pbhagavatula@caviumnetworks.com> X-Mailer: git-send-email 2.14.1 In-Reply-To: <20171211151346.14405-1-pbhagavatula@caviumnetworks.com> References: <1508330348-30060-1-git-send-email-pbhagavatula@caviumnetworks.com> <20171211151346.14405-1-pbhagavatula@caviumnetworks.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [111.93.218.67] X-ClientProxiedBy: DM5PR13CA0046.namprd13.prod.outlook.com (10.168.240.160) To CY4PR07MB3463.namprd07.prod.outlook.com (10.171.252.144) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 91983eae-9d13-4ce2-6333-08d540a9d5c7 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(5600026)(4604075)(4534020)(4602075)(4627115)(201703031133081)(201702281549075)(2017052603307); SRVR:CY4PR07MB3463; X-Microsoft-Exchange-Diagnostics: 1; CY4PR07MB3463; 3:FhW7khIMhQfC2RQMjPgKuhF33vgrQrOWpuyaiPrOaUJgRMId1wR2o2m1DxNgmlzuB8eQcew8XeF4cnsxD+o7v2nmmkbsikwgZDTyE+k/n7YN2UZJyC79FqSvY35UmY1SM+bNGwxZLxznCWcSJMTksKIPegA8bEk/iR1hrX9zXCIhvip/xs2MeWuWzbVVspznf82JnAykJT362Z2KoagYOZ3RKFNrhiBq3jSqLrgctvt6VD69SxB4yNYUqjpEaxiW; 25:tk8xhM2AKSJw05pudG7cFsAnv9F8L0LSpYvu59e/AJDdfYDlZGmCaOZ0gfsgzrCYOj0XyzWPRhGA6l4thkIwyL7vOxhwP5FlbUcXv4630jMaQKzTGLwmKAUMh4s9TeEvtW09cKoAQgo3WYH4PCxBRmCgD/5U18STmRNalQN0tVhmGisO/ncylbUU3ujV6gDqwHCv2ibQDRSGl3c6W9UqtTjW98qBLssCeV0JwQxtqUKGZdpH+IOHs3i53DyTpi+23+6seachqeiw9/AmLn62NKdSooT3p/KCj/fwXqNRJj2ea2khOhtBpHNjXbKX633v/r0JJ8iXhVlUmWGGu9YALQ==; 31:KYQjt3bsiE7NIbdeoCC7BlSQmJ5cco+15BwIGZLhYqOYur32WWulXteIP1pTgY5ceFdsy+Xfqp6x9m2uw/nQrnnS1ZjAMySU0zxiZ8yzG+b9GZV2D34u9RIeQzHSPcqao/FBti5AkfCWD+pnh/DGjI5oG2XcHQIoRdAWVLswgYWYaHTf9baHq5Ln9WFp2mFJXZYpFLSne7DsxzM8uXZ9dRmNfI++18JcAP1YBL5YKUo= X-MS-TrafficTypeDiagnostic: CY4PR07MB3463: Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Pavan.Bhagavatula@cavium.com; X-Microsoft-Exchange-Diagnostics: 1; CY4PR07MB3463; 20:TBynF5RkCVKkMJRlBYd64otTWdWbEAspJsYDq/gYUWuaEd0hPdPmBkh+K3VoFZm0IO5N39eTlbIFwawd5H4WRcq5UKTHgC9s51+/6Rri+C/xed0XA9G2F8c1ruvkU+HgJdPPYUHGzPSVkVA91PcrT2otWZyHCWjOv0mNCZHdYsEN3j3G+6Joau2CxI60jS5gmSDkSedvMtJLCHf6MdFS6tIMfzkJZ2WE4jgP001du/orp91z2kPoIP/6lEfCdLsPBz32skvAVPhwoAmCguLNSio7ZX2Xrk4lDf0UVOr/U8olv7Zcyx86l7kHZCCJYsc3sL3NP+JCpc/1AloKgSSrsYFRi9g0P6d3mMvM5s1W63mecU+5LGaA6j/DHDiw6AbiI2AP6xzUMPWO6IQBY9FxhV/C/GmhUB45Xrf6TprMne32lG4YHxSYaY7SA8n3OPH93bM/Uq2wFlewE6kYcRyhcAyfU+Exg6QbCdXc884t/gjg7D8feY9xtUezk6ZzHWCaLYne3YUoZ/fLR5P0OptHOHQQMLSOtkpFWP2AWuSaLJRIzo3rtfYYGuzMfXU9L3hmzTingPa3au3RLoyvW5cT/Qrcst9v+JZEN5gMwS7gPDs=; 4:4tXGbeGrjbNX+M/CFSA5f8NIvpOKIS50KjfcRtBWC3NLystVqY8LhDR+LVHWqgo25yu/7LopZlnTPvp0pkqUtUvfA9vLIobwX+AcGa4qgEuILhViT4a3MvCCT7BItI/SKx68S7WnQsq8NCG7GzLlPt0QeT+f53qterJYZR4tHUPGNcbh2AQfLU65vshPK+YLw22L49wNBFq5F0IjNuYGoQitCGhV/CYJCKmKEOM+uTULq2T3rDJ+1pXZRjqS00rDX8EXBXkIcTJdWu+f7SjNzA== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040450)(2401047)(5005006)(8121501046)(93006095)(3002001)(10201501046)(3231022)(6041248)(20161123562025)(20161123564025)(20161123560025)(20161123555025)(20161123558100)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(6072148)(201708071742011); SRVR:CY4PR07MB3463; BCL:0; PCL:0; RULEID:(100000803101)(100110400095); SRVR:CY4PR07MB3463; X-Forefront-PRVS: 0518EEFB48 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(366004)(346002)(376002)(199004)(189003)(97736004)(53936002)(53416004)(106356001)(16586007)(105586002)(8676002)(25786009)(1076002)(8936002)(107886003)(81166006)(36756003)(50226002)(69596002)(7736002)(305945005)(66066001)(50466002)(6506006)(4326008)(16526018)(6486002)(81156014)(3846002)(2906002)(2950100002)(5660300001)(42882006)(6636002)(6666003)(6116002)(316002)(68736007)(47776003)(478600001)(72206003)(52116002)(6512007)(8656006)(48376002)(575784001)(5009440100003)(51416003)(59450400001)(76176011)(42262002); DIR:OUT; SFP:1101; SCL:1; SRVR:CY4PR07MB3463; 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; CY4PR07MB3463; 23:wkiJSBDDieQugFiGVn1ADf43DKwKQEyBHlkmDanh6?= =?us-ascii?Q?wR3X1B8GCxqT839SB8x1C3BPNJ7q5/NoRjEajM2LaEZHbgge47jo9NLhqBOM?= =?us-ascii?Q?WAHvWAerG4CLcwhZ1gBTk3WVUiANrlPiZdtYiIYTagph6yrozKs4AF1D9i6G?= =?us-ascii?Q?R0xdCDqExXkmLeXb0Pv3RfKNrz+FnQkUw3e3M57EYHdUMtOM/qk9Ee9pP9wr?= =?us-ascii?Q?AoFx/lzI5iuB+QJg6S9lPuJfVTrBPxWZQ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etadata: NSPM X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Dec 2017 15:14:09.0714 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 91983eae-9d13-4ce2-6333-08d540a9d5c7 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 711e4ccf-2e9b-4bcf-a551-4094005b6194 X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR07MB3463 Subject: [dpdk-dev] [PATCH v3 2/8] app/eventdev: modify app setup to support ethdev 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: Mon, 11 Dec 2017 15:14:15 -0000 Modify app setup to accommodate event port and queue setup based on the number of ethernet ports. Signed-off-by: Pavan Nikhilesh Acked-by: Jerin Jacob --- v2 Changes: - Removed unnecessary RTE_SET_USED() macros. app/test-eventdev/test_perf_atq.c | 17 +++++++++++++---- app/test-eventdev/test_perf_common.c | 26 ++++++++++++++++++++------ app/test-eventdev/test_perf_common.h | 1 + app/test-eventdev/test_perf_queue.c | 16 +++++++++++++--- 4 files changed, 47 insertions(+), 13 deletions(-) diff --git a/app/test-eventdev/test_perf_atq.c b/app/test-eventdev/test_perf_atq.c index 0e9f2db0e..6082d4ff3 100644 --- a/app/test-eventdev/test_perf_atq.c +++ b/app/test-eventdev/test_perf_atq.c @@ -185,10 +185,19 @@ perf_atq_eventdev_setup(struct evt_test *test, struct evt_options *opt) { int ret; uint8_t queue; + uint8_t nb_queues; + uint8_t nb_ports; + + nb_ports = evt_nr_active_lcores(opt->wlcores); + nb_ports += opt->prod_type == EVT_PROD_TYPE_ETH_RX_ADPTR ? 0 : + evt_nr_active_lcores(opt->plcores); + + nb_queues = opt->prod_type == EVT_PROD_TYPE_ETH_RX_ADPTR ? + rte_eth_dev_count() : atq_nb_event_queues(opt); const struct rte_event_dev_config config = { - .nb_event_queues = atq_nb_event_queues(opt), - .nb_event_ports = perf_nb_event_ports(opt), + .nb_event_queues = nb_queues, + .nb_event_ports = nb_ports, .nb_events_limit = 4096, .nb_event_queue_flows = opt->nb_flows, .nb_event_port_dequeue_depth = 128, @@ -208,7 +217,7 @@ perf_atq_eventdev_setup(struct evt_test *test, struct evt_options *opt) .nb_atomic_order_sequences = opt->nb_flows, }; /* queue configurations */ - for (queue = 0; queue < atq_nb_event_queues(opt); queue++) { + for (queue = 0; queue < nb_queues; queue++) { ret = rte_event_queue_setup(opt->dev_id, queue, &q_conf); if (ret) { evt_err("failed to setup queue=%d", queue); @@ -217,7 +226,7 @@ perf_atq_eventdev_setup(struct evt_test *test, struct evt_options *opt) } ret = perf_event_dev_port_setup(test, opt, 1 /* stride */, - atq_nb_event_queues(opt)); + nb_queues); if (ret) return ret; diff --git a/app/test-eventdev/test_perf_common.c b/app/test-eventdev/test_perf_common.c index 9d2865ed5..114210ea6 100644 --- a/app/test-eventdev/test_perf_common.c +++ b/app/test-eventdev/test_perf_common.c @@ -88,6 +88,17 @@ perf_producer(void *arg) return 0; } +static int +perf_producer_wrapper(void *arg) +{ + struct prod_data *p = arg; + struct test_perf *t = p->t; + /* Launch the producer function only in case of synthetic producer. */ + if (t->opt->prod_type == EVT_PROD_TYPE_SYNT) + return perf_producer(arg); + return 0; +} + static inline uint64_t processed_pkts(struct test_perf *t) { @@ -142,8 +153,8 @@ perf_launch_lcores(struct evt_test *test, struct evt_options *opt, if (!(opt->plcores[lcore_id])) continue; - ret = rte_eal_remote_launch(perf_producer, &t->prod[port_idx], - lcore_id); + ret = rte_eal_remote_launch(perf_producer_wrapper, + &t->prod[port_idx], lcore_id); if (ret) { evt_err("failed to launch perf_producer %d", lcore_id); return ret; @@ -193,14 +204,17 @@ perf_launch_lcores(struct evt_test *test, struct evt_options *opt, fflush(stdout); if (remaining <= 0) { - t->done = true; t->result = EVT_TEST_SUCCESS; - rte_smp_wmb(); - break; + if (opt->prod_type == EVT_PROD_TYPE_SYNT) { + t->done = true; + rte_smp_wmb(); + break; + } } } - if (new_cycles - dead_lock_cycles > dead_lock_sample) { + if (new_cycles - dead_lock_cycles > dead_lock_sample && + opt->prod_type == EVT_PROD_TYPE_SYNT) { remaining = t->outstand_pkts - processed_pkts(t); if (dead_lock_remaining == remaining) { rte_event_dev_dump(opt->dev_id, stdout); diff --git a/app/test-eventdev/test_perf_common.h b/app/test-eventdev/test_perf_common.h index c6fc70cd7..ab2e59988 100644 --- a/app/test-eventdev/test_perf_common.h +++ b/app/test-eventdev/test_perf_common.h @@ -38,6 +38,7 @@ #include #include +#include #include #include #include diff --git a/app/test-eventdev/test_perf_queue.c b/app/test-eventdev/test_perf_queue.c index d843eea17..0caf5757c 100644 --- a/app/test-eventdev/test_perf_queue.c +++ b/app/test-eventdev/test_perf_queue.c @@ -182,10 +182,20 @@ perf_queue_eventdev_setup(struct evt_test *test, struct evt_options *opt) uint8_t queue; int nb_stages = opt->nb_stages; int ret; + int nb_ports; + int nb_queues; + + nb_ports = evt_nr_active_lcores(opt->wlcores); + nb_ports += opt->prod_type == EVT_PROD_TYPE_ETH_RX_ADPTR ? 0 : + evt_nr_active_lcores(opt->plcores); + + nb_queues = opt->prod_type == EVT_PROD_TYPE_ETH_RX_ADPTR ? + rte_eth_dev_count() * nb_stages : + perf_queue_nb_event_queues(opt); const struct rte_event_dev_config config = { - .nb_event_queues = perf_queue_nb_event_queues(opt), - .nb_event_ports = perf_nb_event_ports(opt), + .nb_event_queues = nb_queues, + .nb_event_ports = nb_ports, .nb_events_limit = 4096, .nb_event_queue_flows = opt->nb_flows, .nb_event_port_dequeue_depth = 128, @@ -228,7 +238,7 @@ perf_queue_eventdev_setup(struct evt_test *test, struct evt_options *opt) } ret = perf_event_dev_port_setup(test, opt, nb_stages /* stride */, - perf_queue_nb_event_queues(opt)); + nb_queues); if (ret) return ret; -- 2.14.1