mbox series

[net,0/2] Lift UDP_SEGMENT restriction for egress via device w/o csum offload

Message ID 20240622-linux-udpgso-v1-0-d2344157ab2a@cloudflare.com (mailing list archive)
Headers show
Series Lift UDP_SEGMENT restriction for egress via device w/o csum offload | expand

Message

Jakub Sitnicki June 22, 2024, 4:14 p.m. UTC
This is a follow-up to an earlier question [1] if we can make UDP GSO work with
any egress device, even those with no checksum offload capability. That's the
default setup for TUN/TAP.

I leave it to the maintainers to decide if it qualifies as a fix. We plan to
backport it to our v6.6 either way, hence the submission to -net.

[1] https://lore.kernel.org/netdev/87jzqsld6q.fsf@cloudflare.com/

Signed-off-by: Jakub Sitnicki <jakub@cloudflare.com>
---
Jakub Sitnicki (2):
      udp: Allow GSO transmit from devices with no checksum offload
      selftests/net: Add test coverage for UDP GSO software fallback

 net/ipv4/udp.c                        |  3 +--
 net/ipv4/udp_offload.c                |  8 +++++++
 net/ipv6/udp.c                        |  3 +--
 tools/testing/selftests/net/udpgso.c  | 15 +++++++++---
 tools/testing/selftests/net/udpgso.sh | 43 +++++++++++++++++++++++++++++++++++
 5 files changed, 65 insertions(+), 7 deletions(-)

Comments

Willem de Bruijn June 23, 2024, 8:18 a.m. UTC | #1
Jakub Sitnicki wrote:
> This is a follow-up to an earlier question [1] if we can make UDP GSO work with
> any egress device, even those with no checksum offload capability. That's the
> default setup for TUN/TAP.
> 
> I leave it to the maintainers to decide if it qualifies as a fix. We plan to
> backport it to our v6.6 either way, hence the submission to -net.
> 
> [1] https://lore.kernel.org/netdev/87jzqsld6q.fsf@cloudflare.com/

Agreed with the change to allow UDP_SEGMENT to work regardless of
device capabilities.

In my opinion this is a new feature with sufficient risk of unintended
side effects to be net-next material.

Maybe worth recording in patch 1 the reason for the original check:
that UDP_SEGMENT with software checksumming in the GSO stack may be
a regression vs copy_and_checksum in the send syscall.

> 
> Signed-off-by: Jakub Sitnicki <jakub@cloudflare.com>
> ---
> Jakub Sitnicki (2):
>       udp: Allow GSO transmit from devices with no checksum offload
>       selftests/net: Add test coverage for UDP GSO software fallback
> 
>  net/ipv4/udp.c                        |  3 +--
>  net/ipv4/udp_offload.c                |  8 +++++++
>  net/ipv6/udp.c                        |  3 +--
>  tools/testing/selftests/net/udpgso.c  | 15 +++++++++---
>  tools/testing/selftests/net/udpgso.sh | 43 +++++++++++++++++++++++++++++++++++
>  5 files changed, 65 insertions(+), 7 deletions(-)
>
Jakub Sitnicki June 24, 2024, 11:29 a.m. UTC | #2
On Sun, Jun 23, 2024 at 04:18 AM -04, Willem de Bruijn wrote:
> Jakub Sitnicki wrote:
>> This is a follow-up to an earlier question [1] if we can make UDP GSO work with
>> any egress device, even those with no checksum offload capability. That's the
>> default setup for TUN/TAP.
>> 
>> I leave it to the maintainers to decide if it qualifies as a fix. We plan to
>> backport it to our v6.6 either way, hence the submission to -net.
>> 
>> [1] https://lore.kernel.org/netdev/87jzqsld6q.fsf@cloudflare.com/
>
> Agreed with the change to allow UDP_SEGMENT to work regardless of
> device capabilities.

Thanks for the stamp.

> In my opinion this is a new feature with sufficient risk of unintended
> side effects to be net-next material.

OK, I will resubmit for net-next.

> Maybe worth recording in patch 1 the reason for the original check:
> that UDP_SEGMENT with software checksumming in the GSO stack may be
> a regression vs copy_and_checksum in the send syscall.

Will expand the description.