DPDK patches and discussions
 help / color / mirror / Atom feed
From: Nikhil Agarwal <nikhil.agarwal@linaro.org>
To: <dev@dpdk.org>
Cc: <david.hunt@intel.com>, <nikhil.agarwal@nxp.com>,
	<hemant.agrawal@nxp.com>
Subject: [dpdk-dev] [PATCH 3/4] examples/l3fwd-power: replace desc done with Rx queue count
Date: Tue, 12 Dec 2017 15:38:25 +0530	[thread overview]
Message-ID: <20171212100826.20550-3-nikhil.agarwal@linaro.org> (raw)
In-Reply-To: <20171212100826.20550-1-nikhil.agarwal@linaro.org>

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 <nikhil.agarwal@linaro.org>
---
 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

  parent reply	other threads:[~2017-12-12 10:12 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-12-12 10:08 [dpdk-dev] [PATCH 1/4] examples/l3fwd-power: fix non Rx intr supported platform Nikhil Agarwal
2017-12-12 10:08 ` [dpdk-dev] [PATCH 2/4] examples/l3fwd-power: fix the timer for any platform freq Nikhil Agarwal
2017-12-13 14:22   ` Hunt, David
2017-12-12 10:08 ` Nikhil Agarwal [this message]
2017-12-13 14:22   ` [dpdk-dev] [PATCH 3/4] examples/l3fwd-power: replace desc done with Rx queue count Hunt, David
2017-12-12 10:08 ` [dpdk-dev] [PATCH 4/4] examples/l3fwd-power: disable Lsc interrupts Nikhil Agarwal
2017-12-13 14:23   ` Hunt, David
2017-12-13 14:21 ` [dpdk-dev] [PATCH 1/4] examples/l3fwd-power: fix non Rx intr supported platform Hunt, David
2018-01-15 17:43   ` [dpdk-dev] [dpdk-stable] " Thomas Monjalon

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20171212100826.20550-3-nikhil.agarwal@linaro.org \
    --to=nikhil.agarwal@linaro.org \
    --cc=david.hunt@intel.com \
    --cc=dev@dpdk.org \
    --cc=hemant.agrawal@nxp.com \
    --cc=nikhil.agarwal@nxp.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).