[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20160922.015242.735026657310158125.davem@davemloft.net>
Date: Thu, 22 Sep 2016 01:52:42 -0400 (EDT)
From: David Miller <davem@...emloft.net>
To: jbenc@...hat.com
Cc: sowmini.varadhan@...cle.com, netdev@...r.kernel.org,
hannes@...essinduktion.org, aduyck@...antis.com,
daniel@...earbox.net, pabeni@...hat.com
Subject: Re: [PATCH net-next] net/vxlan: Avoid unaligned access in
vxlan_build_skb()
From: Jiri Benc <jbenc@...hat.com>
Date: Tue, 20 Sep 2016 19:09:29 +0200
> But the point stands, we have much greater problems here than VXLAN.
> And I don't think that wrapping all IP address accesses into
> get/put_unaligned all around the stack is the solution.
Right, and I don't like marking things as packed either.
We need something that really solves the problem. We can't
change the existing protocols, but we can perhaps change the
geometry of the SKB when we deal with such protocols.
For example, we can memmove() to align the headers at skb->data and
then for the skb->data portion past the headers we insert a frag
pointing to it at the front of the frag list.
So we "memmove" down, creating a gap, and then past the gap
is the post-header area which gets inserted into the head of
the SKB's fraglist.
That will align all of the subsequent headers and avoid the
unaligned accesses after the vxlan header.
Alternatively we can do Alexander Duyck's trick, by pushing
the headers into the frag list, forcing a pull and realignment
by the next protocol layer.
This is so much better than the little hacks sprinkled all
over the problem and tackles the fundamental issue.
Thanks.
Powered by blists - more mailing lists