On Fri, Sep 23, 2016 at 5:06 AM, David Miller <da...@davemloft.net> wrote: > From: Sowmini Varadhan <sowmini.varad...@oracle.com> > Date: Thu, 22 Sep 2016 17:30:10 -0400 > >> On (09/22/16 01:52), David Miller wrote: >>> 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. >> >> What is the "Alexander Duyck trick" (hints about module or commit id, >> where this can be found, please)? >> >> Is this basically about, e.g., putting the vxlanhdr in its own >> skb_frag_t, or something else? > > Yes, and this way skb_header_pointer() is forced to do a memcpy.
It is something I had proposed on the Rx side of things back in February when the issue came up in relation to skb parsing. On architectures that require NET_IP_ALIGN to be set I had proposed that we should only pull the outer headers from the page frag, and then when the time is right we drop the outer headers and pull the inner headers from the page frag. That way we can keep all the headers aligned. For Tx it all becomes a bit trickier since it would likely require us to shift the frags up by 1 when we go from outer headers to inner headers. One thought I had on that is that we could possibly avoid having to do any allocation and could just take a reference on the head_frag if that is what we are using. Then we just add a 2 byte pad and resume writing headers in place and the pointer offsets for the inner headers would remain valid, though they would be past the point of skb->tail. - Alex