net: fec: align IP header in hardware
authorEric Nelson <eric@nelint.com>
Sat, 24 Sep 2016 14:42:19 +0000 (07:42 -0700)
committerDavid S. Miller <davem@davemloft.net>
Tue, 27 Sep 2016 11:39:34 +0000 (07:39 -0400)
commit3ac72b7b63d57b231dda1e8f8d13872e0d7e8603
treedaf1ca189ea3eb820b243e1752a6be19bdbdfbfb
parent97dc499c1ae396bc0d529f5b1aef3138de1ae7de
net: fec: align IP header in hardware

The FEC receive accelerator (RACC) supports shifting the data payload of
received packets by 16-bits, which aligns the payload (IP header) on a
4-byte boundary, which is, if not required, at least strongly suggested
by the Linux networking layer.

Without this patch, a huge number of alignment faults will be taken by the
IP stack, as seen in /proc/cpu/alignment:

~/$ cat /proc/cpu/alignment
User: 0
System: 72645 (inet_gro_receive+0x104/0x27c)
Skipped: 0
Half: 0
Word: 0
DWord: 0
Multi: 72645
User faults: 3 (fixup+warn)

This patch was suggested by Andrew Lunn in this message to linux-netdev:
http://marc.info/?l=linux-arm-kernel&m=147465452108384&w=2

and adapted from a patch by Russell King from 2014:
http://git.arm.linux.org.uk/cgit/linux-arm.git/commit/?id=70d8a8a

Signed-off-by: Eric Nelson <eric@nelint.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/freescale/fec_main.c