All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH net] selftests: net: tcp_mmap: fix SO_RCVLOWAT setting
@ 2020-05-06 16:21 Eric Dumazet
  2020-05-06 16:27 ` Soheil Hassas Yeganeh
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Eric Dumazet @ 2020-05-06 16:21 UTC (permalink / raw)
  To: David S . Miller
  Cc: netdev, Eric Dumazet, Eric Dumazet, Soheil Hassas Yeganeh, Arjun Roy

Since chunk_size is no longer an integer, we can not
use it directly as an argument of setsockopt().

This patch should fix tcp_mmap for Big Endian kernels.

Fixes: 597b01edafac ("selftests: net: avoid ptl lock contention in tcp_mmap")
Signed-off-by: Eric Dumazet <edumazet@google.com>
Cc: Soheil Hassas Yeganeh <soheil@google.com>
Cc: Arjun Roy <arjunroy@google.com>
---
 tools/testing/selftests/net/tcp_mmap.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/tools/testing/selftests/net/tcp_mmap.c b/tools/testing/selftests/net/tcp_mmap.c
index 62171fd638c817dabe2d988f3cfae74522112584..4555f88252bafd31d6c225590316f03b08d3b132 100644
--- a/tools/testing/selftests/net/tcp_mmap.c
+++ b/tools/testing/selftests/net/tcp_mmap.c
@@ -282,12 +282,14 @@ static void setup_sockaddr(int domain, const char *str_addr,
 static void do_accept(int fdlisten)
 {
 	pthread_attr_t attr;
+	int rcvlowat;
 
 	pthread_attr_init(&attr);
 	pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
 
+	rcvlowat = chunk_size;
 	if (setsockopt(fdlisten, SOL_SOCKET, SO_RCVLOWAT,
-		       &chunk_size, sizeof(chunk_size)) == -1) {
+		       &rcvlowat, sizeof(rcvlowat)) == -1) {
 		perror("setsockopt SO_RCVLOWAT");
 	}
 
-- 
2.26.2.526.g744177e7f7-goog


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

* Re: [PATCH net] selftests: net: tcp_mmap: fix SO_RCVLOWAT setting
  2020-05-06 16:21 [PATCH net] selftests: net: tcp_mmap: fix SO_RCVLOWAT setting Eric Dumazet
@ 2020-05-06 16:27 ` Soheil Hassas Yeganeh
  2020-05-06 22:01 ` David Miller
  2020-05-06 22:03 ` David Miller
  2 siblings, 0 replies; 4+ messages in thread
From: Soheil Hassas Yeganeh @ 2020-05-06 16:27 UTC (permalink / raw)
  To: Eric Dumazet; +Cc: David S . Miller, netdev, Eric Dumazet, Arjun Roy

On Wed, May 6, 2020 at 12:21 PM Eric Dumazet <edumazet@google.com> wrote:
>
> Since chunk_size is no longer an integer, we can not
> use it directly as an argument of setsockopt().
>
> This patch should fix tcp_mmap for Big Endian kernels.
>
> Fixes: 597b01edafac ("selftests: net: avoid ptl lock contention in tcp_mmap")
> Signed-off-by: Eric Dumazet <edumazet@google.com>
> Cc: Soheil Hassas Yeganeh <soheil@google.com>
> Cc: Arjun Roy <arjunroy@google.com>

Acked-by: Soheil Hassas Yeganeh <soheil@google.com>

> ---
>  tools/testing/selftests/net/tcp_mmap.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/tools/testing/selftests/net/tcp_mmap.c b/tools/testing/selftests/net/tcp_mmap.c
> index 62171fd638c817dabe2d988f3cfae74522112584..4555f88252bafd31d6c225590316f03b08d3b132 100644
> --- a/tools/testing/selftests/net/tcp_mmap.c
> +++ b/tools/testing/selftests/net/tcp_mmap.c
> @@ -282,12 +282,14 @@ static void setup_sockaddr(int domain, const char *str_addr,
>  static void do_accept(int fdlisten)
>  {
>         pthread_attr_t attr;
> +       int rcvlowat;
>
>         pthread_attr_init(&attr);
>         pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
>
> +       rcvlowat = chunk_size;
>         if (setsockopt(fdlisten, SOL_SOCKET, SO_RCVLOWAT,
> -                      &chunk_size, sizeof(chunk_size)) == -1) {
> +                      &rcvlowat, sizeof(rcvlowat)) == -1) {
>                 perror("setsockopt SO_RCVLOWAT");
>         }
>
> --
> 2.26.2.526.g744177e7f7-goog
>

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

* Re: [PATCH net] selftests: net: tcp_mmap: fix SO_RCVLOWAT setting
  2020-05-06 16:21 [PATCH net] selftests: net: tcp_mmap: fix SO_RCVLOWAT setting Eric Dumazet
  2020-05-06 16:27 ` Soheil Hassas Yeganeh
@ 2020-05-06 22:01 ` David Miller
  2020-05-06 22:03 ` David Miller
  2 siblings, 0 replies; 4+ messages in thread
From: David Miller @ 2020-05-06 22:01 UTC (permalink / raw)
  To: edumazet; +Cc: netdev, eric.dumazet, soheil, arjunroy

From: Eric Dumazet <edumazet@google.com>
Date: Wed,  6 May 2020 09:21:15 -0700

> Since chunk_size is no longer an integer, we can not
> use it directly as an argument of setsockopt().
> 
> This patch should fix tcp_mmap for Big Endian kernels.
> 
> Fixes: 597b01edafac ("selftests: net: avoid ptl lock contention in tcp_mmap")
> Signed-off-by: Eric Dumazet <edumazet@google.com>

Applied, thanks Eric.

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

* Re: [PATCH net] selftests: net: tcp_mmap: fix SO_RCVLOWAT setting
  2020-05-06 16:21 [PATCH net] selftests: net: tcp_mmap: fix SO_RCVLOWAT setting Eric Dumazet
  2020-05-06 16:27 ` Soheil Hassas Yeganeh
  2020-05-06 22:01 ` David Miller
@ 2020-05-06 22:03 ` David Miller
  2 siblings, 0 replies; 4+ messages in thread
From: David Miller @ 2020-05-06 22:03 UTC (permalink / raw)
  To: edumazet; +Cc: netdev, eric.dumazet, soheil, arjunroy

From: Eric Dumazet <edumazet@google.com>
Date: Wed,  6 May 2020 09:21:15 -0700

> Since chunk_size is no longer an integer, we can not
> use it directly as an argument of setsockopt().
> 
> This patch should fix tcp_mmap for Big Endian kernels.
> 
> Fixes: 597b01edafac ("selftests: net: avoid ptl lock contention in tcp_mmap")
> Signed-off-by: Eric Dumazet <edumazet@google.com>

Applied and queued up for -stable.

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

end of thread, other threads:[~2020-05-06 22:03 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-06 16:21 [PATCH net] selftests: net: tcp_mmap: fix SO_RCVLOWAT setting Eric Dumazet
2020-05-06 16:27 ` Soheil Hassas Yeganeh
2020-05-06 22:01 ` David Miller
2020-05-06 22:03 ` David Miller

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.