]> git.itanic.dy.fi Git - linux-stable/commit
virtio-net: use NETIF_F_GRO_HW instead of NETIF_F_LRO
authorJason Wang <jasowang@redhat.com>
Tue, 17 Aug 2021 08:06:59 +0000 (16:06 +0800)
committerSasha Levin <sashal@kernel.org>
Thu, 26 Aug 2021 12:35:48 +0000 (08:35 -0400)
commit9bc2d1a5a890a4e977c2724dd7f315a6dc5d3d2b
treebc3183d8c8bdc4b16dbd5d68ea8192005e6a2325
parentb7adfde949307efaeef0f32ca28273f6499c7c1d
virtio-net: use NETIF_F_GRO_HW instead of NETIF_F_LRO

[ Upstream commit dbcf24d153884439dad30484a0e3f02350692e4c ]

Commit a02e8964eaf92 ("virtio-net: ethtool configurable LRO")
maps LRO to virtio guest offloading features and allows the
administrator to enable and disable those features via ethtool.

This leads to several issues:

- For a device that doesn't support control guest offloads, the "LRO"
  can't be disabled triggering WARN in dev_disable_lro() when turning
  off LRO or when enabling forwarding bridging etc.

- For a device that supports control guest offloads, the guest
  offloads are disabled in cases of bridging, forwarding etc slowing
  down the traffic.

Fix this by using NETIF_F_GRO_HW instead. Though the spec does not
guarantee packets to be re-segmented as the original ones,
we can add that to the spec, possibly with a flag for devices to
differentiate between GRO and LRO.

Further, we never advertised LRO historically before a02e8964eaf92
("virtio-net: ethtool configurable LRO") and so bridged/forwarded
configs effectively always relied on virtio receive offloads behaving
like GRO - thus even if this breaks any configs it is at least not
a regression.

Fixes: a02e8964eaf92 ("virtio-net: ethtool configurable LRO")
Acked-by: Michael S. Tsirkin <mst@redhat.com>
Reported-by: Ivan <ivan@prestigetransportation.com>
Tested-by: Ivan <ivan@prestigetransportation.com>
Signed-off-by: Jason Wang <jasowang@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/virtio_net.c