/*-
* BSD LICENSE
*
- * Copyright(c) 2010-2012 Intel Corporation. All rights reserved.
+ * Copyright(c) 2010-2013 Intel Corporation. All rights reserved.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
- * version: DPDK.L.1.2.3-3
*/
#include <string.h>
static void
timer_add(struct rte_timer *tim, unsigned tim_lcore, int local_is_locked)
{
- uint64_t cur_time = rte_get_hpet_cycles();
+ uint64_t cur_time = rte_get_timer_cycles();
unsigned lcore_id = rte_lcore_id();
struct rte_timer *t, *t_prev;
enum rte_timer_type type, unsigned tim_lcore,
rte_timer_cb_t fct, void *arg)
{
- uint64_t cur_time = rte_get_hpet_cycles();
+ uint64_t cur_time = rte_get_timer_cycles();
uint64_t period;
if (unlikely((tim_lcore != (unsigned)LCORE_ID_ANY) &&
void
rte_timer_stop_sync(struct rte_timer *tim)
{
- while (rte_timer_stop(tim) != 0);
+ while (rte_timer_stop(tim) != 0)
+ rte_pause();
}
/* Test the PENDING status of the timer handle tim */
union rte_timer_status status;
struct rte_timer *tim, *tim2;
unsigned lcore_id = rte_lcore_id();
- uint64_t cur_time = rte_get_hpet_cycles();
+ uint64_t cur_time;
int ret;
__TIMER_STAT_ADD(manage, 1);
+ /* optimize for the case where per-cpu list is empty */
+ if (LIST_EMPTY(&priv_timer[lcore_id].pending))
+ return;
+ cur_time = rte_get_timer_cycles();
/* browse ordered list, add expired timers in 'expired' list */
rte_spinlock_lock(&priv_timer[lcore_id].list_lock);