|SUCCESS| [2/2] test: add test for IPv6 fragmentation id

dpdklab at iol.unh.edu dpdklab at iol.unh.edu
Sat Nov 21 18:22:20 CET 2026


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

_AI Code Review_

=== Patch Review: series.patch (via Claude) ===
Review date: 2026-11-21

**Patch 1/2: ip_frag: generate a fragment identification for IPv6**

Info: `rte_rand()` does not give the unpredictability that the new comment and commit message claim from RFC 7739.
```
frag_id = (rte_be32_t)rte_rand();
```
`rte_rand()` is a linear LFSR, so an off-path observer who collects enough fragment IDs can recover the per-lcore state. From there they can predict future IDs, which is the inference RFC 7739 is meant to prevent.

The change does fix the RFC 8200 per-packet distinctness problem. If unpredictability is a stated goal, consider one of these:
- a keyed hash of (src, dst, secret, counter), similar to Linux's siphash-based IPv6 ID selection; or
- softening the comment so it does not claim RFC 7739 compliance.

**Patch 2/2: test: add test for IPv6 fragmentation id**

Info: the fragments leak when the length assertion fails with a positive count other than 2.
```
RTE_TEST_ASSERT_EQUAL(len, 2, "Failed to fragment packet %zd.",
		      i);
```
If `rte_ipv6_fragment_packet()` returns 1 or 3, the assertion returns before `test_free_fragments(pkts_out, len)` runs. Those fragment mbufs stay held from `direct_pool`/`indirect_pool`. Free them first when `len > 0`:
```c
if (len != 2) {
	if (len > 0)
		test_free_fragments(pkts_out, len);
	RTE_TEST_ASSERT(0, "Failed to fragment packet %zu.", i);
}
```

Info: `i` is `size_t`, so the format strings `"Failed to fragment packet %zd."` and `"Fragments of packet %zd differ in id."` should use `%zu`, not `%zd`.

Review-Result: CLEAN


More information about the test-report mailing list