[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <063D6719AE5E284EB5DD2968C1650D6D1CCD25A8@AcuExch.aculab.com>
Date: Mon, 1 Feb 2016 16:50:29 +0000
From: David Laight <David.Laight@...LAB.COM>
To: 'David Miller' <davem@...emloft.net>,
"alexander.duyck@...il.com" <alexander.duyck@...il.com>
CC: "eric.dumazet@...il.com" <eric.dumazet@...il.com>,
"sowmini.varadhan@...cle.com" <sowmini.varadhan@...cle.com>,
"aduyck@...antis.com" <aduyck@...antis.com>,
"netdev@...r.kernel.org" <netdev@...r.kernel.org>,
"tom@...bertland.com" <tom@...bertland.com>
Subject: RE: [net PATCH] flow_dissector: Fix unaligned access in
__skb_flow_dissector when used by eth_get_headlen
From: David Miller
> Sent: 31 January 2016 03:45
> To: alexander.duyck@...il.com
...
> > I would really prefer to keep the pages DMA aligned, and the skb->data
> > IP aligned. If nothing else it has the advantage of actually having
> > the proper alignment on all the headers if I only pull the outer
> > headers and leave the inner headers in the page.. :-/
>
> I am unconvinced by your arguments. People getting hit by these
> arguments don't care. For those not hitting the problem, nothing is
> going to change.
>
> x86 uses NET_IP_ALIGN==0, and therefore nothing will change for the
> only platform people care a lot about. PowerPC too.
>
> For platforms with NET_IP_ALIGN==2 or similar, all of these cases
> where 1K extra buffer is allocator or _whatever_ other side effect you
> think is such as huge deal... trust me it's _nothing_ compared to the
> alternative:
>
> 1) Unaligned accesses
Remember the even if you do a 'realignment copy' of the IP header,
at some point the 'userdata' of the packet has to be accessed.
Mostly this will be with memcpy() and you want that copy to be aligned.
I really can't believe just how many ethernet chips are now being designed
that can't write received frames to '4n+2' boundaries.
It isn't even a new problem. Sun fixed the sbus 'DMA' part so that it would
to sbus burst transfers to 4n+2 aligned buffers a long time ago...
David
Powered by blists - more mailing lists