|WARNING| [v2, 6/6] app/dumpcap: disable capture on the interface that failed

dpdklab at iol.unh.edu dpdklab at iol.unh.edu
Fri Nov 27 22:34:39 CET 2026


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

_AI Code Review_

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

**Patch 3/6 -- pdump: validate queues before installing callbacks**

**Error: the undo path can remove callbacks this request did not install.**

When enabling on `RTE_PDUMP_ALL_QUEUES`, `pdump_check_queues()` skips queues that already have a callback:

```c
		if (operation == ENABLE && cbs->cb != NULL) {
			if (all)
				continue;
```

The register loops skip those queues too. On failure, however, the undo calls:

```c
			pdump_register_rx_callbacks(p->ver, nb_rx_q, port, queue,
						    ring, mp, filter,
						    DISABLE, p->snaplen);
```

That disables every queue in range whose `cbs->cb != NULL`, including callbacks owned by an earlier capture session.

Example:
- Client A enables queue 1 explicitly.
- Client B then enables `ALL_QUEUES` on the same port, and the Tx registration fails.
- B's undo removes A's Rx callback on queue 1, and A silently stops capturing.

The same happens when the Rx registration fails part way. The Tx DISABLE is still issued, and it removes pre-existing Tx callbacks that this request never touched.

Fix: record which queues this request actually installed and undo only those. For example, keep a bitmap or a stop index, or compare `cbs->ring == ring` before disabling.

**Warning: behaviour change for `ALL_QUEUES` enable when some queues are already captured.**

Previously an `ALL_QUEUES` enable returned `-EEXIST` if any queue already had a callback. Now it silently installs on the remaining queues and returns success. The caller is not told that some queues are not being captured into its ring.

If this is intended, document it. Otherwise keep rejecting with `-EEXIST`. Hairpin queues are the only case that clearly warrants silent skipping.

**Patch 5/6 -- pdump: report secondary process failures**

**Error: the primary-side undo can remove other sessions' callbacks.**

```c
		undo.op = DISABLE;
		undo.prm = NULL;	/* no filter needed to remove callbacks */
		set_pdump_rxtx_cbs(&undo);
		pdump_request_to_secondary(&undo);
```

With `queue == RTE_PDUMP_ALL_QUEUES`, this DISABLE removes every installed callback on the port in the primary and in all secondaries. That includes callbacks belonging to another active capture, which the original ENABLE skipped. This is the same root cause as in patch 3. The undo needs to be scoped to the callbacks this request installed, for example by matching on `cbs->ring`.

**Info: reply payload length is not checked before it is read.**

```c
		const struct pdump_response *resp =
			(const struct pdump_response *)mp_reply.msgs[i].param;
```

`resp->err_value` is read without checking that `mp_reply.msgs[i].len_param >= sizeof(*resp)`. The peers are cooperating DPDK processes, so this is hardening only.

Review-Result: ERROR


More information about the test-report mailing list