Re: [PATCH] net: Optimize flush calculation in inet_gro_receive()

From: Eric Dumazet

Date: Tue Apr 14 2026 - 05:58:48 EST


On Tue, Apr 14, 2026 at 2:36 AM David Laight
<david.laight.linux@xxxxxxxxx> wrote:

> The network stack is supposed to ensure that all receive packets are
> aligned to that IP header is on a 4-byte boundary.
> This typically requires the ethernet receive buffer be 4n+2 aligned.
> Unfortunately there is some ethernet hardware that requires 4n aligned
> buffers (often on SoC devices with cpu that fault misaligned accesses).
> (Just writing two bytes of garbage before the frame solves the issue.)

This is mostly true, but depends on NET_IP_ALIGN,

On x86, this constant was changed to 0 back in 2010.

commit ea812ca1b06113597adcd8e70c0f84a413d97544
Author: Alexander Duyck <alexander.h.duyck@xxxxxxxxx>
Date: Tue Jun 29 18:38:00 2010 +0000

x86: Align skb w/ start of cacheline on newer core 2/Xeon Arch