On Thu, 22 Jan 2026 10:12:54 +0000, Aleksandr Loktionov wrote:
> Thanks for the review, and agreed on the root cause.
> My motivation here was the mismatch between how the buffer is defined and
> how it’s consumed: the current cast-to-u32 * pattern felt brittle.
> Making the HIC buffer naturally 4-byte aligned is simpler and clearer for
> both readers and the compiler. Separately, while x86 will typically
> tolerate this, other architectures require natural alignment and may trap
> or penalize unaligned 32-bit accesses. So even if a crash hasn’t been
> reported, relying on 1-byte alignment for something treated as u32[] is
> not great practice across all supported arches. This change makes the
> layout explicitly safe. I’ll resend with a corrected commit message that
> focuses on alignment (not strict aliasing, given the kernel is built with 
> -fno-strict-aliasing).
> 
> ixgbe: fix unaligned u32 access in ixgbe_update_flash_X550()
> 
> ixgbe_host_interface_command() treats its buffer as a u32 array. The local
> buffer we pass in was a union of byte-sized fields, which gives it 1-byte
> alignment on the stack. On strict-align architectures this can cause
> unaligned 32-bit accesses.
> 
> Add a u32 member to union ixgbe_hic_hdr2 so the object is 4-byte aligned, and
> pass the u32 member when calling ixgbe_host_interface_command().
> 
> No functional change on x86; prevents unaligned accesses on architectures
> that enforce natural alignment.
> 
> Fixes: 49425dfc7451 ("ixgbe: Add support for x550em_a 10G MAC type")
> Signed-off-by: Aleksandr Loktionov <[email protected]>
> 
> What do you think?
> 
> Thanks!

LGTM, but do wait 24h after v1 before posting v2.

Regards,
Qingfang

Reply via email to