From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from out4-smtp.messagingengine.com (out4-smtp.messagingengine.com [66.111.4.28]) by dpdk.org (Postfix) with ESMTP id 82FF41B173 for ; Wed, 24 Jan 2018 16:37:01 +0100 (CET) Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id 3A9DF22416; Wed, 24 Jan 2018 10:37:01 -0500 (EST) Received: from frontend1 ([10.202.2.160]) by compute1.internal (MEProxy); Wed, 24 Jan 2018 10:37:01 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fridaylinux.org; h=cc:date:from:in-reply-to:message-id:references:subject:to :x-me-sender:x-me-sender:x-sasl-enc; s=fm1; bh=1dHSxEe7Ucg+Ux3sw s7BXsh5t/UnowFNDCyM5W5vreA=; b=dUEiDHaSeQ3kS97Z1zz3ShoJqf4CTGxYe m5UnLj8wtUHZE9KHj5rnzsTquXVeWM8PRvhO6BpatKuieykm5B3Lfj+qTswha3C5 2QaLrf+hPyaLqit++BD4M+VwC6+AvdtxkCEkXCpksk27ypjvKvBDJYzO6OK/98kq zbLnal+IMWuU4iCoMIZCXx8PF/JHz/2ZijbfV9uLRcymTNc/8SM5e8cwsak7lak+ 7n0eonVogTECHJkHJjzFRce4REYj6gbdg+Pk46ZcJhu3yZakH8I7OPn8JsWsRGFE LKfF4DOgmcbnKerGzdTjkNYlaOGfkMx4YFLyvg2sryesNkLpyUQ0w== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:date:from:in-reply-to:message-id :references:subject:to:x-me-sender:x-me-sender:x-sasl-enc; s= fm1; bh=1dHSxEe7Ucg+Ux3sws7BXsh5t/UnowFNDCyM5W5vreA=; b=A+Rq5vFn lXy834tlZt0416nqF45TW+WEci6DznSCtYsPyVbnBeIKY3B2cMOp1HIhd7Nu1Hl1 ggf2SYNyeQZ1Fpu3aDdnzMfybMWckLtL+Ic5XgqLFBNi/nLRfSUbJMkQSPX8S4fP Tt2t0oQlp0K8xzcMVY67qCMQypkZePZfMFHd8gwpRQAKo3zmWU+m7wl4syrk0iHS ETVD80vU3kqqkkKKaqPBdBTOdOVb7GBOvegLDs274e6A8R2xyU5Y9XveFHQJKRtC /QKuKoSv7RE1H7pHJCM1jn8Iww30Yamaa0nmZNsHokKloQ99Hk5hBF0er5k+HXqd Fob2R8xf598gRw== X-ME-Sender: Received: from localhost.localdomain (unknown [115.150.27.206]) by mail.messagingengine.com (Postfix) with ESMTPA id 18B237E448; Wed, 24 Jan 2018 10:36:58 -0500 (EST) From: Yuanhan Liu To: Nikhil Agarwal Cc: David Hunt , dpdk stable Date: Wed, 24 Jan 2018 23:31:35 +0800 Message-Id: <1516808026-25523-27-git-send-email-yliu@fridaylinux.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1516808026-25523-1-git-send-email-yliu@fridaylinux.org> References: <1516808026-25523-1-git-send-email-yliu@fridaylinux.org> Subject: [dpdk-stable] patch 'examples/l3fwd-power: fix frequency detection' has been queued to LTS release 17.11.1 X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Jan 2018 15:37:01 -0000 Hi, FYI, your patch has been queued to LTS release 17.11.1 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 01/26/18. So please shout if anyone has objections. Thanks. --yliu --- >>From 39d670535edc0be13d1b8383fb49ca2085322004 Mon Sep 17 00:00:00 2001 From: Nikhil Agarwal Date: Tue, 12 Dec 2017 15:38:24 +0530 Subject: [PATCH] examples/l3fwd-power: fix frequency detection [ upstream commit 63de7e6e4fb507755c8306cb50ef27b85c8f6f2d ] The code assumes that the platform frequency is 2GHz. This patch add support for dynamically detecting platform frequence. Fixes: d7937e2e3d12 ("power: initial import") Signed-off-by: Nikhil Agarwal Acked-by: David Hunt --- examples/l3fwd-power/main.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/examples/l3fwd-power/main.c b/examples/l3fwd-power/main.c index d335b0d..50c3702 100644 --- a/examples/l3fwd-power/main.c +++ b/examples/l3fwd-power/main.c @@ -79,8 +79,6 @@ #define MIN_ZERO_POLL_COUNT 10 -/* around 100ms at 2 Ghz */ -#define TIMER_RESOLUTION_CYCLES 200000000ULL /* 100 ms interval */ #define TIMER_NUMBER_PER_SECOND 10 /* 100000 us */ @@ -875,7 +873,7 @@ main_loop(__attribute__((unused)) void *dummy) { struct rte_mbuf *pkts_burst[MAX_PKT_BURST]; unsigned lcore_id; - uint64_t prev_tsc, diff_tsc, cur_tsc; + uint64_t prev_tsc, diff_tsc, cur_tsc, tim_res_tsc, hz; uint64_t prev_tsc_power = 0, cur_tsc_power, diff_tsc_power; int i, j, nb_rx; uint8_t queueid; @@ -890,6 +888,8 @@ main_loop(__attribute__((unused)) void *dummy) const uint64_t drain_tsc = (rte_get_tsc_hz() + US_PER_S - 1) / US_PER_S * BURST_TX_DRAIN_US; prev_tsc = 0; + hz = rte_get_timer_hz(); + tim_res_tsc = hz/TIMER_NUMBER_PER_SECOND; lcore_id = rte_lcore_id(); qconf = &lcore_conf[lcore_id]; @@ -935,7 +935,7 @@ main_loop(__attribute__((unused)) void *dummy) } diff_tsc_power = cur_tsc_power - prev_tsc_power; - if (diff_tsc_power > TIMER_RESOLUTION_CYCLES) { + if (diff_tsc_power > tim_res_tsc) { rte_timer_manage(); prev_tsc_power = cur_tsc_power; } -- 2.7.4