|WARNING| [3/3] test/sched: check port survives config failure
dpdklab at iol.unh.edu
dpdklab at iol.unh.edu
Fri Nov 27 06:03:42 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 `rte_sched_pipe_config()` return documentation does not describe what the function does.
The text is copied from `rte_sched_subport_config()`:
```
+ * 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.
```
`rte_sched_pipe_config()` configures a pipe, not a subport. After this patch its error paths are plain `return -EINVAL;`, so no subport is rolled back or left unconfigured. The wording will mislead users into thinking a failed pipe config un-configures the subport.
Suggested fix: reword for pipe_config, for example: "On error, the port and subport stay valid and unchanged; the port is released by rte_sched_port_free() as usual."
**Patch 2/3: sched: reject API calls on unconfigured subport**
Info: two functions gain a new `-EINVAL` return without a doc update.
The patch adds this check to `rte_sched_subport_tc_ov_config()` and `rte_sched_subport_pipe_profile_add()`:
```
+ if (s == NULL) {
+ SCHED_LOG(ERR,
+ "%s: Subport is not configured", __func__);
+ return -EINVAL;
+ }
```
Their Doxygen `@return` text is not updated, unlike `read_stats` and `queue_read_stats`. Consider documenting the unconfigured-subport case consistently across all five functions.
**Patch 3/3: test/sched: check port survives config failure**
Info: on any failing assertion the test returns early and leaks `port`.
The port is created by `port = rte_sched_port_config(&port_param);`. Each `TEST_ASSERT_*` returns immediately on failure, so `rte_sched_port_free(port)` is skipped. This only matters when the test already fails, but a `goto` cleanup or a suite setup/teardown would avoid it.
Info: the new standalone test is registered directly with `REGISTER_FAST_TEST` rather than through `unit_test_suite_runner`. It could instead be added as a `TEST_CASE` in a suite alongside the existing sched test.
Review-Result: WARNING
More information about the test-report
mailing list