From patchwork Tue Dec 12 10:05:20 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nikhil Agarwal X-Patchwork-Id: 121495 Delivered-To: patch@linaro.org Received: by 10.80.152.193 with SMTP id j59csp3863937edb; Tue, 12 Dec 2017 02:09:18 -0800 (PST) X-Google-Smtp-Source: ACJfBovy8VP9irIiYqlLjW2SzQa8xki5AsjlDqnsYYLNJFO0tjUKKlcryO84N8eDOKIcQnuA3j+0 X-Received: by 10.28.88.137 with SMTP id m131mr1200716wmb.48.1513073358864; Tue, 12 Dec 2017 02:09:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1513073358; cv=none; d=google.com; s=arc-20160816; b=OUb5o6tCe/S2ng+Nc9u05fYD1bQp0izO+tS2X29FP9qusJX513oWSnEFxeUEfBfW3/ yU6fZo18+Qd2ap0vLfEfSMlYs6Gm49W9tnPaSlTpCrvgdoXREsDpbrCqmf/O8zmXkBgb vz3UVbzzKN3rjiPn/d2RyIngf/JTKpZ9Eg1bPocbstd4AXEhdaaRNR5PnUjH9u2xoEDb o+gfpdl3dfr11P6qaM3/RqdkbDIlKAcRyhHxLJhZA/wFBDRDD5fzCkmrcNoNae8DTbNp dBt42+6H0pPC1DChrsdCthADWyJyhh2U/HpLSAJU7+iCcALk46o0d2a9bUzp3Y5qb1Bw upSw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject:spamdiagnosticmetadata :spamdiagnosticoutput:mime-version:references:in-reply-to:message-id :date:cc:to:from:arc-authentication-results; bh=T/ft6z+tW8WCUJs03ekFT3VZwELkA5W7KPaeJi9Rubk=; b=sOBjE6oN8belWET/RbbUraw7Xl8rtZD35EflDRMXhjVzioFgHqmoDFhSzO+PrEOTR6 dqVWIKygXdxhpipBYKe+I4QmsEl2ve2CF8MVmOvPTOcw1JHNil4WM2rEEUWwjWLZ+JZM /s+ArCbknrmOxuGs2L0HDzRxpzoVF6rDBwT1G2Ynec4IOr3eMz6gdkomW58ruDgpDALW nGzAkeVjtjJaKmd63Brmv5Lp1EU4JlOucks+AhQ83bMmcVAWLZLS3MnOPuGad9oR2U/u F4J4wSCTtl/Uwk6tVASLfMXABUEeeAojTWE/14WNDwdjHWx2qMCqEq8of4htWd7Yig+N FATg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) smtp.mailfrom=dev-bounces@dpdk.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from dpdk.org (dpdk.org. [92.243.14.124]) by mx.google.com with ESMTP id 6si6825908wmk.223.2017.12.12.02.09.18; Tue, 12 Dec 2017 02:09:18 -0800 (PST) Received-SPF: pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) client-ip=92.243.14.124; Authentication-Results: mx.google.com; spf=pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) smtp.mailfrom=dev-bounces@dpdk.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 263581AEF3; Tue, 12 Dec 2017 11:09:06 +0100 (CET) Received: from NAM01-SN1-obe.outbound.protection.outlook.com (mail-sn1nam01on0047.outbound.protection.outlook.com [104.47.32.47]) by dpdk.org (Postfix) with ESMTP id 62DE32C55 for ; Tue, 12 Dec 2017 11:09:03 +0100 (CET) Received: from CY4PR03CA0084.namprd03.prod.outlook.com (10.171.242.153) by CY1PR03MB2364.namprd03.prod.outlook.com (10.166.207.151) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.302.9; Tue, 12 Dec 2017 10:09:02 +0000 Received: from BL2FFO11FD028.protection.gbl (2a01:111:f400:7c09::164) by CY4PR03CA0084.outlook.office365.com (2603:10b6:910:4d::25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.302.9 via Frontend Transport; Tue, 12 Dec 2017 10:09:01 +0000 Authentication-Results: spf=softfail (sender IP is 192.88.168.50) smtp.mailfrom=linaro.org; intel.com; dkim=none (message not signed) header.d=none; intel.com; dmarc=fail action=none header.from=linaro.org; Received-SPF: SoftFail (protection.outlook.com: domain of transitioning linaro.org discourages use of 192.88.168.50 as permitted sender) Received: from tx30smr01.am.freescale.net (192.88.168.50) by BL2FFO11FD028.mail.protection.outlook.com (10.173.161.107) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.20.282.5 via Frontend Transport; Tue, 12 Dec 2017 10:08:55 +0000 Received: from netperf2.ap.freescale.net ([10.232.133.164]) by tx30smr01.am.freescale.net (8.14.3/8.14.0) with ESMTP id vBCA8qlE009395; Tue, 12 Dec 2017 03:08:58 -0700 From: Nikhil Agarwal To: CC: , , , Date: Tue, 12 Dec 2017 15:35:20 +0530 Message-ID: <20171212100520.20502-3-nikhil.agarwal@linaro.org> X-Mailer: git-send-email 2.9.3 In-Reply-To: <20171212100520.20502-1-nikhil.agarwal@linaro.org> References: <20171212100520.20502-1-nikhil.agarwal@linaro.org> X-EOPAttributedMessage: 0 X-Matching-Connectors: 131575469355421222; (91ab9b29-cfa4-454e-5278-08d120cd25b8); () X-Forefront-Antispam-Report: CIP:192.88.168.50; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(336005)(376002)(346002)(39380400002)(39860400002)(2980300002)(3190300001)(199004)(189003)(81156014)(54906003)(77096006)(36756003)(498600001)(81166006)(356003)(53936002)(2950100002)(68736007)(5660300001)(51416003)(6916009)(59450400001)(1076002)(97736004)(2906002)(86362001)(16586007)(76176011)(316002)(50466002)(106466001)(48376002)(305945005)(47776003)(104016004)(2351001)(4326008)(8656006)(105596002)(6666003)(8936002)(50226002)(8676002); DIR:OUT; SFP:1101; SCL:1; SRVR:CY1PR03MB2364; H:tx30smr01.am.freescale.net; FPR:; SPF:SoftFail; PTR:InfoDomainNonexistent; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BL2FFO11FD028; 1:fD7fR5kXn3YDZK7wnDQXPfLcyXhoxWoGWHFCyGOwENm9VsugF8K9VlmTXg1HqXzOHaXZdHhgB4D5B3uyHpk01430i7CjrpZISo0wXQi0qjAy1lw4mj2A8Y7JN6GmjNp6 MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 9cac6de2-ea71-4ffc-ce26-08d541485a8c X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(5600026)(4604075)(4534020)(4628075)(201703131517081)(2017052603307); SRVR:CY1PR03MB2364; X-Microsoft-Exchange-Diagnostics: 1; CY1PR03MB2364; 3:TFxgluAX8NiKwiGChOguCRhpmlHbMBcG76P144MF4V+F6FMWq96AgHJlj4x4mNxKJM+UlH0nPPTI4zuSRt58IqDkg08oHSPo0DHQjIUelA5LmUWPMGCvMYfedi5AUXraDDswg+hNoCeoLh58sc82rj2lXgtmtF2++N4xdDOnG3E1Lh/8gnAcZyKCMekWiCG2sI+xSZ5xQXk386uC7tyAhqoaLheCvMwBYTjXml54BhCKqUPzXjkBHn9PjQ4xUE+B1DnDkfZpP4k+A1B3hebgceTyHg77YsJYmT/9Em7fLhRUXZ3MvjYhUbmcHt+ReP8+zHfyx0vKI6CExstiLVUFmSVClC8g9FlVeEpesKvQ7QI=; 25:+29ZzCzOAkRbVg7JiC4sc8GO7gzxNiEHukAeP76bqI8bpn6co42vI16ePP9QgiJFK06wad/JDVf5E/qFiZGl73nXNZSSl5C10b8jOdF/FCahC7TWZZJRbnlCwkbTs3QCRrRXTd/qs4jrQ3PQUEWEKIbvOS1fueN/UH8pJ/2p98/qFZu/T1A6saoCnGSgPcf5QB7hO+NUT6e5CsbRkVd8xS68hNd83GqtxLOA3qBmMPmQThGytsVp2QNSfzt8R5sQ2dEKhD2Sy8z6RYtMfNrDuSgH0mKgSdeJqEilQHyKzr93piRqNaLLNRvUxleJX8KPuBqqXaI57KfE/Pxx0gabWU0TravJZBg7XcMYZQsK1Iw= X-MS-TrafficTypeDiagnostic: CY1PR03MB2364: X-Microsoft-Exchange-Diagnostics: 1; CY1PR03MB2364; 31:qQxkyu8h1u0nINK354aNDEasDxTWRS+IBIhsqawa0oVsjgtWvGQekCfFur83AabYr4ToqP+3yBADkHFIPuiAl83KGWyGHfBAQwfvoWkG4jJCs8B+qIun6HMZEhXRVcGWnd2Jj6LWSRRZ+e9IfaBY7wNQjfiXW0h704AK6kEHy5BOqkFF3zGOFr4LQ1SDrk7j5ryGUqmTP4PyjjnYXwIXKzsUpW8LAxudIhlpE7CP8MI=; 4:0vmHOMmRNkeov6fzaitpE6smXsW696cCAklFtEyQn1Py+zvfBoAeZGiZV7p+2r4GSfJMYspYI1LLf+XIiLOVmMnDAGgDe6cxtne9ApypqnewV3c9xEbrzfc/SHhbEY0Tub4N1AwlL+9GNP6TBgFu06qucQvMwuIBnDi2dbAO3Bb6uuRLKxFSssejFzruqhIIerXrOortB7ux6RzEZUCabMcJg4N4qn4X+7x40oXuFMXWkgllup3LrIbhiJyUWOIplDGO529Xf4e1eP+Zc8AIYg== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6095135)(2401047)(8121501046)(5005006)(10201501046)(93006095)(93001095)(3002001)(3231023)(6055026)(6096035)(20161123565025)(20161123556025)(20161123561025)(20161123563025)(201703131430075)(201703131448075)(201703131433075)(201703161259150)(201703151042153)(20161123559100)(201708071742011); SRVR:CY1PR03MB2364; BCL:0; PCL:0; RULEID:(100000803101)(100110400095)(400006); SRVR:CY1PR03MB2364; X-Forefront-PRVS: 051900244E X-Micro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PHECOHcRd8fX07LkezusU75glRVlQe9ZP4IUO4= X-Microsoft-Exchange-Diagnostics: 1; CY1PR03MB2364; 6:50nwYHRUYqZiNffsPPfXIHpzKPHdiFqFkospZ5zBG0KGb4HqcW/l1R0owMmKxJBPYVXsKm7Wr6FsSfEELU9kVpFn/JxaO/Mitne3Ex2EX6Iq18hpTUUxOj2eSlZbnECme31YhdawLew+j7Axse+fvLxTbVfwS+CwjlGpOnM2QBu3LqhaLufT8x49i4gVeHaYKBZx5qZcuFtI30ZGSWeI1nJvrrTk8E8TOluMeErkDH6LRJPU8FKITRDVQFW0+UM/qmm2m0LXEUP2DSTy1BFxNmOTXMxYT9NplccTbWrpiyDXw9fJsDZhlefRN9aMiC2gvQXLN3zZgJ1gRYmUTYaIy75nz14oqVdxMLCC34zmHYU=; 5:mZ6shRJOaPxOyePU7MC/XyaVl7oYIK5mjch47hXxia2j5mj93vu9kaylYZlnUBWO6WRB3p512JCXPWL4kUSLcMVCIXxAuoWKh62q5xLIZ5qMxOzOxHnYywmfc/e71mScQbBv0Ee/JbTbLYHz6Lzc71DE9VG5P/KTnZKQl7NjMUg=; 24:w8NLGO2mtfH8a1asy5+8c0jefXi8TG+ItgqGhCgFPRDweDdC7Hj3gpqAgsMTKSHUQBROhEnOoMe4ouLMN/t0AUWMmXur0Iwj4OB8Exarvn0=; 7:S+ri+eARG1S4T/FPerv1kwZmrPhs1XWADiMdnvMasOlci7pMTRA3ZAe7aR/hTpRYtKY/GBO1XNur0mlL1ww43j4fesSmv/2IJ4vqqcdJwiy/xM3wGiOejZ3VavBwd81MXLr78dEddw/LvHNds6WywyfkiUavQyNe9JPUO0x1dBdPPlaeyUwoVdmMVcCTwf8WJt72Yl0Vpl9hl6VRPJm4lPWZPKy8AtyUVUbYeKU1wNQD19h6mfNd2lfy8fsgL/dY SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Dec 2017 10:08:55.3861 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 9cac6de2-ea71-4ffc-ce26-08d541485a8c X-MS-Exchange-CrossTenant-Id: 5afe0b00-7697-4969-b663-5eab37d5f47e X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=5afe0b00-7697-4969-b663-5eab37d5f47e; Ip=[192.88.168.50]; Helo=[tx30smr01.am.freescale.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY1PR03MB2364 Subject: [dpdk-dev] [PATCH 3/3] examples/l3fwd-power: use device max burst size 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: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On some of the hardware e.g. DPAA, rx burst can only return upto 16 packets, which causes the application to assume that no more packets are present. This patch modifies the application to use device published packet burst size. Signed-off-by: Nikhil Agarwal --- examples/l3fwd-power/main.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) -- 2.7.4 diff --git a/examples/l3fwd-power/main.c b/examples/l3fwd-power/main.c index d80f663..000ac53 100644 --- a/examples/l3fwd-power/main.c +++ b/examples/l3fwd-power/main.c @@ -145,6 +145,7 @@ #define RTE_TEST_TX_DESC_DEFAULT 512 static uint16_t nb_rxd = RTE_TEST_RX_DESC_DEFAULT; static uint16_t nb_txd = RTE_TEST_TX_DESC_DEFAULT; +static uint16_t max_pkt_burst = MAX_PKT_BURST; /* ethernet addresses of ports */ static struct ether_addr ports_eth_addr[RTE_MAX_ETHPORTS]; @@ -421,7 +422,7 @@ power_timer_cb(__attribute__((unused)) struct rte_timer *tim, rte_power_freq_down(lcore_id); } else if ( (unsigned)(stats[lcore_id].nb_rx_processed / - stats[lcore_id].nb_iteration_looped) < MAX_PKT_BURST) { + stats[lcore_id].nb_iteration_looped) < max_pkt_burst) { /** * scale down a step if average packet per iteration less * than expectation. @@ -759,9 +760,9 @@ power_freq_scaleup_heuristic(unsigned lcore_id, * HW Rx queue size is 128 by default, Rx burst read at maximum 32 entries * per iteration */ -#define FREQ_GEAR1_RX_PACKET_THRESHOLD MAX_PKT_BURST -#define FREQ_GEAR2_RX_PACKET_THRESHOLD (MAX_PKT_BURST*2) -#define FREQ_GEAR3_RX_PACKET_THRESHOLD (MAX_PKT_BURST*3) +#define FREQ_GEAR1_RX_PACKET_THRESHOLD max_pkt_burst +#define FREQ_GEAR2_RX_PACKET_THRESHOLD (max_pkt_burst*2) +#define FREQ_GEAR3_RX_PACKET_THRESHOLD (max_pkt_burst*3) #define FREQ_UP_TREND1_ACC 1 #define FREQ_UP_TREND2_ACC 100 #define FREQ_UP_THRESHOLD 10000 @@ -950,7 +951,7 @@ main_loop(__attribute__((unused)) void *dummy) queueid = rx_queue->queue_id; nb_rx = rte_eth_rx_burst(portid, queueid, pkts_burst, - MAX_PKT_BURST); + max_pkt_burst); stats[lcore_id].nb_rx_processed += nb_rx; if (unlikely(nb_rx == 0)) { @@ -1703,6 +1704,9 @@ main(int argc, char **argv) dev_rxq_num = dev_info.max_rx_queues; dev_txq_num = dev_info.max_tx_queues; + if (dev_info.max_burst_size && + dev_info.max_burst_size < max_pkt_burst) + max_pkt_burst = dev_info.max_burst_size; nb_rx_queue = get_port_n_rx_queues(portid); if (nb_rx_queue > dev_rxq_num) rte_exit(EXIT_FAILURE,