From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM03-DM3-obe.outbound.protection.outlook.com (mail-dm3nam03on0053.outbound.protection.outlook.com [104.47.41.53]) by dpdk.org (Postfix) with ESMTP id 600EA1B2A2 for ; Tue, 30 Jan 2018 12:18:05 +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=XYEeDXT66UBhCDIruXnHrD8n9u/s3eskv4vyc+dnP38=; b=VE5jYSgNBeluiTV1t7Hr10FoC06Sz3dC0jAv+QV+uIaDxBV8uW1uIfPOAseYPmuccMMv1PGZo2RJMZWMgCXaqffKpN8FBywTGan/8fhH9DEe3i64XSo25AW7Qi0BQUujvTOs0xoyPVjstRdwrQOCHPnZYiWrpkHmw+aFxe8cpB0= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Pavan.Bhagavatula@cavium.com; Received: from localhost.localdomain (111.93.218.67) by BN6PR07MB3457.namprd07.prod.outlook.com (10.161.153.20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.444.14; Tue, 30 Jan 2018 11:18:02 +0000 From: Pavan Nikhilesh To: jerin.jacob@caviumnetworks.com, harry.van.haaren@intel.com Cc: dev@dpdk.org, Pavan Nikhilesh Date: Tue, 30 Jan 2018 16:47:25 +0530 Message-Id: <20180130111725.5850-1-pbhagavatula@caviumnetworks.com> X-Mailer: git-send-email 2.14.1 In-Reply-To: <20180124093033.20122-1-pbhagavatula@caviumnetworks.com> References: <20180124093033.20122-1-pbhagavatula@caviumnetworks.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [111.93.218.67] X-ClientProxiedBy: BMXPR01CA0011.INDPRD01.PROD.OUTLOOK.COM (10.174.214.149) To BN6PR07MB3457.namprd07.prod.outlook.com (10.161.153.20) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 0a4a0568-9542-4733-1181-08d567d32153 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(5600026)(4604075)(2017052603307)(7153060)(7193020); SRVR:BN6PR07MB3457; X-Microsoft-Exchange-Diagnostics: 1; BN6PR07MB3457; 3:hLZBurw2aNP0BBwCjGyQRIdH+OZt8ot5QyvCsGVQD+dEv+EXXl1kUrX8lB5UIsgfGHg6xHuql6/EGMOFwIgEPLq/HX6RRniLsMCOMwwQRcLY2H+RDdiHth2qwloJ4zXvK+BkAhVEmr8SR6Y+rx6jDpwmBcViOnpX6C2wXEwvokVnAHbbnnFDmsW0TyJzmwnBTprGPk62a6eBnde/RKr5yNQBKWpqkqbR1hSbhvclioSmXCAtPINji/Z+lGulBmBm; 25:rPIOVUvLCarv2oPIh1RzQB+0/y0xM6liFs5eIGD9PcFVILKIbyGQ+/5TmfzBox4l8RGna6xk7bQMYKLa3gTFIkGIX1+h2OkngXMvqW9qi6q5ENPPw83FqkHIjj8J6N+TqiOpHiYM8lS294VnLhEmksG72Hu4+I03xl6Z2yxAy3Brj2gGs0B6vRe7K3gt0mFuTRlEnEJ1CaJ4DykaGcv61kJKDpP3B6DyrCYU7X7a23jbPvLcmFEqVP6XxIjQYSR3mw5d6MpIq9pvPCgFvKCD/4+IzLr91PsMEtJHumgKIMKCurIYbRDTV4+3ZEhTS9muIja75Swx2Zyzo3RyaOq7ng==; 31:o4fQPHbWzUXm93hiyZ+JnhK9Jibrp03DohwXJEB8nsEPCDuQiZOjEFO+nGVj0lDtnHsr5k0RxVUdAv32VctBEVrTNzBB7zMaixonehE/b6lG+2zVINIuDAEeoZjAk3Y5UpDyjpCZW8bqwYn9yk/uTpgjvPagTcmwL9BJrAxd/crm8IDppiqPcygLx51rsK7bdtZUJhz2+EZRzYy/Gcrmzb0nzQPJrgK0uvYSIsZpA8I= X-MS-TrafficTypeDiagnostic: BN6PR07MB3457: X-Microsoft-Exchange-Diagnostics: 1; BN6PR07MB3457; 20:iRm236Li4hYjuBhzvTMOwn1INvjUOQDmIVcjEdRhtpUNNNASrHdserMK6YJtZwoeZTVc4xsjDJB8IYSqmmmeyGHCyHalfIwlCdczvhh+RNSgsGjL9Qk6r0FGu5B6/JByqAt42iSu5R/TOt+VvQhaiXJQKOke84I4h1c6o0C5nHmFrmhKaCFkbpL7Q7JJ4g+/Utov4x/YZjtjhsPYlG4kKatDTcq9R5s7SDyT3qAt5mNToPox97Vwzn1gtpNUhJf4A3WV2uXTWwyd2gWOZgBW5H9nQEKXDc04WhsTTbEKDY5ugUD0984wJpFdJy4iXrBjZrJcVHoDCXunWu1P3s93sQxGcLcUOQ8j+FWCpcOLsiBwv+eNb2ae2l7+USWLZt1qvRElSjRKnGT73iJ0BSbSJ7wxfnMs2aS3jYwfN3KK/knWnv7zux7vbnpwhR4a20CfXq7quKdMDJZ13DftfqoyKeBWQxdfgxbz6a25JU1JyGqwChDp8DxJmt/87oLx9DwFuFLtDNf1M8BfubFTN7IRQzkiEUmng7AGB3TIFpaFTCde5y0KPhOt0o4bc4LXcf0w8t7f8HL2u6StXFfn0Us5csHtTLeobwgneNznEzZnu00=; 4:HMMD7uwKMTc1dCOWvRdvGeXcX5gGNCH5MJ279KK8rKKJSNBpGh5fIIqEDQBVoSExpL+XyfBImDS6AplQ5rrkpiBUWPeAKK4MYTSqmwq2OgDw4DknA/BXdmscmYausjHFSIdpyEXhTuIIRPhBQK+9faKnXa+jMhyAIXdFqtmaMWJHt/eD09bSAYQonmV9/rXLHMYUYrg/j8lAeb6xQi3oI/FKhJznDR3dhYU2aqYqKIH+bSJnDD3EGmoede3ldcUoKacxmqNj8F9Mwc0I6tQK/g== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040501)(2401047)(5005006)(8121501046)(3002001)(10201501046)(3231101)(944501161)(93006095)(6041288)(20161123562045)(20161123558120)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123564045)(6072148)(201708071742011); SRVR:BN6PR07MB3457; BCL:0; PCL:0; RULEID:; SRVR:BN6PR07MB3457; X-Forefront-PRVS: 0568F32D91 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(6069001)(366004)(39860400002)(39380400002)(376002)(346002)(396003)(199004)(189003)(25786009)(6116002)(8936002)(97736004)(50466002)(48376002)(68736007)(16526019)(5660300001)(5009440100003)(4326008)(2906002)(50226002)(36756003)(66066001)(316002)(7736002)(305945005)(81166006)(81156014)(107886003)(106356001)(47776003)(53936002)(6512007)(26005)(105586002)(478600001)(6506007)(1076002)(6486002)(8676002)(386003)(16586007)(76176011)(72206003)(3846002)(6666003)(52116002)(51416003)(2950100002)(42882006)(42262002); DIR:OUT; SFP:1101; SCL:1; SRVR:BN6PR07MB3457; H:localhost.localdomain; 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; BN6PR07MB3457; 23:sD9xNIrQ91omXsw41Kuc2RhqFMu+FS5t709JDxOdt?= =?us-ascii?Q?jz3tkQw8tlha68x8BsNd5uNZP65IvzB19IOUoofYTCw2hiQ1jjb15mofFPod?= =?us-ascii?Q?KucPSR7fTpYdtg+rZVccbYgue+PfLPqMXuDhKntHc0hB5+KduXtlinyGIv2n?= =?us-ascii?Q?kXoWnMtojeziHz9AJLnXnGJRsJFF25j+2zLsqtjBV+kxz4YGQtSRYT7v7iHo?= =?us-ascii?Q?cWyfJ1rwT5rtDcp1xOcUgiBmk80Sr3KPnuks6EiHEnSkKZXvIVtlwgGU3X1e?= =?us-ascii?Q?Ih6WmUauQ06+LFT/WtyhdnN2QjlWGzg5u5g7gRthFA7uot4V+2mY/H90TlYr?= =?us-ascii?Q?a8rxLzukHW0h+CMAywxL72r2biFbHnVu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7EtGaZkuiR15faPiN4MFWsXmtmKMNG+5o+oZYevoJwZpBZiyGws3zOkZ4JikazT5pkEwHssaa91edMMUBtcppKr8vEZyQb6kO9CT/XUfSgaANgv5x7u4CMGkFo24QIO3bhmXHufYHuNPx/PECvHtyBIv/EMYzckgaXIKXP+0cVNdQyg97sfDKPwA2zQ36JGaddLti6DmAWYVo9CxOimifdnjogGlva3W07QTjhplglukkcV4knxZ1YZH9H/+xXVd1iv6crHx3RABdYDuhjUPUzf84O4Xtevm0DSKR6ukbT38hxiqj8M932g93n7l3uUZ1iTD24qzqMQyGgJGgf+kg==; 5:u50RTgHKGC6YLnM7UcBiBm+9IXH4xrEZp9VYwuYxQKueVckDEGO2bn1V1wZmYpkdg8VBJfPqp5y4OhSWghmOYd4TW5Crr5P5yY2OZgEiq2VCwm/vi5I+40ImRlCIZjw+dhFgDahLlTonYiEwTMizuZYxqpFl4qbYlW1DDig5uJk=; 24:74CbmZYbrkwaCG2B2o8qnOTrsBmI881TXrLGBTCRs2Snr6iXgGAwdwd6N+jkvQchSGaeVkLuZiNaRJz71dZ9AAcdWkWnWB6MpsvNaSUltlI=; 7:aiP0fE6T3q2GFKHYKFTtx2SxXGTtXEgpmEB+1eRg6LmO+AplvNETVwtHxqMf/oTtbABEYeCk8HOic6bOuHx5O6StTM7ZHbNSDWw5fdBIbaWiXVl7ZHFtLM3Df9KkdM6Ay5+xkYLv6jc+DTUlR/JRcUHlY7iWkKtSrS4kPp8UuqAY8OFQqoYW5x4gAuLrD3vVvlS3vWKQlzrLVskGHxqD2l6LHd6iS3L9WbbLoRSSR3GtA1fRTyg7Cwo1bYcte13x SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Jan 2018 11:18:02.0458 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 0a4a0568-9542-4733-1181-08d567d32153 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 711e4ccf-2e9b-4bcf-a551-4094005b6194 X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN6PR07MB3457 Subject: [dpdk-dev] [PATCH v2] app/eventdev: fix port dequeue depth configuration 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: Tue, 30 Jan 2018 11:18:05 -0000 The port dequeue depth value has to be compared against the maximum allowed dequeue depth reported by the event drivers. Fixes: 3617aae53f92 ("app/eventdev: add event Rx adapter setup") Signed-off-by: Pavan Nikhilesh Acked-by: Jerin Jacob --- v2 Changes: - Pass port_conf as pointer. app/test-eventdev/test_perf_atq.c | 13 ++++++++++++- app/test-eventdev/test_perf_common.c | 29 +++++++---------------------- app/test-eventdev/test_perf_common.h | 3 ++- app/test-eventdev/test_perf_queue.c | 12 +++++++++++- app/test-eventdev/test_pipeline_atq.c | 3 +++ app/test-eventdev/test_pipeline_queue.c | 3 +++ 6 files changed, 38 insertions(+), 25 deletions(-) diff --git a/app/test-eventdev/test_perf_atq.c b/app/test-eventdev/test_perf_atq.c index d07a05425..18c02562b 100644 --- a/app/test-eventdev/test_perf_atq.c +++ b/app/test-eventdev/test_perf_atq.c @@ -207,7 +207,18 @@ perf_atq_eventdev_setup(struct evt_test *test, struct evt_options *opt) } } - ret = perf_event_dev_port_setup(test, opt, 1 /* stride */, nb_queues); + if (opt->wkr_deq_dep > dev_info.max_event_port_dequeue_depth) + opt->wkr_deq_dep = dev_info.max_event_port_dequeue_depth; + + /* port configuration */ + struct rte_event_port_conf p_conf = { + .dequeue_depth = opt->wkr_deq_dep, + .enqueue_depth = dev_info.max_event_port_dequeue_depth, + .new_event_threshold = dev_info.max_num_events, + }; + + ret = perf_event_dev_port_setup(test, opt, 1 /* stride */, nb_queues, + &p_conf); if (ret) return ret; diff --git a/app/test-eventdev/test_perf_common.c b/app/test-eventdev/test_perf_common.c index e279d81a5..3be210452 100644 --- a/app/test-eventdev/test_perf_common.c +++ b/app/test-eventdev/test_perf_common.c @@ -217,7 +217,7 @@ perf_launch_lcores(struct evt_test *test, struct evt_options *opt, static int perf_event_rx_adapter_setup(struct evt_options *opt, uint8_t stride, - struct rte_event_port_conf prod_conf) + struct rte_event_port_conf *prod_conf) { int ret = 0; uint16_t prod; @@ -239,7 +239,7 @@ perf_event_rx_adapter_setup(struct evt_options *opt, uint8_t stride, } queue_conf.ev.queue_id = prod * stride; ret = rte_event_eth_rx_adapter_create(prod, opt->dev_id, - &prod_conf); + prod_conf); if (ret) { evt_err("failed to create rx adapter[%d]", prod); return ret; @@ -285,22 +285,12 @@ perf_event_rx_adapter_setup(struct evt_options *opt, uint8_t stride, int perf_event_dev_port_setup(struct evt_test *test, struct evt_options *opt, - uint8_t stride, uint8_t nb_queues) + uint8_t stride, uint8_t nb_queues, + struct rte_event_port_conf *port_conf) { struct test_perf *t = evt_test_priv(test); uint16_t port, prod; int ret = -1; - struct rte_event_port_conf port_conf; - - memset(&port_conf, 0, sizeof(struct rte_event_port_conf)); - rte_event_port_default_conf_get(opt->dev_id, 0, &port_conf); - - /* port configuration */ - const struct rte_event_port_conf wkr_p_conf = { - .dequeue_depth = opt->wkr_deq_dep, - .enqueue_depth = port_conf.enqueue_depth, - .new_event_threshold = port_conf.new_event_threshold, - }; /* setup one port per worker, linking to all queues */ for (port = 0; port < evt_nr_active_lcores(opt->wlcores); @@ -313,7 +303,7 @@ perf_event_dev_port_setup(struct evt_test *test, struct evt_options *opt, w->processed_pkts = 0; w->latency = 0; - ret = rte_event_port_setup(opt->dev_id, port, &wkr_p_conf); + ret = rte_event_port_setup(opt->dev_id, port, port_conf); if (ret) { evt_err("failed to setup port %d", port); return ret; @@ -327,18 +317,13 @@ perf_event_dev_port_setup(struct evt_test *test, struct evt_options *opt, } /* port for producers, no links */ - struct rte_event_port_conf prod_conf = { - .dequeue_depth = port_conf.dequeue_depth, - .enqueue_depth = port_conf.enqueue_depth, - .new_event_threshold = port_conf.new_event_threshold, - }; if (opt->prod_type == EVT_PROD_TYPE_ETH_RX_ADPTR) { for ( ; port < perf_nb_event_ports(opt); port++) { struct prod_data *p = &t->prod[port]; p->t = t; } - ret = perf_event_rx_adapter_setup(opt, stride, prod_conf); + ret = perf_event_rx_adapter_setup(opt, stride, port_conf); if (ret) return ret; } else { @@ -352,7 +337,7 @@ perf_event_dev_port_setup(struct evt_test *test, struct evt_options *opt, p->t = t; ret = rte_event_port_setup(opt->dev_id, port, - &prod_conf); + port_conf); if (ret) { evt_err("failed to setup port %d", port); return ret; diff --git a/app/test-eventdev/test_perf_common.h b/app/test-eventdev/test_perf_common.h index f8d516ce4..8187ab936 100644 --- a/app/test-eventdev/test_perf_common.h +++ b/app/test-eventdev/test_perf_common.h @@ -133,7 +133,8 @@ int perf_test_setup(struct evt_test *test, struct evt_options *opt); int perf_ethdev_setup(struct evt_test *test, struct evt_options *opt); int perf_mempool_setup(struct evt_test *test, struct evt_options *opt); int perf_event_dev_port_setup(struct evt_test *test, struct evt_options *opt, - uint8_t stride, uint8_t nb_queues); + uint8_t stride, uint8_t nb_queues, + struct rte_event_port_conf *port_conf); int perf_event_dev_service_setup(uint8_t dev_id); int perf_launch_lcores(struct evt_test *test, struct evt_options *opt, int (*worker)(void *)); diff --git a/app/test-eventdev/test_perf_queue.c b/app/test-eventdev/test_perf_queue.c index d5b890876..6ef85c100 100644 --- a/app/test-eventdev/test_perf_queue.c +++ b/app/test-eventdev/test_perf_queue.c @@ -219,8 +219,18 @@ perf_queue_eventdev_setup(struct evt_test *test, struct evt_options *opt) } } + if (opt->wkr_deq_dep > dev_info.max_event_port_dequeue_depth) + opt->wkr_deq_dep = dev_info.max_event_port_dequeue_depth; + + /* port configuration */ + struct rte_event_port_conf p_conf = { + .dequeue_depth = opt->wkr_deq_dep, + .enqueue_depth = dev_info.max_event_port_dequeue_depth, + .new_event_threshold = dev_info.max_num_events, + }; + ret = perf_event_dev_port_setup(test, opt, nb_stages /* stride */, - nb_queues); + nb_queues, &p_conf); if (ret) return ret; diff --git a/app/test-eventdev/test_pipeline_atq.c b/app/test-eventdev/test_pipeline_atq.c index 36abbddda..dd7189776 100644 --- a/app/test-eventdev/test_pipeline_atq.c +++ b/app/test-eventdev/test_pipeline_atq.c @@ -378,6 +378,9 @@ pipeline_atq_eventdev_setup(struct evt_test *test, struct evt_options *opt) } } + if (opt->wkr_deq_dep > info.max_event_port_dequeue_depth) + opt->wkr_deq_dep = info.max_event_port_dequeue_depth; + /* port configuration */ const struct rte_event_port_conf p_conf = { .dequeue_depth = opt->wkr_deq_dep, diff --git a/app/test-eventdev/test_pipeline_queue.c b/app/test-eventdev/test_pipeline_queue.c index 835fe0782..02fc27cf8 100644 --- a/app/test-eventdev/test_pipeline_queue.c +++ b/app/test-eventdev/test_pipeline_queue.c @@ -397,6 +397,9 @@ pipeline_queue_eventdev_setup(struct evt_test *test, struct evt_options *opt) } } + if (opt->wkr_deq_dep > info.max_event_port_dequeue_depth) + opt->wkr_deq_dep = info.max_event_port_dequeue_depth; + /* port configuration */ const struct rte_event_port_conf p_conf = { .dequeue_depth = opt->wkr_deq_dep, -- 2.16.0