git.droids-corp.org
/
dpdk.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
event/octeontx: add dump function for easier debugging
[dpdk.git]
/
lib
/
librte_timer
/
rte_timer.c
diff --git
a/lib/librte_timer/rte_timer.c
b/lib/librte_timer/rte_timer.c
index
3f21f2d
..
18782fa
100644
(file)
--- a/
lib/librte_timer/rte_timer.c
+++ b/
lib/librte_timer/rte_timer.c
@@
-69,6
+69,9
@@
struct priv_timer {
unsigned prev_lcore; /**< used for lcore round robin */
unsigned prev_lcore; /**< used for lcore round robin */
+ /** running timer on this lcore now */
+ struct rte_timer *running_tim;
+
#ifdef RTE_LIBRTE_TIMER_DEBUG
/** per-lcore statistics */
struct rte_timer_debug_stats stats;
#ifdef RTE_LIBRTE_TIMER_DEBUG
/** per-lcore statistics */
struct rte_timer_debug_stats stats;
@@
-135,9
+138,12
@@
timer_set_config_state(struct rte_timer *tim,
while (success == 0) {
prev_status.u32 = tim->status.u32;
while (success == 0) {
prev_status.u32 = tim->status.u32;
- /* timer is running on another core, exit */
+ /* timer is running on another core
+ * or ready to run on local core, exit
+ */
if (prev_status.state == RTE_TIMER_RUNNING &&
if (prev_status.state == RTE_TIMER_RUNNING &&
- prev_status.owner != (uint16_t)lcore_id)
+ (prev_status.owner != (uint16_t)lcore_id ||
+ tim != priv_timer[lcore_id].running_tim))
return -1;
/* timer is being configured on another core */
return -1;
/* timer is being configured on another core */
@@
-581,6
+587,7
@@
void rte_timer_manage(void)
for (tim = run_first_tim; tim != NULL; tim = next_tim) {
next_tim = tim->sl_next[0];
priv_timer[lcore_id].updated = 0;
for (tim = run_first_tim; tim != NULL; tim = next_tim) {
next_tim = tim->sl_next[0];
priv_timer[lcore_id].updated = 0;
+ priv_timer[lcore_id].running_tim = tim;
/* execute callback function with list unlocked */
tim->f(tim, tim->arg);
/* execute callback function with list unlocked */
tim->f(tim, tim->arg);
@@
-606,11
+613,12
@@
void rte_timer_manage(void)
status.owner = (int16_t)lcore_id;
rte_wmb();
tim->status.u32 = status.u32;
status.owner = (int16_t)lcore_id;
rte_wmb();
tim->status.u32 = status.u32;
- __rte_timer_reset(tim,
cur_tim
e + tim->period,
+ __rte_timer_reset(tim,
tim->expir
e + tim->period,
tim->period, lcore_id, tim->f, tim->arg, 1);
rte_spinlock_unlock(&priv_timer[lcore_id].list_lock);
}
}
tim->period, lcore_id, tim->f, tim->arg, 1);
rte_spinlock_unlock(&priv_timer[lcore_id].list_lock);
}
}
+ priv_timer[lcore_id].running_tim = NULL;
}
/* dump statistics about timers */
}
/* dump statistics about timers */