Subject: Re: [PATCH 4/5] r8169: more alignment for the 0x8168

From: Philip Craig <[email-masked]>
Date: Mon, 26 Feb 2007 17:42:27 +1000

Francois Romieu wrote:
> The experimental r8169 patch of the day against 2.6.21-rc1 is available at:
> http://www.fr.zoreil.com/linux/kernel/2.6.x/2.6.21-rc1/

Is 0006-r8169-confusion-between-hardware-and-IP-header-alignment.txt
the only relevant patch?

This only partially helps.  Many of the packets are greater than 200
bytes so copybreak doesn't apply to them.

Can we assume anything about the alignment of skb->data?  I think it
should be 4 byte aligned, otherwise the whole NET_IP_ALIGN thing
won't work.  All the drivers I looked at just reserve NET_IP_ALIGN
without checking the alignment first.

So can you do something like set align to 0 for RTL_CFG_0 and change
rtl8169_alloc_rx_skb() to:
	skb_reserve(skb, align ? (align - 1) & (u32)skb->data : NET_IP_ALIGN);

BTW, should the alignment expression be:
	(((u32)skb->data + (align - 1)) & ~(align - 1)) - (u32)skb->data