|WARNING| net/ice: add chip temperature to xstats

dpdklab at iol.unh.edu dpdklab at iol.unh.edu
Mon Oct 12 16:08:31 CEST 2026


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

_AI Code Review_

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

# Review of DPDK Patch: net/ice: add chip temperature to xstats

## ERRORS

None.

## WARNINGS

**1. Missing release notes update context**

The documentation states "The patch is based on dpdk-next-net-intel; on main only the release notes context differs." However, the release notes addition appears to be a single line without surrounding context issues visible in the diff. If this causes merge conflicts or incorrect placement, consider rebasing or providing clearer documentation about the context difference.

**Why it matters:** Release notes must be placed in the correct section to avoid merge issues and maintain documentation quality.

**Suggested fix:** Verify the release notes change applies cleanly to the target branch and is in the appropriate section.

**2. Extended statistics do not use standard units convention**

The naming `chip_temperature_celsius` places the unit at the end, but DPDK extended statistics typically use more compact forms or follow device-specific conventions. The ICE PMD should verify this follows existing DPDK extended statistics naming patterns.

**Why it matters:** Consistency in naming across PMDs aids application portability and user expectations.

**Suggested fix:** Verify against other PMD extended statistics naming. If no temperature statistics exist yet in DPDK, document this as establishing a convention. The current naming is acceptable but should be confirmed as the intended standard.

**3. Temperature statistics appear at every PF despite kernel driver registering only on PF 0**

The patch notes: "Unlike the kernel driver, which registers the sensor on PF 0 only, every PF reports it, since a DPDK application may own only some ports of a device."

**Why it matters:** This divergence from kernel behavior should be explicitly justified in the code documentation, not just the commit message, so future maintainers understand the design choice.

**Suggested fix:** Add a comment in `ice_update_temp_stats()` or near the capability check explaining why each PF independently reports the temperature, unlike the kernel driver.

## INFO

**1. Temperature value truncation behavior**

Line 7314 performs a check and cast:
```c
ts->temp = resp.data.s0f0.temp > 0 ? (uint64_t)resp.data.s0f0.temp : 0;
```

This clamps negative temperatures to 0 rather than reporting them. The comment says "report below zero as 0" but doesn't explain why. If the firmware can legitimately report sub-zero temperatures (cold storage, testing environments), clamping loses information. If it cannot, the check is defensive but the rationale should be documented.

**Suggested consideration:** Document whether sub-zero temperatures are possible and if so, whether clamping to 0 is the intended behavior or if a different representation (e.g., keeping the sign, or adding an error indicator) would be more useful.

**2. One-second cache duration hardcoded**

Line 7300:
```c
if (pf->temp_read_tsc != 0 &&
    now - pf->temp_read_tsc < rte_get_timer_hz())
```

The 1-second cache duration is reasonable for temperature monitoring but is hardcoded. If polling patterns change or different use cases emerge, this may need adjustment. Consider whether this should be configurable or at least documented as a tunable constant.

**Suggested consideration:** Define `ICE_TEMP_CACHE_SECONDS` or similar constant at file scope to make the cache duration explicit and easier to adjust.

**3. Structure layout and padding**

`struct ice_temp_stats` (lines 7551-7555) contains four `uint64_t` fields with no padding concerns. The structure is well-aligned and cache-friendly. No issue here, just noting the layout is appropriate.

**4. Testing coverage noted in commit message**

The commit notes indicate testing on E810-XXV but not on firmware without sensor capability or E830. While comprehensive testing on all hardware variants is ideal, the code handles the capability check correctly (lines 7326-7328) by only adding the statistics when `ice_temp_sensor_supported()` returns true. The untested paths appear safe but should be validated when hardware becomes available.

**5. Documentation quality**

The RST documentation in `doc/guides/nics/ice.rst` is clear and well-structured. The usage example with testpmd is helpful. The explanation of the 1-second caching and failure behavior (all values 0) gives users the information needed to interpret the statistics correctly.

## SUMMARY

The patch introduces chip temperature reporting for Intel E810 NICs through extended statistics. The implementation correctly:

- Uses the existing base driver admin queue command infrastructure
- Caches readings to avoid firmware overload
- Handles missing capability gracefully
- Documents the feature appropriately
- Follows DPDK coding style

The warnings relate to documentation and design choices that should be clarified but do not indicate correctness bugs. The implementation is sound for the tested hardware and degrades gracefully when the capability is not present.

Review-Result: WARNING


More information about the test-report mailing list