|WARNING| examples/qos_sched: fix build with LTO

dpdklab at iol.unh.edu dpdklab at iol.unh.edu
Tue Nov 10 03:47:11 CET 2026


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

_AI Code Review_

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

# DPDK Patch Review

## Errors

None identified.

## Warnings

### Missing release notes entry

The patch fixes a compilation issue with LTO but does not include a release notes entry. While this is primarily a fix for a compiler warning rather than a functional bug, compilation fixes are user-visible and should be documented.

**Suggested fix:** Add an entry to `doc/guides/rel_notes/release_NN_NN.rst` (where NN_NN is the current release):

```rst
* **Fixed qos_sched example build with LTO.**

  Fixed compilation warning when building the qos_sched example with
  Link Time Optimization (LTO) enabled, where gcc detected a potential
  negative VLA size.
```

## Info

### VLA still remains

The fix correctly handles the error case to prevent a negative VLA size, but the code still uses a Variable Length Array (VLA):

```c
struct rte_cfgfile_entry entries[n_entries];
```

VLAs can cause stack overflow if `n_entries` is very large, and some coding standards discourage them. Consider replacing with:

```c
struct rte_cfgfile_entry *entries;
entries = malloc(n_entries * sizeof(*entries));
if (entries == NULL)
    return -1;
/* ... use entries ... */
free(entries);
```

This is a pre-existing pattern in the example code, not introduced by this patch. The current fix is sufficient to resolve the immediate LTO build issue.

Review-Result: WARNING


More information about the test-report mailing list