Re: [PATCH net-next V2] net/vxlan: Avoid unaligned access in vxlan_build_skb()

2016-09-21 Thread Alexei Starovoitov
On Wed, Sep 21, 2016 at 09:53:31AM -0700, Eric Dumazet wrote: > On Wed, 2016-09-21 at 09:14 -0700, Alexei Starovoitov wrote: > > > > > I think it's the opposite. Even on x86 compiler will use byte loads. > > Unless you tweaked gcc, it should still use word loads on x86. > checked that on

Re: [PATCH net-next V2] net/vxlan: Avoid unaligned access in vxlan_build_skb()

2016-09-21 Thread Eric Dumazet
On Wed, 2016-09-21 at 09:14 -0700, Alexei Starovoitov wrote: > > I think it's the opposite. Even on x86 compiler will use byte loads. Unless you tweaked gcc, it should still use word loads on x86.

Re: [PATCH net-next V2] net/vxlan: Avoid unaligned access in vxlan_build_skb()

2016-09-21 Thread Hannes Frederic Sowa
On 21.09.2016 18:14, Alexei Starovoitov wrote: > On Wed, Sep 21, 2016 at 12:10:55PM +0200, Hannes Frederic Sowa wrote: >> On 20.09.2016 20:57, Sowmini Varadhan wrote: >>> The vxlan header may not be aligned to 4 bytes in >>> vxlan_build_skb (e.g., for MLD packets). This patch >>> avoids unaligned

Re: [PATCH net-next V2] net/vxlan: Avoid unaligned access in vxlan_build_skb()

2016-09-21 Thread Alexei Starovoitov
On Wed, Sep 21, 2016 at 12:10:55PM +0200, Hannes Frederic Sowa wrote: > On 20.09.2016 20:57, Sowmini Varadhan wrote: > > The vxlan header may not be aligned to 4 bytes in > > vxlan_build_skb (e.g., for MLD packets). This patch > > avoids unaligned access traps from vxlan_build_skb > > (in

Re: [PATCH net-next V2] net/vxlan: Avoid unaligned access in vxlan_build_skb()

2016-09-21 Thread Hannes Frederic Sowa
On 20.09.2016 20:57, Sowmini Varadhan wrote: > The vxlan header may not be aligned to 4 bytes in > vxlan_build_skb (e.g., for MLD packets). This patch > avoids unaligned access traps from vxlan_build_skb > (in platforms like sparc) by making struct vxlanhdr __packed. > > Signed-off-by: Sowmini

Re: [PATCH net-next V2] net/vxlan: Avoid unaligned access in vxlan_build_skb()

2016-09-21 Thread Jiri Benc
On Tue, 20 Sep 2016 14:57:37 -0400, Sowmini Varadhan wrote: > The vxlan header may not be aligned to 4 bytes in > vxlan_build_skb (e.g., for MLD packets). This patch > avoids unaligned access traps from vxlan_build_skb > (in platforms like sparc) by making struct vxlanhdr __packed. > >

[PATCH net-next V2] net/vxlan: Avoid unaligned access in vxlan_build_skb()

2016-09-20 Thread Sowmini Varadhan
The vxlan header may not be aligned to 4 bytes in vxlan_build_skb (e.g., for MLD packets). This patch avoids unaligned access traps from vxlan_build_skb (in platforms like sparc) by making struct vxlanhdr __packed. Signed-off-by: Sowmini Varadhan ---