Linux Kernel Selftest development
 help / color / mirror / Atom feed
* [PATCH net v2 0/1] net: change maximum number of UDP segments to 128
@ 2024-04-11  5:11 Yuri Benditovich
  2024-04-11  5:11 ` [PATCH net v2 1/1] " Yuri Benditovich
  2024-04-14 16:10 ` [PATCH net v2 0/1] " patchwork-bot+netdevbpf
  0 siblings, 2 replies; 5+ messages in thread
From: Yuri Benditovich @ 2024-04-11  5:11 UTC (permalink / raw)
  To: Willem de Bruijn, David S . Miller, Eric Dumazet, Jakub Kicinski,
	Paolo Abeni, Shuah Khan, Jason Wang
  Cc: linux-kernel, netdev, linux-kselftest, yan, andrew

v1->v2:
Fixed placement of 'Fixed:' line
Extended commit message

Yuri Benditovich (1):
  net: change maximum number of UDP segments to 128

 include/linux/udp.h                  | 2 +-
 tools/testing/selftests/net/udpgso.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

-- 
2.40.1


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH net v2 1/1] net: change maximum number of UDP segments to 128
  2024-04-11  5:11 [PATCH net v2 0/1] net: change maximum number of UDP segments to 128 Yuri Benditovich
@ 2024-04-11  5:11 ` Yuri Benditovich
  2024-04-11  5:36   ` Yuri Benditovich
  2024-04-11 16:01   ` Willem de Bruijn
  2024-04-14 16:10 ` [PATCH net v2 0/1] " patchwork-bot+netdevbpf
  1 sibling, 2 replies; 5+ messages in thread
From: Yuri Benditovich @ 2024-04-11  5:11 UTC (permalink / raw)
  To: Willem de Bruijn, David S . Miller, Eric Dumazet, Jakub Kicinski,
	Paolo Abeni, Shuah Khan, Jason Wang
  Cc: linux-kernel, netdev, linux-kselftest, yan, andrew

The commit fc8b2a619469
("net: more strict VIRTIO_NET_HDR_GSO_UDP_L4 validation")
adds check of potential number of UDP segments vs
UDP_MAX_SEGMENTS in linux/virtio_net.h.
After this change certification test of USO guest-to-guest
transmit on Windows driver for virtio-net device fails,
for example with packet size of ~64K and mss of 536 bytes.
In general the USO should not be more restrictive than TSO.
Indeed, in case of unreasonably small mss a lot of segments
can cause queue overflow and packet loss on the destination.
Limit of 128 segments is good for any practical purpose,
with minimal meaningful mss of 536 the maximal UDP packet will
be divided to ~120 segments.
The number of segments for UDP packets is validated vs
UDP_MAX_SEGMENTS also in udp.c (v4,v6), this does not affect
quest-to-guest path but does affect packets sent to host, for
example.
It is important to mention that UDP_MAX_SEGMENTS is kernel-only
define and not available to user mode socket applications.
In order to request MSS smaller than MTU the applications
just uses setsockopt with SOL_UDP and UDP_SEGMENT and there is
no limitations on socket API level.

Fixes: fc8b2a619469 ("net: more strict VIRTIO_NET_HDR_GSO_UDP_L4 validation")
Signed-off-by: Yuri Benditovich <yuri.benditovich@daynix.com>
---
 include/linux/udp.h                  | 2 +-
 tools/testing/selftests/net/udpgso.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/include/linux/udp.h b/include/linux/udp.h
index 3748e82b627b..7e75ccdf25fe 100644
--- a/include/linux/udp.h
+++ b/include/linux/udp.h
@@ -108,7 +108,7 @@ struct udp_sock {
 #define udp_assign_bit(nr, sk, val)		\
 	assign_bit(UDP_FLAGS_##nr, &udp_sk(sk)->udp_flags, val)
 
-#define UDP_MAX_SEGMENTS	(1 << 6UL)
+#define UDP_MAX_SEGMENTS	(1 << 7UL)
 
 #define udp_sk(ptr) container_of_const(ptr, struct udp_sock, inet.sk)
 
diff --git a/tools/testing/selftests/net/udpgso.c b/tools/testing/selftests/net/udpgso.c
index 1d975bf52af3..85b3baa3f7f3 100644
--- a/tools/testing/selftests/net/udpgso.c
+++ b/tools/testing/selftests/net/udpgso.c
@@ -34,7 +34,7 @@
 #endif
 
 #ifndef UDP_MAX_SEGMENTS
-#define UDP_MAX_SEGMENTS	(1 << 6UL)
+#define UDP_MAX_SEGMENTS	(1 << 7UL)
 #endif
 
 #define CONST_MTU_TEST	1500
-- 
2.40.1


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH net v2 1/1] net: change maximum number of UDP segments to 128
  2024-04-11  5:11 ` [PATCH net v2 1/1] " Yuri Benditovich
@ 2024-04-11  5:36   ` Yuri Benditovich
  2024-04-11 16:01   ` Willem de Bruijn
  1 sibling, 0 replies; 5+ messages in thread
From: Yuri Benditovich @ 2024-04-11  5:36 UTC (permalink / raw)
  To: Willem de Bruijn, David S . Miller, Eric Dumazet, Jakub Kicinski,
	Paolo Abeni, Shuah Khan, Jason Wang
  Cc: linux-kernel, netdev, linux-kselftest, yan, andrew

I've just fixed the 'Fixed:' line and extended the commit message.
We can continue the discussion in the previous email thread or move it here.

On Thu, Apr 11, 2024 at 8:11 AM Yuri Benditovich
<yuri.benditovich@daynix.com> wrote:
>
> The commit fc8b2a619469
> ("net: more strict VIRTIO_NET_HDR_GSO_UDP_L4 validation")
> adds check of potential number of UDP segments vs
> UDP_MAX_SEGMENTS in linux/virtio_net.h.
> After this change certification test of USO guest-to-guest
> transmit on Windows driver for virtio-net device fails,
> for example with packet size of ~64K and mss of 536 bytes.
> In general the USO should not be more restrictive than TSO.
> Indeed, in case of unreasonably small mss a lot of segments
> can cause queue overflow and packet loss on the destination.
> Limit of 128 segments is good for any practical purpose,
> with minimal meaningful mss of 536 the maximal UDP packet will
> be divided to ~120 segments.
> The number of segments for UDP packets is validated vs
> UDP_MAX_SEGMENTS also in udp.c (v4,v6), this does not affect
> quest-to-guest path but does affect packets sent to host, for
> example.
> It is important to mention that UDP_MAX_SEGMENTS is kernel-only
> define and not available to user mode socket applications.
> In order to request MSS smaller than MTU the applications
> just uses setsockopt with SOL_UDP and UDP_SEGMENT and there is
> no limitations on socket API level.
>
> Fixes: fc8b2a619469 ("net: more strict VIRTIO_NET_HDR_GSO_UDP_L4 validation")
> Signed-off-by: Yuri Benditovich <yuri.benditovich@daynix.com>
> ---
>  include/linux/udp.h                  | 2 +-
>  tools/testing/selftests/net/udpgso.c | 2 +-
>  2 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/include/linux/udp.h b/include/linux/udp.h
> index 3748e82b627b..7e75ccdf25fe 100644
> --- a/include/linux/udp.h
> +++ b/include/linux/udp.h
> @@ -108,7 +108,7 @@ struct udp_sock {
>  #define udp_assign_bit(nr, sk, val)            \
>         assign_bit(UDP_FLAGS_##nr, &udp_sk(sk)->udp_flags, val)
>
> -#define UDP_MAX_SEGMENTS       (1 << 6UL)
> +#define UDP_MAX_SEGMENTS       (1 << 7UL)
>
>  #define udp_sk(ptr) container_of_const(ptr, struct udp_sock, inet.sk)
>
> diff --git a/tools/testing/selftests/net/udpgso.c b/tools/testing/selftests/net/udpgso.c
> index 1d975bf52af3..85b3baa3f7f3 100644
> --- a/tools/testing/selftests/net/udpgso.c
> +++ b/tools/testing/selftests/net/udpgso.c
> @@ -34,7 +34,7 @@
>  #endif
>
>  #ifndef UDP_MAX_SEGMENTS
> -#define UDP_MAX_SEGMENTS       (1 << 6UL)
> +#define UDP_MAX_SEGMENTS       (1 << 7UL)
>  #endif
>
>  #define CONST_MTU_TEST 1500
> --
> 2.40.1
>

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH net v2 1/1] net: change maximum number of UDP segments to 128
  2024-04-11  5:11 ` [PATCH net v2 1/1] " Yuri Benditovich
  2024-04-11  5:36   ` Yuri Benditovich
@ 2024-04-11 16:01   ` Willem de Bruijn
  1 sibling, 0 replies; 5+ messages in thread
From: Willem de Bruijn @ 2024-04-11 16:01 UTC (permalink / raw)
  To: Yuri Benditovich, Willem de Bruijn, David S . Miller,
	Eric Dumazet, Jakub Kicinski, Paolo Abeni, Shuah Khan, Jason Wang
  Cc: linux-kernel, netdev, linux-kselftest, yan, andrew

Yuri Benditovich wrote:
> The commit fc8b2a619469
> ("net: more strict VIRTIO_NET_HDR_GSO_UDP_L4 validation")
> adds check of potential number of UDP segments vs
> UDP_MAX_SEGMENTS in linux/virtio_net.h.
> After this change certification test of USO guest-to-guest
> transmit on Windows driver for virtio-net device fails,
> for example with packet size of ~64K and mss of 536 bytes.
> In general the USO should not be more restrictive than TSO.
> Indeed, in case of unreasonably small mss a lot of segments
> can cause queue overflow and packet loss on the destination.
> Limit of 128 segments is good for any practical purpose,
> with minimal meaningful mss of 536 the maximal UDP packet will
> be divided to ~120 segments.
> The number of segments for UDP packets is validated vs
> UDP_MAX_SEGMENTS also in udp.c (v4,v6), this does not affect
> quest-to-guest path but does affect packets sent to host, for
> example.
> It is important to mention that UDP_MAX_SEGMENTS is kernel-only
> define and not available to user mode socket applications.
> In order to request MSS smaller than MTU the applications
> just uses setsockopt with SOL_UDP and UDP_SEGMENT and there is
> no limitations on socket API level.
> 
> Fixes: fc8b2a619469 ("net: more strict VIRTIO_NET_HDR_GSO_UDP_L4 validation")
> Signed-off-by: Yuri Benditovich <yuri.benditovich@daynix.com>

Reviewed-by: Willem de Bruijn <willemb@google.com>

No need for a cover letter for a single patch btw.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH net v2 0/1] net: change maximum number of UDP segments to 128
  2024-04-11  5:11 [PATCH net v2 0/1] net: change maximum number of UDP segments to 128 Yuri Benditovich
  2024-04-11  5:11 ` [PATCH net v2 1/1] " Yuri Benditovich
@ 2024-04-14 16:10 ` patchwork-bot+netdevbpf
  1 sibling, 0 replies; 5+ messages in thread
From: patchwork-bot+netdevbpf @ 2024-04-14 16:10 UTC (permalink / raw)
  To: Yuri Benditovich
  Cc: willemdebruijn.kernel, davem, edumazet, kuba, pabeni, shuah,
	jasowang, linux-kernel, netdev, linux-kselftest, yan, andrew

Hello:

This patch was applied to netdev/net.git (main)
by David S. Miller <davem@davemloft.net>:

On Thu, 11 Apr 2024 08:11:23 +0300 you wrote:
> v1->v2:
> Fixed placement of 'Fixed:' line
> Extended commit message
> 
> Yuri Benditovich (1):
>   net: change maximum number of UDP segments to 128
> 
> [...]

Here is the summary with links:
  - [net,v2,1/1] net: change maximum number of UDP segments to 128
    https://git.kernel.org/netdev/net/c/1382e3b6a350

You are awesome, thank you!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2024-04-14 16:10 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-04-11  5:11 [PATCH net v2 0/1] net: change maximum number of UDP segments to 128 Yuri Benditovich
2024-04-11  5:11 ` [PATCH net v2 1/1] " Yuri Benditovich
2024-04-11  5:36   ` Yuri Benditovich
2024-04-11 16:01   ` Willem de Bruijn
2024-04-14 16:10 ` [PATCH net v2 0/1] " patchwork-bot+netdevbpf

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox