|SUCCESS| sched: fix subport free on RED/PIE config failure

dpdklab at iol.unh.edu dpdklab at iol.unh.edu
Wed Nov 25 07:15:05 CET 2026


Test-Label: ai-code-review
Test-Status: SUCCESS
https://dpdk.org/patch/173140

_AI Code Review_

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

**Info**

1. Port leaked when a negative-test assertion fails (app/test/test_sched.c).

   In the three rejection cases, a failing `TEST_ASSERT_FAIL()` returns from `test_sched()` without freeing `port`. That happens if a regression makes `rte_sched_subport_config()` accept the bad parameters:

   ```c
   err = rte_sched_subport_config(port, SUBPORT, &sp, 0);
   TEST_ASSERT_FAIL(err, "Invalid RED configuration accepted\n");
   port = NULL;
   ```

   The same applies after `TEST_ASSERT_SUCCESS(err, "Valid RED configuration rejected\n");`.

   This only matters in a failing test run. If you want clean teardown, free the port before asserting in the accept-path case, for example:

   ```c
   if (err == 0)
           rte_sched_port_free(port);
   ```

   Alternatively, move these cases into separate test functions with setup/teardown.

2. The test depends on a known API defect.

   Setting `port = NULL;` after a rejected RED or qdelay_ref PIE configuration encodes the current behaviour, where the library frees the caller's port on a subport config error. The commit message already calls this a separate problem. A short comment at these two sites would help, so the test is updated when that behaviour is fixed. Otherwise the test will leak the port without any visible failure.

Review-Result: CLEAN


More information about the test-report mailing list