datapath: Pull data into linear area only on demand.
authorJesse Gross <jesse@nicira.com>
Tue, 10 May 2011 18:48:36 +0000 (11:48 -0700)
committerJesse Gross <jesse@nicira.com>
Wed, 11 May 2011 18:37:17 +0000 (11:37 -0700)
commit2db65bf72c008cf7ee658d0b44744b39495ead14
treea1c6d5dae8aa66f7699f2c060dc07ffba8dff502
parentf8d17df2b2600d00267d7fcea1f34615c3f3ef50
datapath: Pull data into linear area only on demand.

We currently always pull 64 bytes of data (if it exists) into the
skb linear data area when parsing flows.  The theory behind this
is that the data should always be there and it's enough to parse
common flows.  However, this causes a number of problems in
different situations.  The first is that it is not enough to handle
IPv6 so we must pull additional data anyways.  However, the main
problem is that GRO typically allocates a new skb and puts just the
headers in there.  For a typical TCP/IPv4 packet there are 54 bytes
of headers, which means that we must possibly reallocate and copy
on every packet.  In addition, GRO creates frag_lists with this
specific geometry in order to allow later segmentation if the packet
is forwarded to a device that does not support frag_lists.  When
we pull additional data it changes the geometry and causes later
problems for the device.  This patch instead incrementally pulls
data, which avoids these problems.

Signed-off-by: Jesse Gross <jesse@nicira.com>
CC: Ian Campbell <Ian.Campbell@citrix.com>
datapath/flow.c