All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] test_bpf: flag tests that cannot be jited on s390
@ 2018-06-27 15:19 Kleber Sacilotto de Souza
  2018-06-28 17:31 ` Song Liu
  2018-06-28 22:01 ` Daniel Borkmann
  0 siblings, 2 replies; 3+ messages in thread
From: Kleber Sacilotto de Souza @ 2018-06-27 15:19 UTC (permalink / raw)
  To: linux-s390, netdev; +Cc: Alexei Starovoitov, Daniel Borkmann

Flag with FLAG_EXPECTED_FAIL the BPF_MAXINSNS tests that cannot be jited
on s390 because they exceed BPF_SIZE_MAX and fail when
CONFIG_BPF_JIT_ALWAYS_ON is set. Also set .expected_errcode to -ENOTSUPP
so the tests pass in that case.

Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
---
 lib/test_bpf.c | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)

diff --git a/lib/test_bpf.c b/lib/test_bpf.c
index 60aedc879361..08d3d59dca17 100644
--- a/lib/test_bpf.c
+++ b/lib/test_bpf.c
@@ -5282,21 +5282,31 @@ static struct bpf_test tests[] = {
 	{	/* Mainly checking JIT here. */
 		"BPF_MAXINSNS: Ctx heavy transformations",
 		{ },
+#if defined(CONFIG_BPF_JIT_ALWAYS_ON) && defined(CONFIG_S390)
+		CLASSIC | FLAG_EXPECTED_FAIL,
+#else
 		CLASSIC,
+#endif
 		{ },
 		{
 			{  1, !!(SKB_VLAN_TCI & VLAN_TAG_PRESENT) },
 			{ 10, !!(SKB_VLAN_TCI & VLAN_TAG_PRESENT) }
 		},
 		.fill_helper = bpf_fill_maxinsns6,
+		.expected_errcode = -ENOTSUPP,
 	},
 	{	/* Mainly checking JIT here. */
 		"BPF_MAXINSNS: Call heavy transformations",
 		{ },
+#if defined(CONFIG_BPF_JIT_ALWAYS_ON) && defined(CONFIG_S390)
+		CLASSIC | FLAG_NO_DATA | FLAG_EXPECTED_FAIL,
+#else
 		CLASSIC | FLAG_NO_DATA,
+#endif
 		{ },
 		{ { 1, 0 }, { 10, 0 } },
 		.fill_helper = bpf_fill_maxinsns7,
+		.expected_errcode = -ENOTSUPP,
 	},
 	{	/* Mainly checking JIT here. */
 		"BPF_MAXINSNS: Jump heavy test",
@@ -5347,18 +5357,28 @@ static struct bpf_test tests[] = {
 	{
 		"BPF_MAXINSNS: exec all MSH",
 		{ },
+#if defined(CONFIG_BPF_JIT_ALWAYS_ON) && defined(CONFIG_S390)
+		CLASSIC | FLAG_EXPECTED_FAIL,
+#else
 		CLASSIC,
+#endif
 		{ 0xfa, 0xfb, 0xfc, 0xfd, },
 		{ { 4, 0xababab83 } },
 		.fill_helper = bpf_fill_maxinsns13,
+		.expected_errcode = -ENOTSUPP,
 	},
 	{
 		"BPF_MAXINSNS: ld_abs+get_processor_id",
 		{ },
+#if defined(CONFIG_BPF_JIT_ALWAYS_ON) && defined(CONFIG_S390)
+		CLASSIC | FLAG_EXPECTED_FAIL,
+#else
 		CLASSIC,
+#endif
 		{ },
 		{ { 1, 0xbee } },
 		.fill_helper = bpf_fill_ld_abs_get_processor_id,
+		.expected_errcode = -ENOTSUPP,
 	},
 	/*
 	 * LD_IND / LD_ABS on fragmented SKBs
-- 
2.17.1

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

* Re: [PATCH] test_bpf: flag tests that cannot be jited on s390
  2018-06-27 15:19 [PATCH] test_bpf: flag tests that cannot be jited on s390 Kleber Sacilotto de Souza
@ 2018-06-28 17:31 ` Song Liu
  2018-06-28 22:01 ` Daniel Borkmann
  1 sibling, 0 replies; 3+ messages in thread
From: Song Liu @ 2018-06-28 17:31 UTC (permalink / raw)
  To: Kleber Sacilotto de Souza
  Cc: linux-s390, Networking, Alexei Starovoitov, Daniel Borkmann

On Wed, Jun 27, 2018 at 8:19 AM, Kleber Sacilotto de Souza
<kleber.souza@canonical.com> wrote:
> Flag with FLAG_EXPECTED_FAIL the BPF_MAXINSNS tests that cannot be jited
> on s390 because they exceed BPF_SIZE_MAX and fail when
> CONFIG_BPF_JIT_ALWAYS_ON is set. Also set .expected_errcode to -ENOTSUPP
> so the tests pass in that case.
>
> Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>

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

> ---
>  lib/test_bpf.c | 20 ++++++++++++++++++++
>  1 file changed, 20 insertions(+)
>
> diff --git a/lib/test_bpf.c b/lib/test_bpf.c
> index 60aedc879361..08d3d59dca17 100644
> --- a/lib/test_bpf.c
> +++ b/lib/test_bpf.c
> @@ -5282,21 +5282,31 @@ static struct bpf_test tests[] = {
>         {       /* Mainly checking JIT here. */
>                 "BPF_MAXINSNS: Ctx heavy transformations",
>                 { },
> +#if defined(CONFIG_BPF_JIT_ALWAYS_ON) && defined(CONFIG_S390)
> +               CLASSIC | FLAG_EXPECTED_FAIL,
> +#else
>                 CLASSIC,
> +#endif
>                 { },
>                 {
>                         {  1, !!(SKB_VLAN_TCI & VLAN_TAG_PRESENT) },
>                         { 10, !!(SKB_VLAN_TCI & VLAN_TAG_PRESENT) }
>                 },
>                 .fill_helper = bpf_fill_maxinsns6,
> +               .expected_errcode = -ENOTSUPP,
>         },
>         {       /* Mainly checking JIT here. */
>                 "BPF_MAXINSNS: Call heavy transformations",
>                 { },
> +#if defined(CONFIG_BPF_JIT_ALWAYS_ON) && defined(CONFIG_S390)
> +               CLASSIC | FLAG_NO_DATA | FLAG_EXPECTED_FAIL,
> +#else
>                 CLASSIC | FLAG_NO_DATA,
> +#endif
>                 { },
>                 { { 1, 0 }, { 10, 0 } },
>                 .fill_helper = bpf_fill_maxinsns7,
> +               .expected_errcode = -ENOTSUPP,
>         },
>         {       /* Mainly checking JIT here. */
>                 "BPF_MAXINSNS: Jump heavy test",
> @@ -5347,18 +5357,28 @@ static struct bpf_test tests[] = {
>         {
>                 "BPF_MAXINSNS: exec all MSH",
>                 { },
> +#if defined(CONFIG_BPF_JIT_ALWAYS_ON) && defined(CONFIG_S390)
> +               CLASSIC | FLAG_EXPECTED_FAIL,
> +#else
>                 CLASSIC,
> +#endif
>                 { 0xfa, 0xfb, 0xfc, 0xfd, },
>                 { { 4, 0xababab83 } },
>                 .fill_helper = bpf_fill_maxinsns13,
> +               .expected_errcode = -ENOTSUPP,
>         },
>         {
>                 "BPF_MAXINSNS: ld_abs+get_processor_id",
>                 { },
> +#if defined(CONFIG_BPF_JIT_ALWAYS_ON) && defined(CONFIG_S390)
> +               CLASSIC | FLAG_EXPECTED_FAIL,
> +#else
>                 CLASSIC,
> +#endif
>                 { },
>                 { { 1, 0xbee } },
>                 .fill_helper = bpf_fill_ld_abs_get_processor_id,
> +               .expected_errcode = -ENOTSUPP,
>         },
>         /*
>          * LD_IND / LD_ABS on fragmented SKBs
> --
> 2.17.1
>

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

* Re: [PATCH] test_bpf: flag tests that cannot be jited on s390
  2018-06-27 15:19 [PATCH] test_bpf: flag tests that cannot be jited on s390 Kleber Sacilotto de Souza
  2018-06-28 17:31 ` Song Liu
@ 2018-06-28 22:01 ` Daniel Borkmann
  1 sibling, 0 replies; 3+ messages in thread
From: Daniel Borkmann @ 2018-06-28 22:01 UTC (permalink / raw)
  To: Kleber Sacilotto de Souza, linux-s390, netdev; +Cc: Alexei Starovoitov

On 06/27/2018 05:19 PM, Kleber Sacilotto de Souza wrote:
> Flag with FLAG_EXPECTED_FAIL the BPF_MAXINSNS tests that cannot be jited
> on s390 because they exceed BPF_SIZE_MAX and fail when
> CONFIG_BPF_JIT_ALWAYS_ON is set. Also set .expected_errcode to -ENOTSUPP
> so the tests pass in that case.
> 
> Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>

Applied to bpf, thanks Kleber!

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

end of thread, other threads:[~2018-06-28 22:01 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-06-27 15:19 [PATCH] test_bpf: flag tests that cannot be jited on s390 Kleber Sacilotto de Souza
2018-06-28 17:31 ` Song Liu
2018-06-28 22:01 ` Daniel Borkmann

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.