|WARNING| [3/3] test/sched: check port survives config failure
dpdklab at iol.unh.edu
dpdklab at iol.unh.edu
Fri Nov 27 07:46:59 CET 2026
Test-Label: ai-code-review
Test-Status: WARNING
https://dpdk.org/patch/173266
_AI Code Review_
=== Patch Review: series.patch (via Claude) ===
Review date: 2026-11-27
**Patch 1/3: sched: keep port valid on subport and pipe config failure**
Warning: the new `@return` text for `rte_sched_pipe_config()` describes subport behaviour that this function does not have.
```
+ * 0 upon success, negative error code otherwise. On error, the port
+ * scheduler instance stays valid and is released by
+ * rte_sched_port_free() as usual. The subport whose configuration
+ * failed stays unconfigured and the call can be repeated with
+ * corrected parameters. The subports configured before the failed
+ * call keep their configuration, statistics and queued packets.
```
This paragraph was copied verbatim from `rte_sched_subport_config()`. `rte_sched_pipe_config()` never configures or rolls back a subport. On error it simply returns without touching the subport or the pipe. Saying "the subport whose configuration failed stays unconfigured" is wrong for this function and could mislead users into thinking a pipe-config failure unconfigures the subport.
Suggested fix: reword it for pipes, for example: "On error, the port scheduler instance and the subport stay valid and unchanged, and the call can be repeated with corrected parameters."
**Patch 3/3: test/sched: check port survives config failure**
Info: in `test_sched_config_error()`, every `TEST_ASSERT_*` after `rte_sched_port_config()` returns early without calling `rte_sched_port_free(port)`. A failing assertion therefore leaks the port.
```
+ err = rte_sched_subport_config(port, SUBPORT, &sp,
+ MAX_SCHED_SUBPORT_PROFILES);
+ TEST_ASSERT_FAIL(err, "Out of range subport profile accepted\n");
```
Consider routing failures through a cleanup label that frees the port. Alternatively, use a `unit_test_suite_runner` suite with setup and teardown.
Review-Result: WARNING
More information about the test-report
mailing list