* [dpdk-stable] [PATCH 1/4] examples/l3fwd-power: fix non Rx intr supported platform
@ 2017-12-12 10:08 Nikhil Agarwal
2017-12-12 10:08 ` [dpdk-stable] [PATCH 2/4] examples/l3fwd-power: fix the timer for any platform freq Nikhil Agarwal
2017-12-13 14:21 ` [dpdk-stable] [PATCH 1/4] examples/l3fwd-power: fix non Rx intr supported platform Hunt, David
0 siblings, 2 replies; 5+ messages in thread
From: Nikhil Agarwal @ 2017-12-12 10:08 UTC (permalink / raw)
To: dev
Cc: david.hunt, nikhil.agarwal, hemant.agrawal, stable, Danny Zhou,
Cunming Liang
This existing code cause the platform to start receiving packet
immediately irrespective of interrupts available or not.
If the platform does not support Rx interrupt, it shall not start
receiving packets immediately. It shall let the timer management work.
Fixes: aee3bc79cc34 ("examples/l3fwd-power: enable one-shot Rx interrupt and polling switch")
Cc: stable@dpdk.org
Cc: Danny Zhou <danny.zhou@intel.com>
Cc: Cunming Liang <cunming.liang@intel.com>
Signed-off-by: Nikhil Agarwal <nikhil.agarwal@linaro.org>
---
examples/l3fwd-power/main.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/examples/l3fwd-power/main.c b/examples/l3fwd-power/main.c
index 0a4ed14..d335b0d 100644
--- a/examples/l3fwd-power/main.c
+++ b/examples/l3fwd-power/main.c
@@ -1051,9 +1051,11 @@ main_loop(__attribute__((unused)) void *dummy)
turn_on_intr(qconf);
sleep_until_rx_interrupt(
qconf->n_rx_queue);
+ /**
+ * start receiving packets immediately
+ */
+ goto start_rx;
}
- /* start receiving packets immediately */
- goto start_rx;
}
stats[lcore_id].sleep_time += lcore_idle_hint;
}
--
2.7.4
^ permalink raw reply [flat|nested] 5+ messages in thread
* [dpdk-stable] [PATCH 2/4] examples/l3fwd-power: fix the timer for any platform freq
2017-12-12 10:08 [dpdk-stable] [PATCH 1/4] examples/l3fwd-power: fix non Rx intr supported platform Nikhil Agarwal
@ 2017-12-12 10:08 ` Nikhil Agarwal
2017-12-13 14:22 ` Hunt, David
2017-12-13 14:21 ` [dpdk-stable] [PATCH 1/4] examples/l3fwd-power: fix non Rx intr supported platform Hunt, David
1 sibling, 1 reply; 5+ messages in thread
From: Nikhil Agarwal @ 2017-12-12 10:08 UTC (permalink / raw)
To: dev; +Cc: david.hunt, nikhil.agarwal, hemant.agrawal, stable
The code assumes that the platform frequency is 2GHz.
This patch add support for dynamically detecting platform frequence.
Fixes: d7937e2e3d12 ("power: initial import")
Cc: stable@dpdk.org
Signed-off-by: Nikhil Agarwal <nikhil.agarwal@linaro.org>
---
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
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [dpdk-stable] [PATCH 1/4] examples/l3fwd-power: fix non Rx intr supported platform
2017-12-12 10:08 [dpdk-stable] [PATCH 1/4] examples/l3fwd-power: fix non Rx intr supported platform Nikhil Agarwal
2017-12-12 10:08 ` [dpdk-stable] [PATCH 2/4] examples/l3fwd-power: fix the timer for any platform freq Nikhil Agarwal
@ 2017-12-13 14:21 ` Hunt, David
2018-01-15 17:43 ` Thomas Monjalon
1 sibling, 1 reply; 5+ messages in thread
From: Hunt, David @ 2017-12-13 14:21 UTC (permalink / raw)
To: Nikhil Agarwal, dev
Cc: nikhil.agarwal, hemant.agrawal, stable, Danny Zhou, Cunming Liang
On 12/12/2017 10:08 AM, Nikhil Agarwal wrote:
> This existing code cause the platform to start receiving packet
> immediately irrespective of interrupts available or not.
> If the platform does not support Rx interrupt, it shall not start
> receiving packets immediately. It shall let the timer management work.
>
> Fixes: aee3bc79cc34 ("examples/l3fwd-power: enable one-shot Rx interrupt and polling switch")
> Cc: stable@dpdk.org
> Cc: Danny Zhou <danny.zhou@intel.com>
> Cc: Cunming Liang <cunming.liang@intel.com>
>
> Signed-off-by: Nikhil Agarwal <nikhil.agarwal@linaro.org>
> ---
---snip---
Acked-by: David Hunt <david.hunt@intel.com>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [dpdk-stable] [PATCH 1/4] examples/l3fwd-power: fix non Rx intr supported platform
2017-12-13 14:21 ` [dpdk-stable] [PATCH 1/4] examples/l3fwd-power: fix non Rx intr supported platform Hunt, David
@ 2018-01-15 17:43 ` Thomas Monjalon
0 siblings, 0 replies; 5+ messages in thread
From: Thomas Monjalon @ 2018-01-15 17:43 UTC (permalink / raw)
To: Nikhil Agarwal
Cc: stable, Hunt, David, dev, nikhil.agarwal, hemant.agrawal,
Danny Zhou, Cunming Liang
13/12/2017 15:21, Hunt, David:
> On 12/12/2017 10:08 AM, Nikhil Agarwal wrote:
> > This existing code cause the platform to start receiving packet
> > immediately irrespective of interrupts available or not.
> > If the platform does not support Rx interrupt, it shall not start
> > receiving packets immediately. It shall let the timer management work.
> >
> > Fixes: aee3bc79cc34 ("examples/l3fwd-power: enable one-shot Rx interrupt and polling switch")
> > Cc: stable@dpdk.org
> > Cc: Danny Zhou <danny.zhou@intel.com>
> > Cc: Cunming Liang <cunming.liang@intel.com>
> >
> > Signed-off-by: Nikhil Agarwal <nikhil.agarwal@linaro.org>
> > ---
>
> ---snip---
>
> Acked-by: David Hunt <david.hunt@intel.com>
Series applied, thanks
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2018-01-15 17:43 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-12-12 10:08 [dpdk-stable] [PATCH 1/4] examples/l3fwd-power: fix non Rx intr supported platform Nikhil Agarwal
2017-12-12 10:08 ` [dpdk-stable] [PATCH 2/4] examples/l3fwd-power: fix the timer for any platform freq Nikhil Agarwal
2017-12-13 14:22 ` Hunt, David
2017-12-13 14:21 ` [dpdk-stable] [PATCH 1/4] examples/l3fwd-power: fix non Rx intr supported platform Hunt, David
2018-01-15 17:43 ` Thomas Monjalon
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).