Skip to content

Commit 73b9fc4

Browse files
committed
xfrm: Fix GSO for IPsec with GRE tunnel.
We reset the encapsulation field of the skb too early in xfrm_output. As a result, the GRE GSO handler does not segment the packets. This leads to a performance drop down. We fix this by resetting the encapsulation field right before we do the transformation, when the inner headers become invalid. Fixes: f1bd7d6 ("xfrm: Add encapsulation header offsets while SKB is not encrypted") Reported-by: Vicente De Luca <vdeluca@zendesk.com> Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
1 parent 2b06cdf commit 73b9fc4

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

net/xfrm/xfrm_output.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,9 @@ static int xfrm_output_one(struct sk_buff *skb, int err)
105105
if (xfrm_offload(skb)) {
106106
x->type_offload->encap(x, skb);
107107
} else {
108+
/* Inner headers are invalid now. */
109+
skb->encapsulation = 0;
110+
108111
err = x->type->output(x, skb);
109112
if (err == -EINPROGRESS)
110113
goto out;
@@ -208,7 +211,6 @@ int xfrm_output(struct sock *sk, struct sk_buff *skb)
208211
int err;
209212

210213
secpath_reset(skb);
211-
skb->encapsulation = 0;
212214

213215
if (xfrm_dev_offload_ok(skb, x)) {
214216
struct sec_path *sp;

0 commit comments

Comments
 (0)