|SUCCESS| net/bnxt/tf_ulp: use 64-bit shift in burst size calculation
dpdklab at iol.unh.edu
dpdklab at iol.unh.edu
Tue Sep 15 20:39:33 CEST 2026
Test-Label: ai-code-review
Test-Status: SUCCESS
https://dpdk.org/patch/169574
_AI Code Review_
=== Patch Review: series.patch (via Claude) ===
Review date: 2026-09-15
# DPDK Patch Review
## Patch Summary
The patch fixes a potential left-shift undefined behavior in the bnxt PMD meter code by changing `1 << n` to `1ULL << n` when calculating burst size parameters.
---
## Findings
### **Errors**
None.
### **Warnings**
None.
### **Info**
1. **Second shift operand also needs 64-bit literal**
The fix correctly changes the first `1 << (e - 8)` to `1ULL << (e - 8)`, but the second shift `1 << 7` should also be changed to `1ULL << 7` for consistency and to ensure the entire expression is evaluated in 64-bit arithmetic.
The current fix:
```c
m = xbs / (1ULL << (e - 8)) - (1 << 7);
```
More consistent form:
```c
m = xbs / (1ULL << (e - 8)) - (1ULL << 7);
```
While `1 << 7` is safe (shift count is 7, well below 32), using `1ULL` consistently makes the intent clearer that this is 64-bit arithmetic, since `xbs` is `int64_t` and the division result will be 64-bit.
---
## Summary
The patch correctly addresses the primary issue (undefined behavior when `e - 8 >= 32`). The suggested change to use `1ULL << 7` is a consistency improvement, not a correctness bug, since the shift count is constant and safe. The patch is acceptable as-is, but using `1ULL` for both shifts would be more consistent.
More information about the test-report
mailing list