|WARNING| [2/2] net/ixgbe: replace memcpy with structure assignment

dpdklab at iol.unh.edu dpdklab at iol.unh.edu
Tue Jul 28 17:11:04 CEST 2026


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

_AI Code Review_

=== Patch Review: series.patch (via Claude) ===
Review date: 2026-07-28

# DPDK Patch Review

## PATCH 1/2: net/sxe2: replace memcpy with structure assignment

### Errors

None identified.

### Warnings

None identified.

### Info

**sxe2_flow.c line 419, 440, 700:**
The pattern of `rte_memcpy(dst, src, sizeof(struct sxe2_flow))` - `*dst = *src` is correct.
The struct assignment preserves type safety and allows the compiler to optimize based on structure layout.

**sxe2_ipsec.c line 1162:**
Replacing `memcpy(md, &src, sizeof(struct sxe2_ipsec_pkt_metadata))` with `*md = src` is correct.
The subsequent field assignment `md->esp_head_offset = offset;` confirms `md` points to the destination structure
and is not overwritten.

---

## PATCH 2/2: net/ixgbe: replace memcpy with structure assignment

### Errors

None identified.

### Warnings

None identified.

### Info

**ixgbe_flow.c lines 2869, 2891, 2911, 2946, 2964:**
Replacing `memcpy(&ptr->filter_info, &filter, sizeof(...))` with `ptr->filter_info = filter` is correct.
These are assignments from stack variables into allocated structures during flow creation.

**ixgbe_flow.c lines 3117, 3125, 3134, 3141, 3156:**
Replacing `memcpy(&filter, &ptr->filter_info, sizeof(...))` with `filter = ptr->filter_info` is correct.
These are assignments from allocated structures into stack variables during flow destruction,
immediately followed by delete operations that pass `&filter` by reference.
The filter variable is live throughout the delete operation, so there is no lifetime issue.

---

## Summary

Both patches correctly replace type-unsafe `memcpy()` calls with structure assignments.
The transformations preserve semantics and improve type safety.
No correctness bugs, style violations, or guideline issues identified.


More information about the test-report mailing list