udp: properly complete L4 GRO over UDP tunnel packet
authorPaolo Abeni <pabeni@redhat.com>
Tue, 30 Mar 2021 10:28:51 +0000 (12:28 +0200)
committerDavid S. Miller <davem@davemloft.net>
Wed, 31 Mar 2021 00:06:49 +0000 (17:06 -0700)
commite0e3070a9bc9bb3d3e00b37da872ed5b0adbd077
treef1d86dcc9d50dd02fcb55978574d7a2d4608398f
parent18f25dc399901426dff61e676ba603ff52c666f7
udp: properly complete L4 GRO over UDP tunnel packet

After the previous patch, the stack can do L4 UDP aggregation
on top of a UDP tunnel.

In such scenario, udp{4,6}_gro_complete will be called twice. This function
will enter its is_flist branch immediately, even though that is only
correct on the second call, as GSO_FRAGLIST is only relevant for the
inner packet.

Instead, we need to try first UDP tunnel-based aggregation, if the GRO
packet requires that.

This patch changes udp{4,6}_gro_complete to skip the frag list processing
when while encap_mark == 1, identifying processing of the outer tunnel
header.
Additionally, clears the field in udp_gro_complete() so that we can enter
the frag list path on the next round, for the inner header.

v1 -> v2:
 - hopefully clarified the commit message

Reviewed-by: Willem de Bruijn <willemb@google.com>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/ipv4/udp_offload.c
net/ipv6/udp_offload.c