bpf.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH bpf-next v2] selftests/bpf: Fix endianness issue in sk_assign
@ 2020-09-15 11:38 Ilya Leoshkevich
  2020-09-16  1:18 ` Andrii Nakryiko
  2020-09-18 23:08 ` Daniel Borkmann
  0 siblings, 2 replies; 4+ messages in thread
From: Ilya Leoshkevich @ 2020-09-15 11:38 UTC (permalink / raw)
  To: Alexei Starovoitov, Daniel Borkmann
  Cc: bpf, Heiko Carstens, Vasily Gorbik, Andrii Nakryiko, Ilya Leoshkevich

server_map's value size is 8, but the test tries to put an int there.
This sort of works on x86 (unless followed by non-0), but hard fails on
s390.

Fix by using __s64 instead of int.

Fixes: 2d7824ffd25c ("selftests: bpf: Add test for sk_assign")
Signed-off-by: Ilya Leoshkevich <iii@linux.ibm.com>
---

v1->v2: Use __s64.

tools/testing/selftests/bpf/prog_tests/sk_assign.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/testing/selftests/bpf/prog_tests/sk_assign.c b/tools/testing/selftests/bpf/prog_tests/sk_assign.c
index a49a26f95a8b..3a469099f30d 100644
--- a/tools/testing/selftests/bpf/prog_tests/sk_assign.c
+++ b/tools/testing/selftests/bpf/prog_tests/sk_assign.c
@@ -265,7 +265,7 @@ void test_sk_assign(void)
 		TEST("ipv6 udp port redir", AF_INET6, SOCK_DGRAM, false),
 		TEST("ipv6 udp addr redir", AF_INET6, SOCK_DGRAM, true),
 	};
-	int server = -1;
+	__s64 server = -1;
 	int server_map;
 	int self_net;
 	int i;
-- 
2.25.4


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

* Re: [PATCH bpf-next v2] selftests/bpf: Fix endianness issue in sk_assign
  2020-09-15 11:38 [PATCH bpf-next v2] selftests/bpf: Fix endianness issue in sk_assign Ilya Leoshkevich
@ 2020-09-16  1:18 ` Andrii Nakryiko
  2020-09-16 22:19   ` Song Liu
  2020-09-18 23:08 ` Daniel Borkmann
  1 sibling, 1 reply; 4+ messages in thread
From: Andrii Nakryiko @ 2020-09-16  1:18 UTC (permalink / raw)
  To: Ilya Leoshkevich
  Cc: Alexei Starovoitov, Daniel Borkmann, bpf, Heiko Carstens, Vasily Gorbik

On Tue, Sep 15, 2020 at 4:38 AM Ilya Leoshkevich <iii@linux.ibm.com> wrote:
>
> server_map's value size is 8, but the test tries to put an int there.
> This sort of works on x86 (unless followed by non-0), but hard fails on
> s390.
>
> Fix by using __s64 instead of int.
>
> Fixes: 2d7824ffd25c ("selftests: bpf: Add test for sk_assign")
> Signed-off-by: Ilya Leoshkevich <iii@linux.ibm.com>
> ---
>
> v1->v2: Use __s64.

Acked-by: Andrii Nakryiko <andriin@fb.com>

>
> tools/testing/selftests/bpf/prog_tests/sk_assign.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/tools/testing/selftests/bpf/prog_tests/sk_assign.c b/tools/testing/selftests/bpf/prog_tests/sk_assign.c
> index a49a26f95a8b..3a469099f30d 100644
> --- a/tools/testing/selftests/bpf/prog_tests/sk_assign.c
> +++ b/tools/testing/selftests/bpf/prog_tests/sk_assign.c
> @@ -265,7 +265,7 @@ void test_sk_assign(void)
>                 TEST("ipv6 udp port redir", AF_INET6, SOCK_DGRAM, false),
>                 TEST("ipv6 udp addr redir", AF_INET6, SOCK_DGRAM, true),
>         };
> -       int server = -1;
> +       __s64 server = -1;
>         int server_map;
>         int self_net;
>         int i;
> --
> 2.25.4
>

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

* Re: [PATCH bpf-next v2] selftests/bpf: Fix endianness issue in sk_assign
  2020-09-16  1:18 ` Andrii Nakryiko
@ 2020-09-16 22:19   ` Song Liu
  0 siblings, 0 replies; 4+ messages in thread
From: Song Liu @ 2020-09-16 22:19 UTC (permalink / raw)
  To: Andrii Nakryiko
  Cc: Ilya Leoshkevich, Alexei Starovoitov, Daniel Borkmann, bpf,
	Heiko Carstens, Vasily Gorbik

On Tue, Sep 15, 2020 at 6:19 PM Andrii Nakryiko
<andrii.nakryiko@gmail.com> wrote:
>
> On Tue, Sep 15, 2020 at 4:38 AM Ilya Leoshkevich <iii@linux.ibm.com> wrote:
> >
> > server_map's value size is 8, but the test tries to put an int there.
> > This sort of works on x86 (unless followed by non-0), but hard fails on
> > s390.
> >
> > Fix by using __s64 instead of int.
> >
> > Fixes: 2d7824ffd25c ("selftests: bpf: Add test for sk_assign")
> > Signed-off-by: Ilya Leoshkevich <iii@linux.ibm.com>
> > ---
> >
> > v1->v2: Use __s64.
>
> Acked-by: Andrii Nakryiko <andriin@fb.com>

Acked-by: Song Liu <songliubraving@fb.com>

[...]

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

* Re: [PATCH bpf-next v2] selftests/bpf: Fix endianness issue in sk_assign
  2020-09-15 11:38 [PATCH bpf-next v2] selftests/bpf: Fix endianness issue in sk_assign Ilya Leoshkevich
  2020-09-16  1:18 ` Andrii Nakryiko
@ 2020-09-18 23:08 ` Daniel Borkmann
  1 sibling, 0 replies; 4+ messages in thread
From: Daniel Borkmann @ 2020-09-18 23:08 UTC (permalink / raw)
  To: Ilya Leoshkevich, Alexei Starovoitov
  Cc: bpf, Heiko Carstens, Vasily Gorbik, Andrii Nakryiko

On 9/15/20 1:38 PM, Ilya Leoshkevich wrote:
> server_map's value size is 8, but the test tries to put an int there.
> This sort of works on x86 (unless followed by non-0), but hard fails on
> s390.
> 
> Fix by using __s64 instead of int.
> 
> Fixes: 2d7824ffd25c ("selftests: bpf: Add test for sk_assign")
> Signed-off-by: Ilya Leoshkevich <iii@linux.ibm.com>

Applied, thanks!

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

end of thread, other threads:[~2020-09-18 23:19 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-15 11:38 [PATCH bpf-next v2] selftests/bpf: Fix endianness issue in sk_assign Ilya Leoshkevich
2020-09-16  1:18 ` Andrii Nakryiko
2020-09-16 22:19   ` Song Liu
2020-09-18 23:08 ` Daniel Borkmann

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).