From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM02-BL2-obe.outbound.protection.outlook.com (mail-bl2nam02on0087.outbound.protection.outlook.com [104.47.38.87]) by dpdk.org (Postfix) with ESMTP id C8C1014E8 for ; Mon, 11 Dec 2017 12:13:09 +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=IAw3hkVqwb83Gfq392q3VrOp50jM5Z275XN0jEkSPBUKjyX9V9n0sxSwY/nxZIfjjHvJMSCSMNemg3Dx3z9t1tZCop5JKtzuSx0pFhaF3BoTtw7uRNgUAgLkYDOn3KUlk9H80r1+6WJjvKl/Oj9T4UTJTWic59pg4u9zO2bVlYk= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Pavan.Bhagavatula@cavium.com; Received: from Pavan-LT.caveonetworks.com (111.93.218.67) by BN6PR07MB3458.namprd07.prod.outlook.com (10.161.153.21) 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 11:13:04 +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 16:42:30 +0530 Message-Id: <20171211111236.1331-2-pbhagavatula@caviumnetworks.com> X-Mailer: git-send-email 2.14.1 In-Reply-To: <20171211111236.1331-1-pbhagavatula@caviumnetworks.com> References: <1508330348-30060-1-git-send-email-pbhagavatula@caviumnetworks.com> <20171211111236.1331-1-pbhagavatula@caviumnetworks.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [111.93.218.67] X-ClientProxiedBy: BN6PR1301CA0010.namprd13.prod.outlook.com (10.174.84.151) To BN6PR07MB3458.namprd07.prod.outlook.com (10.161.153.21) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 4ecd3a92-49aa-4378-1103-08d54088284f X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(5600026)(4604075)(4534020)(4602075)(4627115)(201703031133081)(201702281549075)(2017052603307); SRVR:BN6PR07MB3458; X-Microsoft-Exchange-Diagnostics: 1; BN6PR07MB3458; 3:V4vLi59ZBnpSOdDEHkdM2/o7i/qOAReIBm/yWdmQhyKz2XopUHO0LgKbZcseowudU0J5w1SzIK2oWHq5INRWs5EYaMyf8BEeKbWlaEDhHjienRzd6aPxKdArRk3gLsIYG0GT8GG7AL8xq9wdEhDXYPrs0QsplLo7joZqVvaqSFR7Wwz8zcnwMnMSWIuO73dvfqRuMd8VDhE13GWKetSxThPgDbYGu7Pxr+qTzTihM4GuqQG/P8Ad38dulS2Xv+yK; 25:o7PxzX0/Giu0qwleG+GxvqYwkoH+zb5OQ0fcH/j0LtaIC8Wr4gcobunFzE5syZWKU1lpVYREe7q6VpJ142TkH3WnYJ81pWTz6pJGENtpOKa1Sofqp7g7NMtb9BgtUVhum5rEBxIr+7JXhUvFgVy4wwvVNbaWAgfnGTlbjEldwd2u7zMOegBtm8Uls9xV1Ya2eAK+uHOxkODjPH3wcVlrcTmu3jM1O+21S3XG8v7oZM82r9ksRXv7LXI5A20RfQiWxboNb+tziTyIeBVBQPHVxUjFeBtZZ+y8s7vuL1qfERyamH4TIJmAR8fmgXfkSL8jP07+6chC9O1Ug9JByl0Rxl9rwUnQTxZiLqklNnbccrw=; 31:rhZtIl868sQr7XIA/eBkQc8vfbJL12KYJvxLt9g7zHQPVVdCagynWIqhmOqgzKMKEGTrDJESGN5WcxLHnfeur82e/Sg12Gs7V3rSCUpVb4AkL6vbje1vQuAUQ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ZSPUeA2NE56FtZcr61Hl4+eQWbLg== 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)(3231022)(10201501046)(3002001)(6041248)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123558100)(20161123555025)(20161123560025)(20161123564025)(20161123562025)(6072148)(201708071742011); SRVR:BN6PR07MB3458; BCL:0; PCL:0; RULEID:(100000803101)(100110400095); SRVR:BN6PR07MB3458; X-Forefront-PRVS: 0518EEFB48 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(346002)(366004)(376002)(189003)(199004)(76176011)(51416003)(105586002)(48376002)(59450400001)(5660300001)(52116002)(6506006)(3846002)(2906002)(50466002)(106356001)(97736004)(66066001)(316002)(25786009)(305945005)(2950100002)(8656006)(478600001)(4326008)(16586007)(16526018)(42882006)(81166006)(6636002)(8676002)(81156014)(72206003)(8936002)(33646002)(107886003)(36756003)(68736007)(69596002)(6486002)(6666003)(50226002)(575784001)(53936002)(47776003)(6116002)(53416004)(5009440100003)(1076002)(6512007)(7736002)(42262002); DIR:OUT; SFP:1101; SCL:1; SRVR:BN6PR07MB3458; H:Pavan-LT.caveonetworks.com; FPR:; SPF:None; PTR:InfoNoRecords; MX:1; A: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; BN6PR07MB3458; 23:z8sRbDE13wrQEKdazSKtqFvoxssWM6easOH6V0nzA?= =?us-ascii?Q?3NJpeegrfwCAQEfZBvMFoNGpaoXGjhyME0JogXvx67chD2O/MEYGKPgS6k7T?= =?us-ascii?Q?MHpGKbhzBQtyiLTfcc6r8CqzQ/fidxqKFNA4g9HGoA+MdwnfHUcc28/plRnr?= =?us-ascii?Q?/urCXZq9CGKObSqx3WunO/BVUlp4DXWu2an7SgyYWXmi1JDEwYNs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K2O7bouk7eSrY337JvV8T2LxV+z4JLPr6baZ36XJ2BAl400L9a/8vq32Su4fY4r4WiipBSMU7XrUp2JRxcUqoqMuw3KjRnU SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Dec 2017 11:13:04.8011 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 4ecd3a92-49aa-4378-1103-08d54088284f X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 711e4ccf-2e9b-4bcf-a551-4094005b6194 X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN6PR07MB3458 Subject: [dpdk-dev] [PATCH v2 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 11:13:10 -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