Skip to content

Commit b439475

Browse files
committed
xfrm: Use the XFRM_GRO to indicate a GRO call on input
This is needed to support GRO for ESP in UDP encapsulation. Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com> Co-developed-by: Antony Antony <antony.antony@secunet.com> Signed-off-by: Antony Antony <antony.antony@secunet.com> Reviewed-by: Eyal Birger <eyal.birger@gmail.com>
1 parent 1d495f1 commit b439475

3 files changed

Lines changed: 4 additions & 6 deletions

File tree

net/ipv4/esp4_offload.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ static struct sk_buff *esp4_gro_receive(struct list_head *head,
7777

7878
/* We don't need to handle errors from xfrm_input, it does all
7979
* the error handling and frees the resources on error. */
80-
xfrm_input(skb, IPPROTO_ESP, spi, -2);
80+
xfrm_input(skb, IPPROTO_ESP, spi, 0);
8181

8282
return ERR_PTR(-EINPROGRESS);
8383
out_reset:

net/ipv6/esp6_offload.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ static struct sk_buff *esp6_gro_receive(struct list_head *head,
104104

105105
/* We don't need to handle errors from xfrm_input, it does all
106106
* the error handling and frees the resources on error. */
107-
xfrm_input(skb, IPPROTO_ESP, spi, -2);
107+
xfrm_input(skb, IPPROTO_ESP, spi, 0);
108108

109109
return ERR_PTR(-EINPROGRESS);
110110
out_reset:

net/xfrm/xfrm_input.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -462,7 +462,7 @@ int xfrm_input(struct sk_buff *skb, int nexthdr, __be32 spi, int encap_type)
462462
struct xfrm_offload *xo = xfrm_offload(skb);
463463
struct sec_path *sp;
464464

465-
if (encap_type < 0) {
465+
if (encap_type < 0 || (xo && xo->flags & XFRM_GRO)) {
466466
x = xfrm_input_state(skb);
467467

468468
if (unlikely(x->km.state != XFRM_STATE_VALID)) {
@@ -485,9 +485,7 @@ int xfrm_input(struct sk_buff *skb, int nexthdr, __be32 spi, int encap_type)
485485
seq = XFRM_SKB_CB(skb)->seq.input.low;
486486
goto resume;
487487
}
488-
489-
/* encap_type < -1 indicates a GRO call. */
490-
encap_type = 0;
488+
/* GRO call */
491489
seq = XFRM_SPI_SKB_CB(skb)->seq;
492490

493491
if (xo && (xo->flags & CRYPTO_DONE)) {

0 commit comments

Comments
 (0)