summaryrefslogtreecommitdiffstats
path: root/net/core/skbuff.c
diff options
context:
space:
mode:
authorEric Dumazet <edumazet@google.com>2014-10-03 20:59:19 -0700
committerDavid S. Miller <davem@davemloft.net>2014-10-06 00:37:30 -0400
commitbec3cfdca36bf43cfa3751ad7b56db1a307e0760 (patch)
treed9c2d8352b0cc41d43dc23b7a7eafdac6758aeb3 /net/core/skbuff.c
parent45d9cc7c609680e921060d3eb4e399043eb5e4be (diff)
downloadlinux-bec3cfdca36bf43cfa3751ad7b56db1a307e0760.tar.gz
linux-bec3cfdca36bf43cfa3751ad7b56db1a307e0760.tar.bz2
linux-bec3cfdca36bf43cfa3751ad7b56db1a307e0760.zip
net: skb_segment() provides list head and tail
Its unfortunate we have to walk again skb list to find the tail after segmentation, even if data is probably hot in cpu caches. skb_segment() can store the tail of the list into segs->prev, and validate_xmit_skb_list() can immediately get the tail. Signed-off-by: Eric Dumazet <edumazet@google.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/core/skbuff.c')
-rw-r--r--net/core/skbuff.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/net/core/skbuff.c b/net/core/skbuff.c
index 9a423e2c5766..7b3df0d518ab 100644
--- a/net/core/skbuff.c
+++ b/net/core/skbuff.c
@@ -3083,6 +3083,11 @@ perform_csum_check:
}
} while ((offset += len) < head_skb->len);
+ /* Some callers want to get the end of the list.
+ * Put it in segs->prev to avoid walking the list.
+ * (see validate_xmit_skb_list() for example)
+ */
+ segs->prev = tail;
return segs;
err: