Thread (42 messages) 42 messages, 7 authors, 2025-08-11

Re: [PATCH net-next v2 12/18] net: macb: match skb_reserve(skb, NET_IP_ALIGN) with HW alignment

From: Théo Lebrun <theo.lebrun@bootlin.com>
Date: 2025-08-07 15:44:38
Also in: linux-devicetree, linux-mips, linux-riscv, lkml

On Tue Jul 1, 2025 at 6:40 PM CEST, Sean Anderson wrote:
On 6/27/25 05:08, Théo Lebrun wrote:
quoted
If HW is RSC capable, it cannot add dummy bytes at the start of IP
Receive-side coalescing? Can you add a brief description of this
feature to your commit message?
Yes that is Receive Side Coalescing. Clearly it needs to be mentioned
out loud, and briefly described.
quoted
packets. Alignment (ie number of dummy bytes) is configured using the
RBOF field inside the NCFGR register.

On the software side, the skb_reserve(skb, NET_IP_ALIGN) call must only
be done if those dummy bytes are added by the hardware; notice the
skb_reserve() is done AFTER writing the address to the device.

We cannot do the skb_reserve() call BEFORE writing the address because
the address field ignores the low 2/3 bits. Conclusion: in some cases,
we risk not being able to respect the NET_IP_ALIGN value (which is
picked based on unaligned CPU access performance).

Fixes: 4df95131ea80 ("net/macb: change RX path for GEM")
Do any existing MACBs support RSC? Is this a fix? 
I have no idea. If any MACB supports RSC, it must be those running with
NET_IP_ALIGN=0, so arm64/powerpc/x86.

Is it a fix? We can guess that all boards fall in either category:
 - Don't support RSC (=> RBOF works fine).
 - Support RSC (=> RBOF not working) AND NET_IP_ALIGN=0.

Both of those are not impacted, so we technically don't fix anything for
current users.

Regards,

--
Théo Lebrun, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help