|SUCCESS| [1/1] log: add name query functions

dpdklab at iol.unh.edu dpdklab at iol.unh.edu
Thu Oct 22 21:37:30 CEST 2026


Test-Label: ai-code-review
Test-Status: SUCCESS
https://dpdk.org/patch/171873

_AI Code Review_

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

# DPDK Patch Review

## Errors

None.

## Warnings

None.

## Info

### Test Coverage

The test coverage in `app/test/test_logs.c` covers the new API functions well, including:
- Valid log level names
- Edge cases (level 0, UINT32_MAX)
- Valid log type names
- Invalid log type (UINT32_MAX)

The test correctly uses `TEST_ASSERT_NULL` for the invalid type case, matching the documented return value.

### Documentation

The documentation in `doc/guides/prog_guide/log_lib.rst` and release notes is clear and appropriate. The function documentation in `rte_log.h` correctly specifies:
- String ownership (owned by DPDK)
- String lifetime (process lifetime)
- That strings must not be modified or freed

### Implementation

The implementation in `lib/log/log.c` is straightforward:
- `rte_log_get_level_name()` delegates to existing `eal_log_level2str()`
- `rte_log_get_type_name()` performs bounds checking before array access
- Both functions return const char pointers as documented
- Export macros correctly specify version 26.11

The bounds check in `rte_log_get_type_name()` prevents out-of-bounds array access when an invalid type is passed.

---

This patch adds useful query functions for log level and type names with appropriate experimental marking, documentation, and test coverage. The implementation is safe and follows DPDK conventions.

Review-Result: CLEAN


More information about the test-report mailing list