src/dpdk/lib/librte_timer/rte_timer.c
static void
timer_del(struct rte_timer *tim, union rte_timer_status prev_status,
	  int local_is_locked, struct priv_timer *priv_timer)
{
	unsigned lcore_id = rte_lcore_id();
	unsigned prev_owner = prev_status.owner;
	int i;
	struct rte_timer *prev[MAX_SKIPLIST_DEPTH+1];

	/* if timer needs is pending another core, we need to lock the
	 * list; if it is on local core, we need to lock if we are not
	 * called from rte_timer_manage() */
	if (prev_owner != lcore_id || !local_is_locked)
		rte_spinlock_lock(&priv_timer[prev_owner].list_lock);

	/* save the lowest list entry into the expire field of the dummy hdr.
	 * NOTE: this is not atomic on 32-bit */
	if (tim == priv_timer[prev_owner].pending_head.sl_next[0])
		priv_timer[prev_owner].pending_head.expire =
				((tim->sl_next[0] == NULL) ? 0 : tim->sl_next[0]->expire);

	/* adjust pointers from previous entries to point past this */
	timer_get_prev_entries_for_node(tim, prev_owner, prev, priv_timer);
	for (i = priv_timer[prev_owner].curr_skiplist_depth - 1; i >= 0; i--) {
		if (prev[i]->sl_next[i] == tim)
			prev[i]->sl_next[i] = tim->sl_next[i];
	}

	/* in case we deleted last entry at a level, adjust down max level */
	for (i = priv_timer[prev_owner].curr_skiplist_depth - 1; i >= 0; i--)
		if (priv_timer[prev_owner].pending_head.sl_next[i] == NULL)
			priv_timer[prev_owner].curr_skiplist_depth --;
		else
			break;

	if (prev_owner != lcore_id || !local_is_locked)
		rte_spinlock_unlock(&priv_timer[prev_owner].list_lock);
}
/*
 * del from list, lock if needed
 * timer must be in config state
 * timer must be in a list
 */
del from list, lock if needed
timer must be in config state
timer must be in a list
del from list lock if needed timer must be in config state timer must be in a list
static void
timer_del(struct rte_timer *tim, union rte_timer_status prev_status,
	  int local_is_locked, struct priv_timer *priv_timer)
{
	unsigned lcore_id = rte_lcore_id();
	unsigned prev_owner = prev_status.owner;
	int i;
	struct rte_timer *prev[MAX_SKIPLIST_DEPTH+1];
	if (prev_owner != lcore_id || !local_is_locked)
		rte_spinlock_lock(&priv_timer[prev_owner].list_lock);
	if (tim == priv_timer[prev_owner].pending_head.sl_next[0])
		priv_timer[prev_owner].pending_head.expire =
				((tim->sl_next[0] == NULL) ? 0 : tim->sl_next[0]->expire);
	timer_get_prev_entries_for_node(tim, prev_owner, prev, priv_timer);
	for (i = priv_timer[prev_owner].curr_skiplist_depth - 1; i >= 0; i--) {
		if (prev[i]->sl_next[i] == tim)
			prev[i]->sl_next[i] = tim->sl_next[i];
	}
	for (i = priv_timer[prev_owner].curr_skiplist_depth - 1; i >= 0; i--)
		if (priv_timer[prev_owner].pending_head.sl_next[i] == NULL)
			priv_timer[prev_owner].curr_skiplist_depth --;
		else
			break;
	if (prev_owner != lcore_id || !local_is_locked)
		rte_spinlock_unlock(&priv_timer[prev_owner].list_lock);
}
static void timer_del ( struct rte_timer * tim , union rte_timer_status prev_status , int local_is_locked , struct priv_timer * priv_timer ) { unsigned lcore_id = rte_lcore_id ( ) ; unsigned prev_owner = prev_status . owner ; int i ; struct rte_timer * prev [ MAX_SKIPLIST_DEPTH + 1 ] ; if ( prev_owner != lcore_id || ! local_is_locked ) rte_spinlock_lock ( & priv_timer [ prev_owner ] . list_lock ) ; if ( tim == priv_timer [ prev_owner ] . pending_head . sl_next [ 0 ] ) priv_timer [ prev_owner ] . pending_head . expire = ( ( tim -> sl_next [ 0 ] == NULL ) ? 0 : tim -> sl_next [ 0 ] -> expire ) ; timer_get_prev_entries_for_node ( tim , prev_owner , prev , priv_timer ) ; for ( i = priv_timer [ prev_owner ] . curr_skiplist_depth - 1 ; i >= 0 ; i -- ) { if ( prev [ i ] -> sl_next [ i ] == tim ) prev [ i ] -> sl_next [ i ] = tim -> sl_next [ i ] ; } for ( i = priv_timer [ prev_owner ] . curr_skiplist_depth - 1 ; i >= 0 ; i -- ) if ( priv_timer [ prev_owner ] . pending_head . sl_next [ i ] == NULL ) priv_timer [ prev_owner ] . curr_skiplist_depth -- ; else break ; if ( prev_owner != lcore_id || ! local_is_locked ) rte_spinlock_unlock ( & priv_timer [ prev_owner ] . list_lock ) ; }
del from list, lock if needed
 timer must be in config state
 timer must be in a list
del from list lock if needed timer must be in config state timer must be in a list
/* if timer needs is pending another core, we need to lock the
	 * list; if it is on local core, we need to lock if we are not
	 * called from rte_timer_manage() */ /* save the lowest list entry into the expire field of the dummy hdr.
	 * NOTE: this is not atomic on 32-bit */ /* adjust pointers from previous entries to point past this */ /* in case we deleted last entry at a level, adjust down max level */