|WARNING| [v2, 3/3] test/crypto: add unit test for Rx inject multi seg
dpdklab at iol.unh.edu
dpdklab at iol.unh.edu
Tue Jun 23 12:21:33 CEST 2026
Test-Label: ai-code-review
Test-Status: WARNING
https://dpdk.org/patch/165967
_AI Code Review_
=== Patch Review: series.patch (via Claude) ===
Review date: 2026-06-23
# DPDK Patch Review
## Patch 1/3: test/crypto: add asym autotest support for cn20k
**No issues found.**
---
## Patch 2/3: test/crypto: add autotest support for cn20k
**No issues found.**
---
## Patch 3/3: test/crypto: add unit test for Rx inject multi seg
### Errors
**Inappropriate use of RTE_ETH_RX_OFFLOAD_SCATTER in test setup**
In `ut_setup_security_rx_inject()`, the patch adds `RTE_ETH_RX_OFFLOAD_SCATTER` to the global port configuration. This is incorrect because:
1. The multi-segment test (`test_ipsec_proto_known_vec_inb_rx_inject_multi_seg`) uses `flags.nb_segs_in_mbuf = 4`, which already causes the test framework to prepare multi-segment input mbufs
2. Scatter Rx is a receive-path offload for hardware to *produce* multi-segment mbufs when incoming packets exceed buffer size - not related to testing with already-segmented input
3. Enabling scatter unconditionally affects all tests using this setup function, not just the multi-segment test
The existing setup function is used by the single-segment test `test_ipsec_proto_known_vec_inb_rx_inject` (line 18407-18411), which now has scatter needlessly enabled.
**Suggested fix:**
Either create a separate setup function for the multi-segment test, or remove the `RTE_ETH_RX_OFFLOAD_SCATTER` addition entirely since `flags.nb_segs_in_mbuf` already controls the test behavior:
```c
/* Option 1: Remove the offload flag entirely */
struct rte_eth_conf port_conf = {
.rxmode = {
.offloads = RTE_ETH_RX_OFFLOAD_CHECKSUM |
RTE_ETH_RX_OFFLOAD_SECURITY,
},
/* ... */
};
/* Option 2: Create a dedicated setup function */
static int
ut_setup_security_rx_inject_multi_seg(void)
{
/* enable scatter only here */
}
TEST_CASE_NAMED_WITH_DATA(
"Inbound known vector (ESP tunnel mode IPv4 AES-GCM 128) Rx inject multi seg",
ut_setup_security_rx_inject_multi_seg, ut_teardown_rx_inject,
test_ipsec_proto_known_vec_inb_rx_inject_multi_seg, &pkt_aes_128_gcm),
```
---
### Warnings
**Trailing blank line in test case list**
Line 18415 contains an empty line before `TEST_CASES_END()`. DPDK test suites typically do not have blank lines between test cases.
**Suggested fix:**
Remove the blank line:
```c
TEST_CASE_NAMED_WITH_DATA(
"Inbound known vector (ESP tunnel mode IPv4 AES-GCM 128) Rx inject multi seg",
ut_setup_security_rx_inject, ut_teardown_rx_inject,
test_ipsec_proto_known_vec_inb_rx_inject_multi_seg, &pkt_aes_128_gcm),
TEST_CASES_END() /**< NULL terminate unit test array */
```
---
## Summary
- **Patches 1/3 and 2/3**: Clean, no issues
- **Patch 3/3**: One correctness error (inappropriate scatter offload in shared setup function) and one minor style warning (trailing blank line)
More information about the test-report
mailing list