|WARNING| examples/qos_sched: fix build with LTO
dpdklab at iol.unh.edu
dpdklab at iol.unh.edu
Tue Nov 10 03:37:47 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
### 1. VLA Still Present After Check
**File:** `examples/qos_sched/cfg_file.c`
**Line:** `struct rte_cfgfile_entry entries[n_entries];`
**Issue:** While the patch adds a check for negative `n_entries`, it still uses a variable-length array (VLA). VLAs are problematic because:
- They can cause stack overflow if `n_entries` is very large
- C11 made VLAs optional, and some compilers don't support them
- DPDK coding standards discourage VLAs in favor of dynamic allocation
**Suggested fix:** Use dynamic allocation instead:
```c
int n_entries = rte_cfgfile_section_num_entries(cfg, sec_name);
if (n_entries < 0)
return -1;
struct rte_cfgfile_entry *entries = malloc(n_entries * sizeof(*entries));
if (entries == NULL)
return -1;
rte_cfgfile_section_entries(cfg, sec_name, entries, n_entries);
/* ... use entries ... */
free(entries);
```
This requires adding the free on all exit paths from this code block.
---
## WARNINGS
None identified.
---
## INFO
### 1. Missing Release Notes Entry
The patch fixes a build failure with LTO, which is a significant fix that users and packagers would want to know about. Consider adding an entry to the current release notes under "Fixed Issues" mentioning the LTO build fix for qos_sched example.
---
Review-Result: ERROR
More information about the test-report
mailing list