From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM03-DM3-obe.outbound.protection.outlook.com (mail-dm3nam03on0078.outbound.protection.outlook.com [104.47.41.78]) by dpdk.org (Postfix) with ESMTP id 405741AEF3 for ; Tue, 12 Dec 2017 11:12:06 +0100 (CET) Received: from BN6PR03CA0083.namprd03.prod.outlook.com (10.164.122.149) by BN3PR03MB2354.namprd03.prod.outlook.com (10.166.74.149) 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:12:04 +0000 Received: from BY2FFO11FD043.protection.gbl (2a01:111:f400:7c0c::150) by BN6PR03CA0083.outlook.office365.com (2603:10b6:405:6f::21) 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:12:04 +0000 Authentication-Results: spf=softfail (sender IP is 192.88.168.50) smtp.mailfrom=linaro.org; nxp.com; dkim=none (message not signed) header.d=none;nxp.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 BY2FFO11FD043.mail.protection.outlook.com (10.1.14.228) 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:11:58 +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 vBCABtGv014116; Tue, 12 Dec 2017 03:12:02 -0700 From: Nikhil Agarwal To: CC: , , Date: Tue, 12 Dec 2017 15:38:25 +0530 Message-ID: <20171212100826.20550-3-nikhil.agarwal@linaro.org> X-Mailer: git-send-email 2.9.3 In-Reply-To: <20171212100826.20550-1-nikhil.agarwal@linaro.org> References: <20171212100826.20550-1-nikhil.agarwal@linaro.org> X-EOPAttributedMessage: 0 X-Matching-Connectors: 131575471185944838; (91ab9b29-cfa4-454e-5278-08d120cd25b8); () X-Forefront-Antispam-Report: CIP:192.88.168.50; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(7966004)(336005)(376002)(346002)(39860400002)(39380400002)(2980300002)(189003)(199004)(36756003)(68736007)(51416003)(104016004)(498600001)(50466002)(5660300001)(6666003)(48376002)(2950100002)(6916009)(53936002)(97736004)(81166006)(81156014)(8676002)(4326008)(356003)(305945005)(2351001)(106466001)(105596002)(50226002)(54906003)(16586007)(1076002)(2906002)(316002)(86362001)(76176011)(8936002)(77096006)(47776003)(8656006); DIR:OUT; SFP:1101; SCL:1; SRVR:BN3PR03MB2354; H:tx30smr01.am.freescale.net; FPR:; SPF:SoftFail; PTR:InfoDomainNonexistent; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BY2FFO11FD043; 1:ne7jiilDwe1xGW5SAx8M3Rtzg9CuUHn1IE72Zk13eu4QstbmoGLFWdBZ24BQqJbJIiYEfVPYr1dhtE2beI/AA1VQe1pKOrmeZ1KianVjv7IWjJPPxNg94eodrZbDnN0b MIME-Version: 1.0 Content-Type: text/plain X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: ed9f1569-8a10-4797-6106-08d54148c7a8 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(4534020)(4628075)(201703131517081)(5600026)(4604075)(2017052603307); SRVR:BN3PR03MB2354; X-Microsoft-Exchange-Diagnostics: 1; BN3PR03MB2354; 3:GzvrTzqJkikT63uqiBk2z7X2t8V5fxIgecLOhVwNTFZKDYzFh5mQuLcSvhxGycir8crquMMV1dpz6gOrdBTl/blsLw7wQKwrBY+wQkl0P7SMNlSUk2xGy0rdiWMvUs/cFvFYNFflZJLzTS7l3ve4pW0MEq/PkLbx5nrAVFZZC2rxp9LHf3TNsVIJa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8cb/pZABBmZcCwBEjemdcjCqsmpPVZW4qlBeJZAzVfQmfxF7dYgXcTMavsWQo+9VxgqgDZini1v5wxo8bZ0fiVU X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(788757137089); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6095135)(2401047)(8121501046)(5005006)(93006095)(93001095)(10201501046)(3231023)(3002001)(6055026)(6096035)(201703131430075)(201703131433075)(201703131441075)(201703131448075)(201703161259150)(20161123565025)(20161123561025)(20161123563025)(20161123556025)(20161123559100)(201708071742011); SRVR:BN3PR03MB2354; BCL:0; PCL:0; RULEID:(100000803101)(100110400095)(400006); SRVR:BN3PR03MB2354; X-Forefront-PRVS: 051900244E X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BN3PR03MB2354; 23:CEVdTPEQgiYGUcrZ44e7/BvDwhC2LzL80aKLRfX9j?= =?us-ascii?Q?ncwjbH9G/gqq0zyY/QWTNDpADrArkzuYxIaDKRpBl/Z0nlXCEGJGY+e4d2Xj?= =?us-ascii?Q?P+6DP78MKuNfB8S09Xq60xKt5JKiFXX6LkFQ8O/VlmAnZ6p/d+lfNo9w6c49?= =?us-ascii?Q?5ozpnLqOcihPJdQ4zkJVuivzr9eZO+NYiqCfi7c4VqbHpQkG7s23I1ko9iWw?= =?us-ascii?Q?H7ZgZxY41+fpFF/ViFWQ1hRq5ZVdzSSBBRs6E01SQkv8PGQSX+/huEaIWJIL?= =?us-ascii?Q?CTezjAw8gNLU6ojOgxiOoHPOCHYQMBGPbTAiINbwCfb79+DzQbi4rovx477L?= =?us-ascii?Q?GojnADh/bYovOf3XgxbFED9wqe+0tkWb1AKdQQOLtvVIV5Rbdco/C35w7gEb?= =?us-ascii?Q?AYHyfTORnjndpK0dKwVqCpKaAe80E4+3UuBXsybk57OjDaS5kX3zltWwu8kJ?= =?us-ascii?Q?6q4kfX3Z+4czM5aYyIJPucVTMgBjZIzRY2rOehN+HmANPJczL2ge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ATls+RZkKN+CaUuQ8EOu3ARFtBecp8NzmOUhwv2OojFxC/74j3uxVTgc7khtrOrB9zrxgfu7T2pAGjXNURt73mMPW8nVqFuF2hUvgjQyN6+muZy4mcTnFLflI+D5ujaeYOHnIttb25Q=; 24:aGOErN+bB4d+vDZt3OsttKsfSIHprPXXSGKuwqSswj/Fj8JNP/fhNG80wA0SPNEzwYVa7MbvOodPAaqOtqebhaNfqla+gO9IVUKLpwHxvKA=; 7:LlO50DgvdLpSTtt4jtvYgILNH/T4Rw6nAGayVn+HMJPUi8+hnoXs85kCbD+LdLhkDiJU3PqQG2LiTzf8uumKagZswQLXK4IOdESpCY3X5djV08b3L9cu1Nl+EeT3RGRWqbQBQZsTzzYT3/hDXLCqH4fmf31VMP2Q78c5R5KYs28WDHVSUya7a3FlpbeIHDwnDh8RZ+AQ9/Lo8nGGK4SRYJ3tfIZ6JTZGljTZOv+qFMQFAEPveyFI54/pmQS9nZHB SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Dec 2017 10:11:58.4072 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: ed9f1569-8a10-4797-6106-08d54148c7a8 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: BN3PR03MB2354 Subject: [dpdk-dev] [PATCH 3/4] examples/l3fwd-power: replace desc done with Rx queue count 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, 12 Dec 2017 10:12:07 -0000 HW queue based platforms may not support descriptor done API. This patch changes the usages to rx_queue_count API, which is more generic. Signed-off-by: Nikhil Agarwal --- examples/l3fwd-power/main.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/examples/l3fwd-power/main.c b/examples/l3fwd-power/main.c index 50c3702..4ddd04c 100644 --- a/examples/l3fwd-power/main.c +++ b/examples/l3fwd-power/main.c @@ -755,6 +755,7 @@ power_freq_scaleup_heuristic(unsigned lcore_id, uint16_t port_id, uint16_t queue_id) { + uint32_t rxq_count = rte_eth_rx_queue_count(port_id, queue_id); /** * HW Rx queue size is 128 by default, Rx burst read at maximum 32 entries * per iteration @@ -766,15 +767,12 @@ power_freq_scaleup_heuristic(unsigned lcore_id, #define FREQ_UP_TREND2_ACC 100 #define FREQ_UP_THRESHOLD 10000 - if (likely(rte_eth_rx_descriptor_done(port_id, queue_id, - FREQ_GEAR3_RX_PACKET_THRESHOLD) > 0)) { + if (likely(rxq_count > FREQ_GEAR3_RX_PACKET_THRESHOLD)) { stats[lcore_id].trend = 0; return FREQ_HIGHEST; - } else if (likely(rte_eth_rx_descriptor_done(port_id, queue_id, - FREQ_GEAR2_RX_PACKET_THRESHOLD) > 0)) + } else if (likely(rxq_count > FREQ_GEAR2_RX_PACKET_THRESHOLD)) stats[lcore_id].trend += FREQ_UP_TREND2_ACC; - else if (likely(rte_eth_rx_descriptor_done(port_id, queue_id, - FREQ_GEAR1_RX_PACKET_THRESHOLD) > 0)) + else if (likely(rxq_count > FREQ_GEAR1_RX_PACKET_THRESHOLD)) stats[lcore_id].trend += FREQ_UP_TREND1_ACC; if (likely(stats[lcore_id].trend > FREQ_UP_THRESHOLD)) { -- 2.7.4