Code Review
/
deb_dpdk.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
New upstream version 17.11.1
[deb_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
43da836
..
ba436cd
100644
(file)
--- a/
lib/librte_timer/rte_timer.c
+++ b/
lib/librte_timer/rte_timer.c
@@
-43,14
+43,13
@@
#include <rte_cycles.h>
#include <rte_per_lcore.h>
#include <rte_memory.h>
#include <rte_cycles.h>
#include <rte_per_lcore.h>
#include <rte_memory.h>
-#include <rte_memzone.h>
#include <rte_launch.h>
#include <rte_eal.h>
#include <rte_launch.h>
#include <rte_eal.h>
-#include <rte_per_lcore.h>
#include <rte_lcore.h>
#include <rte_branch_prediction.h>
#include <rte_spinlock.h>
#include <rte_random.h>
#include <rte_lcore.h>
#include <rte_branch_prediction.h>
#include <rte_spinlock.h>
#include <rte_random.h>
+#include <rte_pause.h>
#include "rte_timer.h"
#include "rte_timer.h"
@@
-183,7
+182,7
@@
timer_set_running_state(struct rte_timer *tim)
return -1;
/* here, we know that timer is stopped or pending,
return -1;
/* here, we know that timer is stopped or pending,
- * mark it atomically as be
e
ing configured */
+ * mark it atomically as being configured */
status.state = RTE_TIMER_RUNNING;
status.owner = (int16_t)lcore_id;
success = rte_atomic32_cmpset(&tim->status.u32,
status.state = RTE_TIMER_RUNNING;
status.owner = (int16_t)lcore_id;
success = rte_atomic32_cmpset(&tim->status.u32,
@@
-196,7
+195,7
@@
timer_set_running_state(struct rte_timer *tim)
/*
* Return a skiplist level for a new entry.
/*
* Return a skiplist level for a new entry.
- * This probab
a
listically gives a level with p=1/4 that an entry at level n
+ * This probab
i
listically gives a level with p=1/4 that an entry at level n
* will also appear at level n+1.
*/
static uint32_t
* will also appear at level n+1.
*/
static uint32_t
@@
-432,7
+431,8
@@
rte_timer_reset(struct rte_timer *tim, uint64_t ticks,
uint64_t period;
if (unlikely((tim_lcore != (unsigned)LCORE_ID_ANY) &&
uint64_t period;
if (unlikely((tim_lcore != (unsigned)LCORE_ID_ANY) &&
- !rte_lcore_is_enabled(tim_lcore)))
+ !(rte_lcore_is_enabled(tim_lcore) ||
+ rte_lcore_has_role(tim_lcore, ROLE_SERVICE) == 0)))
return -1;
if (type == PERIODICAL)
return -1;
if (type == PERIODICAL)
@@
-525,7
+525,7
@@
void rte_timer_manage(void)
return;
cur_time = rte_get_timer_cycles();
return;
cur_time = rte_get_timer_cycles();
-#ifdef RTE_ARCH_
X86_
64
+#ifdef RTE_ARCH_64
/* on 64-bit the value cached in the pending_head.expired will be
* updated atomically, so we can consult that for a quick check here
* outside the lock */
/* on 64-bit the value cached in the pending_head.expired will be
* updated atomically, so we can consult that for a quick check here
* outside the lock */
@@
-613,7
+613,7
@@
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);
}