|WARNING| [v2] test/event_eth_tx_adapter: skip tests if no eventdev
dpdklab at iol.unh.edu
dpdklab at iol.unh.edu
Tue Jul 21 15:50:16 CEST 2026
Test-Label: ai-code-review
Test-Status: WARNING
https://dpdk.org/patch/166846
_AI Code Review_
=== Patch Review: series.patch (via Claude) ===
Review date: 2026-07-21
# DPDK Patch Review
## Summary
This patch modifies the event eth tx adapter test to skip tests when no eventdev is present and the SW eventdev driver is unavailable, rather than failing. The change improves test robustness in configurations without event devices.
## Review Findings
### Errors
None found.
### Warnings
**1. Preprocessor conditional in control flow (Warning)**
The new `#ifdef RTE_EVENT_SW` splits the control flow of `testsuite_setup()` across preprocessor conditionals. This pattern can reduce code clarity and makes the function behavior dependent on compile-time configuration in a way that could be refactored.
**Current code:**
```c
if (rte_event_dev_count() == 0) {
#ifdef RTE_EVENT_SW
const char *vdev_name = "event_sw0";
/* ... create device ... */
event_dev_delete = 1;
#else
printf("Failed to find a valid event device, skipping test\n");
return TEST_SKIPPED;
#endif
}
```
**Suggested alternative (cleaner structure):**
```c
if (rte_event_dev_count() == 0) {
if (!create_sw_eventdev()) {
printf("Failed to find a valid event device, skipping test\n");
return TEST_SKIPPED;
}
event_dev_delete = 1;
}
/* Helper function (static) */
static bool
create_sw_eventdev(void)
{
#ifdef RTE_EVENT_SW
const char *vdev_name = "event_sw0";
int err = rte_vdev_init(vdev_name, NULL);
if (err != 0) {
printf("vdev %s creation failed %d\n", vdev_name, err);
return false;
}
return true;
#else
return false;
#endif
}
```
This refactoring:
- Reduces nesting of preprocessor conditionals in the main function
- Makes the success/failure logic clearer at the call site
- Isolates the compile-time conditional to a helper function
- Returns `bool` for the yes/no question "did we create a device?"
However, this is a minor style preference. The current approach is acceptable, just less clean. This is a **Warning** not an **Error**.
### Info
None.
## Conclusion
The patch is correct and achieves its stated goal of skipping tests when no eventdev is available. The logic is sound: check for existing devices, attempt to create SW eventdev if built, otherwise skip. The only suggestion is a structural one to improve readability, which is optional.
More information about the test-report
mailing list