|WARNING| [v3,3/3] net/xsc: rename jumbo buffer fields

dpdklab at iol.unh.edu dpdklab at iol.unh.edu
Tue Nov 17 08:18:39 CET 2026


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

_AI Code Review_

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

**Patch 1/3: net/xsc: fix jumbo buffer allocation and leak**

**Error: shared jumbo buffer is freed on every per-representor close, while other ports may still DMA into it.**

`xsc_dev_close()` takes a `repr_id` and only stops the hardware for the last representor:

```c
	if (repr_id == xdev->num_repr_ports - 1)
		ret = xdev->dev_ops->dev_close(xdev);

	/* Removal closes the device again, do not free it twice. */
	rte_free(xdev->jumbo_buffer_pa);
	xdev->jumbo_buffer_pa = NULL;
```

The `rte_free()` runs unconditionally. Closing any non-last representor therefore releases `xdev->jumbo_buffer_pa` while the device is still running. The other ports' RQs still have WQEs whose second segment points at that buffer's IOVA, so the device can DMA into freed hugepage memory.

The next `xsc_rxq_initialize()` will also see `jumbo_buffer_pa == NULL` and allocate a new buffer. Queues initialised earlier keep pointing at the old, freed one.

This also contradicts the commit message, which says to free the buffer "once the hardware is stopped". Move the free inside the last-representor branch:

```c
	if (repr_id == xdev->num_repr_ports - 1) {
		ret = xdev->dev_ops->dev_close(xdev);
		rte_free(xdev->jumbo_buffer_pa);
		xdev->jumbo_buffer_pa = NULL;
	}
```

If only the NULL reset is needed to guard against double close, also clear `jumbo_buffer_va` (renamed `jumbo_iova` in 3/3) so no stale IOVA survives.

Review-Result: ERROR


More information about the test-report mailing list