From 54adbf40ff717f05e081967102083889143447a7 Mon Sep 17 00:00:00 2001 From: Jesse Gross Date: Fri, 7 May 2010 18:50:23 -0700 Subject: [PATCH] gre: Include route headers in headroom calculation. When calculating the amount of headroom required include the route, which avoids a copy later when doing transforms like IPsec. --- datapath/vport-gre.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/datapath/vport-gre.c b/datapath/vport-gre.c index b7afd8f7..654ead06 100644 --- a/datapath/vport-gre.c +++ b/datapath/vport-gre.c @@ -1087,7 +1087,9 @@ gre_send(struct vport *vport, struct sk_buff *skb) * the segments. This is particularly beneficial on Xen where we get * lots of GSO pskbs. Conversely, we delay copying if it is just to * get our own writable clone because GSO may do the copy for us. */ - max_headroom = LL_RESERVED_SPACE(rt->u.dst.dev) + mutable->tunnel_hlen; + max_headroom = LL_RESERVED_SPACE(rt->u.dst.dev) + rt->u.dst.header_len + + mutable->tunnel_hlen; + if (skb_headroom(skb) < max_headroom) { skb = check_headroom(skb, max_headroom); if (unlikely(IS_ERR(skb))) { -- 2.30.2