]> git.baikalelectronics.ru Git - kernel.git/commit
udp: allow forwarding of plain (non-fraglisted) UDP GRO packets
authorAlexander Lobakin <alobakin@pm.me>
Fri, 22 Jan 2021 18:20:02 +0000 (18:20 +0000)
committerJakub Kicinski <kuba@kernel.org>
Sun, 24 Jan 2021 04:18:16 +0000 (20:18 -0800)
commit0a01a95fa92020c190bb9afa36b239da86ff47ef
treed69743f4e00a79f357be6dd33db3e0c405d7b668
parenta3efb25d720b029e0cff1fc462500ca1471c830e
udp: allow forwarding of plain (non-fraglisted) UDP GRO packets

Commit 8adbd0e6dafc ("udp: Support UDP fraglist GRO/GSO.") actually
not only added a support for fraglisted UDP GRO, but also tweaked
some logics the way that non-fraglisted UDP GRO started to work for
forwarding too.
Commit 0da21e10968c ("net: add GSO UDP L4 and GSO fraglists to the
list of software-backed types") added GSO UDP L4 to the list of
software GSO to allow virtual netdevs to forward them as is up to
the real drivers.

Tests showed that currently forwarding and NATing of plain UDP GRO
packets are performed fully correctly, regardless if the target
netdevice has a support for hardware/driver GSO UDP L4 or not.
Add the last element and allow to form plain UDP GRO packets if
we are on forwarding path, and the new NETIF_F_GRO_UDP_FWD is
enabled on a receiving netdevice.

If both NETIF_F_GRO_FRAGLIST and NETIF_F_GRO_UDP_FWD are set,
fraglisted GRO takes precedence. This keeps the current behaviour
and is generally more optimal for now, as the number of NICs with
hardware USO offload is relatively small.

Signed-off-by: Alexander Lobakin <alobakin@pm.me>
Acked-by: Willem de Bruijn <willemb@google.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
net/ipv4/udp_offload.c