RE: [net PATCH] flow_dissector: Fix unaligned access in __skb_flow_dissector when used by eth_get_headlen

2016-02-02 Thread David Laight
From: Alexander Duyck > Sent: 01 February 2016 18:18 > >> 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.

RE: [net PATCH] flow_dissector: Fix unaligned access in __skb_flow_dissector when used by eth_get_headlen

2016-02-01 Thread David Laight
From: David Miller > Sent: 31 January 2016 03:45 > To: alexander.du...@gmail.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

Re: [net PATCH] flow_dissector: Fix unaligned access in __skb_flow_dissector when used by eth_get_headlen

2016-02-01 Thread Alexander Duyck
On Mon, Feb 1, 2016 at 8:50 AM, David Laight wrote: > From: David Miller >> Sent: 31 January 2016 03:45 >> To: alexander.du...@gmail.com > ... >> > I would really prefer to keep the pages DMA aligned, and the skb->data >> > IP aligned. If nothing else it has the

Re: [net PATCH] flow_dissector: Fix unaligned access in __skb_flow_dissector when used by eth_get_headlen

2016-01-31 Thread David Miller
From: Alexander Duyck Date: Sun, 31 Jan 2016 01:12:03 -0800 > If nothing else we can discuss this further in Seville as I am just > not convinced changing the drivers is the right way to go about fixing > this, and I won't have the time to really get around to doing

Re: [net PATCH] flow_dissector: Fix unaligned access in __skb_flow_dissector when used by eth_get_headlen

2016-01-31 Thread Sowmini Varadhan
On (01/31/16 11:17), David Miller wrote: > > > If nothing else we can discuss this further in Seville as I am just > > not convinced changing the drivers is the right way to go about fixing > > this, and I won't have the time to really get around to doing any of > > it until I have come back from

Re: [net PATCH] flow_dissector: Fix unaligned access in __skb_flow_dissector when used by eth_get_headlen

2016-01-31 Thread Alexander Duyck
On Sat, Jan 30, 2016 at 7:45 PM, David Miller wrote: > From: Alexander Duyck > Date: Sat, 30 Jan 2016 17:13:35 -0800 > >> The NIC hardware only allows us to set receive buffer sizes in 1K >> increments. I think fm10k may be an exception in that it

Re: [net PATCH] flow_dissector: Fix unaligned access in __skb_flow_dissector when used by eth_get_headlen

2016-01-30 Thread Eric Dumazet
On Sat, 2016-01-30 at 10:36 -0800, Alexander Duyck wrote: > As far as the NET_IP_ALIGN on the page offset I think it is a horrible > idea. Basically it means we have to allocate at least 1K more space > than we need since page sizes are powers of 2, and buffer sizes in > hardware are measured in

Re: [net PATCH] flow_dissector: Fix unaligned access in __skb_flow_dissector when used by eth_get_headlen

2016-01-30 Thread Tom Herbert
On Sat, Jan 30, 2016 at 8:17 AM, Sowmini Varadhan wrote: > On (01/29/16 19:23), Eric Dumazet wrote: >> BTW, even a memcpy(_addrs->v4addrs, >saddr, 8) could crash, as >> the compiler can certainly assume src and dst are 4 bytes aligned, and >> could use word accesses

Re: [net PATCH] flow_dissector: Fix unaligned access in __skb_flow_dissector when used by eth_get_headlen

2016-01-30 Thread Alexander Duyck
On Sat, Jan 30, 2016 at 8:17 AM, Sowmini Varadhan wrote: > On (01/29/16 19:23), Eric Dumazet wrote: >> BTW, even a memcpy(_addrs->v4addrs, >saddr, 8) could crash, as >> the compiler can certainly assume src and dst are 4 bytes aligned, and >> could use word accesses

Re: [net PATCH] flow_dissector: Fix unaligned access in __skb_flow_dissector when used by eth_get_headlen

2016-01-30 Thread Sowmini Varadhan
On (01/30/16 09:43), Tom Herbert wrote: > That is not the only case, If a GRE TEB packet is ever received and > flow dissector is called for any reason (like skb_get_hash) there's > going to be problems-- and this doesn't require GRE to even be > configured on the host. > > I have a patch that

Re: [net PATCH] flow_dissector: Fix unaligned access in __skb_flow_dissector when used by eth_get_headlen

2016-01-30 Thread Sowmini Varadhan
On (01/29/16 19:23), Eric Dumazet wrote: > BTW, even a memcpy(_addrs->v4addrs, >saddr, 8) could crash, as > the compiler can certainly assume src and dst are 4 bytes aligned, and > could use word accesses when inlining memcpy() even on Sparc. > > Apparently the compiler used by Sowmini is gentle.

Re: [net PATCH] flow_dissector: Fix unaligned access in __skb_flow_dissector when used by eth_get_headlen

2016-01-30 Thread Alexander Duyck
On Sat, Jan 30, 2016 at 11:26 AM, Eric Dumazet wrote: > On Sat, 2016-01-30 at 10:36 -0800, Alexander Duyck wrote: > >> As far as the NET_IP_ALIGN on the page offset I think it is a horrible >> idea. Basically it means we have to allocate at least 1K more space >> than we

Re: [net PATCH] flow_dissector: Fix unaligned access in __skb_flow_dissector when used by eth_get_headlen

2016-01-30 Thread David Miller
From: Alexander Duyck Date: Sat, 30 Jan 2016 17:13:35 -0800 > The NIC hardware only allows us to set receive buffer sizes in 1K > increments. I think fm10k may be an exception in that it may be able > to support 512 byte, but otherwise igb and ixgbe are strictly set

Re: [net PATCH] flow_dissector: Fix unaligned access in __skb_flow_dissector when used by eth_get_headlen

2016-01-29 Thread David Miller
From: Eric Dumazet Date: Fri, 29 Jan 2016 19:23:54 -0800 > On Fri, 2016-01-29 at 18:49 -0800, Alexander Duyck wrote: >> This patch fixes an issue with unaligned accesses when using >> eth_get_headlen on a page that was DMA aligned instead of being IP aligned. >> The fact

Re: [net PATCH] flow_dissector: Fix unaligned access in __skb_flow_dissector when used by eth_get_headlen

2016-01-29 Thread Eric Dumazet
On Fri, 2016-01-29 at 18:49 -0800, Alexander Duyck wrote: > This patch fixes an issue with unaligned accesses when using > eth_get_headlen on a page that was DMA aligned instead of being IP aligned. > The fact is when trying to check the length we don't need to be looking at > the flow label so we

[net PATCH] flow_dissector: Fix unaligned access in __skb_flow_dissector when used by eth_get_headlen

2016-01-29 Thread Alexander Duyck
This patch fixes an issue with unaligned accesses when using eth_get_headlen on a page that was DMA aligned instead of being IP aligned. The fact is when trying to check the length we don't need to be looking at the flow label so we can reorder the checks to first check if we are supposed to

Re: [net PATCH] flow_dissector: Fix unaligned access in __skb_flow_dissector when used by eth_get_headlen

2016-01-29 Thread Alexander Duyck
On Fri, Jan 29, 2016 at 7:35 PM, David Miller wrote: > From: Eric Dumazet > Date: Fri, 29 Jan 2016 19:23:54 -0800 > >> On Fri, 2016-01-29 at 18:49 -0800, Alexander Duyck wrote: >>> This patch fixes an issue with unaligned accesses when using >>>