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

dpdklab at iol.unh.edu dpdklab at iol.unh.edu
Mon Nov 2 09:05:28 CET 2026


Test-Label: ai-code-review
Test-Status: WARNING
https://dpdk.org/patch/172334

_AI Code Review_

=== Patch Review: series.patch (via Claude) ===
Review date: 2026-11-02

# DPDK Patch Review

## Patch 1/2: net/mana: fix Rx interrupt vector beyond device count

### ERRORS

None.

### WARNINGS

None.

### INFO

None.

---

## Patch 2/2: net/mana: fix Rx interrupt enable failing on lock contention

### ERRORS

**Error path resource leak:**

In `mana_reset_lock()` at line:

```c
pthread_mutex_lock(&priv->reset_ops_lock);

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;
```

If `pthread_mutex_lock()` fails (returns non-zero), the function continues to check `dev_state` and may return 0, indicating success when the lock was not acquired. The callers in `mana_rx_intr_enable_lock()` and `mana_rx_intr_disable_lock()` would then proceed to unlock a mutex they never locked, causing undefined behavior.

`pthread_mutex_lock()` can fail with `EDEADLK` (recursive lock attempt on a non-recursive mutex) or other error conditions depending on mutex attributes.

**Suggested fix:**

```c
static int
mana_reset_lock(struct mana_priv *priv)
{
	int ret;

	ret = pthread_mutex_lock(&priv->reset_ops_lock);
	if (ret != 0)
		return -ret;

	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;
}
```

---

Review-Result: ERROR


More information about the test-report mailing list