[PATCH 2/2] net/mana: fix Rx interrupt enable failing on lock contention

Stephen Hemminger stephen at networkplumber.org
Tue Nov 10 15:33:21 CET 2026


On Mon,  9 Nov 2026 14:02:07 +0000
Orgad Shaneh <orgads at gmail.com> wrote:

> static int
> mana_reset_lock(struct mana_priv *priv)
> {
> 	while (pthread_mutex_trylock(&priv->reset_ops_lock)) {
> 		if (rte_atomic_load_explicit(&priv->dev_state,
> 		    rte_memory_order_relaxed) != MANA_DEV_ACTIVE)
> 			return -EBUSY;
> 		rte_pause();
> 	}

You need to use pthread_yield(), rte_pause only generates a CPU rep nop
which yields to other hyper thread if it is another process need
to cause yield in cpu scheduler. 

> 
> 	if (rte_atomic_load_explicit(&priv->dev_state,
> 	    rte_memory_order_acquire) != MANA_DEV_ACTIVE) {
> 		pthread_mutex_unlock(&priv->reset_ops_lock);
> 		return -EBUSY;
> 	}
> 	return 0;
> }


More information about the dev mailing list