|WARNING| hash: fix GFNI helpers for building with -O0
dpdklab at iol.unh.edu
dpdklab at iol.unh.edu
Wed Sep 30 11:04:05 CEST 2026
Test-Label: ai-code-review
Test-Status: WARNING
https://dpdk.org/patch/170359
_AI Code Review_
=== Patch Review: series.patch (via Claude) ===
Review date: 2026-09-30
# Review of DPDK Patch: hash: fix GFNI helpers for building with -O0
## Summary
This patch removes `__rte_internal` annotations from two static inline helper functions in `rte_thash_x86_gfni.h` that are used by public inline functions. The issue manifests when building with `-O0` where these helpers are not inlined, causing linkage failures.
---
## Findings
### **Errors**
None.
### **Warnings**
**1. Incomplete fix for GFNI helper visibility**
The patch removes `__rte_internal` from `__rte_thash_xor_reduce()` and `__rte_thash_gfni()`, but review of the file context shows there is a third static inline function `__rte_thash_gfni_stub()` that likely has the same issue. While not visible in the patch diff, if this function also has `__rte_internal` and is used by public inline functions, it will have the same `-O0` build failure.
Suggested action: Verify that `__rte_thash_gfni_stub()` (if it exists) does not have `__rte_internal`, or include its removal in this patch if it does.
**2. Missing update to rte_thash.h export macro**
The commit message references commit da31ef54c865 which fixed GFNI stubs export. That commit likely added `RTE_EXPORT_SYMBOL` macros for stub functions in the `.c` file. This patch removes `__rte_internal` from static inline helpers, but does not show any corresponding changes to symbol exports.
If these functions were previously marked for internal export (which `__rte_internal` suggests), verify that:
- No `.c` file has `RTE_EXPORT_INTERNAL_SYMBOL()` for these functions (would be wrong for static inline)
- The functions remain static inline and are not also defined in a `.c` file
Suggested action: Confirm no orphaned export macros exist for these symbols.
**3. Removal of rte_compat.h include may be premature**
The patch removes `#include <rte_compat.h>` along with the `__rte_internal` annotations. However, verify that no other part of this header or any inline function within it uses macros from `rte_compat.h` (such as `__rte_experimental`, `__rte_deprecated`, etc.).
If other annotations exist in the file that require `rte_compat.h`, the include should be retained.
Suggested action: Verify no other uses of `rte_compat.h` macros exist in `rte_thash_x86_gfni.h`.
---
### **Info**
**1. Pattern consistency with previous fix**
The commit message correctly references da31ef54c865 which fixed a similar issue with GFNI stubs. This suggests the codebase has a pattern of incorrectly annotating internal helpers used by public inline functions. Consider a tree-wide audit for this pattern:
```bash
git grep -A2 "__rte_internal" | grep -B1 "static inline"
```
This would catch any remaining instances of the same issue.
---
## Conclusion
The core fix (removing `__rte_internal` from static inline helpers) is correct and addresses a real build issue. The warnings are about ensuring completeness: verify that all affected helpers are fixed, no orphaned export symbols remain, and the include removal is safe.
The patch is functionally correct for the two functions shown. The suggested verifications are to ensure no related issues remain in the same file or codebase.
More information about the test-report
mailing list