From: Alexander Lobakin <hidden> Date: 2021-01-22 18:44:17
This series allows to form UDP GRO packets in cases without sockets
(for forwarding). To not change the current datapath, this is
performed only when the new corresponding netdev feature is enabled
via Ethtool (and fraglisted GRO is disabled).
Prior to this point, only fraglisted UDP GRO was available. Plain UDP
GRO shows better forwarding performance when a target NIC is capable
of GSO UDP offload.
Since v3 [2]:
- rename introduced netdev feature to reflect that it targets
forwarding and don't touch fraglisted GRO at all (Willem de Bruijn).
Since v2 [1]:
- convert to a series;
- new: add new netdev_feature to explicitly enable/disable UDP GRO
when there is no socket, defaults to off (Paolo Abeni).
Since v1 [0]:
- drop redundant 'if (sk)' check (Alexander Duyck);
- add a ref in the commit message to one more commit that was
an important step for UDP GRO forwarding.
[0] https://lore.kernel.org/netdev/20210112211536.261172-1-alobakin@pm.me
[1] https://lore.kernel.org/netdev/20210113103232.4761-1-alobakin@pm.me
[2] https://lore.kernel.org/netdev/20210118193122.87271-1-alobakin@pm.me
Alexander Lobakin (2):
net: introduce a netdev feature for UDP GRO forwarding
udp: allow forwarding of plain (non-fraglisted) UDP GRO packets
include/linux/netdev_features.h | 4 +++-
net/ethtool/common.c | 1 +
net/ipv4/udp_offload.c | 3 ++-
3 files changed, 6 insertions(+), 2 deletions(-)
--
2.30.0
From: Willem de Bruijn <willemdebruijn.kernel@gmail.com> Date: 2021-01-22 18:38:51
On Fri, Jan 22, 2021 at 1:20 PM Alexander Lobakin [off-list ref] wrote:
Commit 9fd1ff5d2ac7 ("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 2e4ef10f5850 ("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 <redacted>
From: Alexander Lobakin <hidden> Date: 2021-01-22 18:44:17
Introduce a new netdev feature, NETIF_F_GRO_UDP_FWD, to allow user
to turn UDP GRO on and off for forwarding.
Defaults to off to not change current datapath.
Suggested-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: Alexander Lobakin <redacted>
---
include/linux/netdev_features.h | 4 +++-
net/ethtool/common.c | 1 +
2 files changed, 4 insertions(+), 1 deletion(-)
@@ -157,6 +158,7 @@ enum {#define NETIF_F_GRO_FRAGLIST __NETIF_F(GRO_FRAGLIST)#define NETIF_F_GSO_FRAGLIST __NETIF_F(GSO_FRAGLIST)#define NETIF_F_HW_MACSEC __NETIF_F(HW_MACSEC)+#define NETIF_F_GRO_UDP_FWD __NETIF_F(GRO_UDP_FWD)/* Finds the next feature with the highest number of the range of start till 0.*/
@@ -234,7 +236,7 @@ static inline int find_next_netdev_feature(u64 feature, unsigned long start)#define NETIF_F_SOFT_FEATURES (NETIF_F_GSO | NETIF_F_GRO)/* Changeable features with no special hardware requirements that defaults to off. */-#define NETIF_F_SOFT_FEATURES_OFF NETIF_F_GRO_FRAGLIST+#define NETIF_F_SOFT_FEATURES_OFF (NETIF_F_GRO_FRAGLIST | NETIF_F_GRO_UDP_FWD)#define NETIF_F_VLAN_FEATURES (NETIF_F_HW_VLAN_CTAG_FILTER | \NETIF_F_HW_VLAN_CTAG_RX|\
From: Alexander Lobakin <hidden> Date: 2021-01-22 19:17:17
Commit 9fd1ff5d2ac7 ("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 2e4ef10f5850 ("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 <redacted>
---
net/ipv4/udp_offload.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
Hello:
This series was applied to netdev/net-next.git (refs/heads/master):
On Fri, 22 Jan 2021 18:19:36 +0000 you wrote:
This series allows to form UDP GRO packets in cases without sockets
(for forwarding). To not change the current datapath, this is
performed only when the new corresponding netdev feature is enabled
via Ethtool (and fraglisted GRO is disabled).
Prior to this point, only fraglisted UDP GRO was available. Plain UDP
GRO shows better forwarding performance when a target NIC is capable
of GSO UDP offload.
[...]