|SUCCESS| [v3] sched: fix infinite loop in rational approximation

dpdklab at iol.unh.edu dpdklab at iol.unh.edu
Thu Nov 26 11:36:09 CET 2026


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

_AI Code Review_

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

No Errors or Warnings were found in this patch.

**Info**

1. **Behaviour change could go in the release notes.**
   `rte_approx()` now rejects any `d` below 1e-4, and `rte_approx_64()` rejects any `d` below 1e-9. The new guard is:
   ```
   +	if (denum > UINT32_MAX / denum)
   +		return -1;
   ```
   Some requests in these ranges may previously have returned a result, even if an unreliable one, rather than hanging.
   - The Doxygen update documents the new limit.
   - A short line in the current release notes "Bug Fixes" or "API Changes" section would help external callers of the public `rte_approx()` notice it.

2. **Pre-existing: `rte_approx_64()` is not exported.**
   This was not introduced by this patch, and the commit message already mentions it. `rte_approx_64()` is declared in the installed header `rte_approx.h`:
   ```
   int rte_approx_64(double alpha, double d, uint64_t *p, uint64_t *q);
   ```
   - It has no `RTE_EXPORT_*` annotation, so shared-library users cannot link against it.
   - A separate patch could either add the export or stop declaring it in the public header.
   - Either change would also let `sched_approx_autotest` cover the 64-bit guards.

3. **Doubled newline in test messages (minor).**
   The new assertion messages end in `"\n"`, for example:
   ```
   +	TEST_ASSERT_FAIL(err, "rte_approx accepted unrepresentable d\n");
   ```
   The `TEST_ASSERT_*` macros already append a newline, so each failure message prints an extra blank line. Dropping the trailing `\n` would tidy the output.

Review-Result: CLEAN


More information about the test-report mailing list