* [PATCH mptcp-next] Squash to "selftests: bpf: add MPTCP test base"
@ 2022-04-27 1:28 Geliang Tang
2022-04-27 2:58 ` Squash to "selftests: bpf: add MPTCP test base": Tests Results MPTCP CI
2022-04-27 10:09 ` [PATCH mptcp-next] Squash to "selftests: bpf: add MPTCP test base" Matthieu Baerts
0 siblings, 2 replies; 8+ messages in thread
From: Geliang Tang @ 2022-04-27 1:28 UTC (permalink / raw)
To: mptcp; +Cc: Geliang Tang
Add CONFIG_IKCONFIG and CONFIG_IKCONFIG_PROC as Mat suggested.
Signed-off-by: Geliang Tang <geliang.tang@suse.com>
---
tools/testing/selftests/bpf/config | 2 ++
1 file changed, 2 insertions(+)
diff --git a/tools/testing/selftests/bpf/config b/tools/testing/selftests/bpf/config
index fe0d3ad6ecd8..f3391d0abe58 100644
--- a/tools/testing/selftests/bpf/config
+++ b/tools/testing/selftests/bpf/config
@@ -54,3 +54,5 @@ CONFIG_NF_DEFRAG_IPV6=y
CONFIG_NF_CONNTRACK=y
CONFIG_USERFAULTFD=y
CONFIG_MPTCP=y
+CONFIG_IKCONFIG=y
+CONFIG_IKCONFIG_PROC=y
--
2.34.1
^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: Squash to "selftests: bpf: add MPTCP test base": Tests Results
2022-04-27 1:28 [PATCH mptcp-next] Squash to "selftests: bpf: add MPTCP test base" Geliang Tang
@ 2022-04-27 2:58 ` MPTCP CI
2022-04-27 10:09 ` [PATCH mptcp-next] Squash to "selftests: bpf: add MPTCP test base" Matthieu Baerts
1 sibling, 0 replies; 8+ messages in thread
From: MPTCP CI @ 2022-04-27 2:58 UTC (permalink / raw)
To: Geliang Tang; +Cc: mptcp
Hi Geliang,
Thank you for your modifications, that's great!
Our CI did some validations and here is its report:
- KVM Validation: normal:
- Success! ✅:
- Task: https://cirrus-ci.com/task/5557640280408064
- Summary: https://api.cirrus-ci.com/v1/artifact/task/5557640280408064/summary/summary.txt
- KVM Validation: debug:
- Unstable: 2 failed test(s): selftest_diag selftest_mptcp_join 🔴:
- Task: https://cirrus-ci.com/task/6683540187250688
- Summary: https://api.cirrus-ci.com/v1/artifact/task/6683540187250688/summary/summary.txt
Initiator: Patchew Applier
Commits: https://github.com/multipath-tcp/mptcp_net-next/commits/915cd06abad0
If there are some issues, you can reproduce them using the same environment as
the one used by the CI thanks to a docker image, e.g.:
$ cd [kernel source code]
$ docker run -v "${PWD}:${PWD}:rw" -w "${PWD}" --privileged --rm -it \
--pull always mptcp/mptcp-upstream-virtme-docker:latest \
auto-debug
For more details:
https://github.com/multipath-tcp/mptcp-upstream-virtme-docker
Please note that despite all the efforts that have been already done to have a
stable tests suite when executed on a public CI like here, it is possible some
reported issues are not due to your modifications. Still, do not hesitate to
help us improve that ;-)
Cheers,
MPTCP GH Action bot
Bot operated by Matthieu Baerts (Tessares)
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH mptcp-next] Squash to "selftests: bpf: add MPTCP test base"
2022-04-27 1:28 [PATCH mptcp-next] Squash to "selftests: bpf: add MPTCP test base" Geliang Tang
2022-04-27 2:58 ` Squash to "selftests: bpf: add MPTCP test base": Tests Results MPTCP CI
@ 2022-04-27 10:09 ` Matthieu Baerts
2022-04-27 17:33 ` Mat Martineau
1 sibling, 1 reply; 8+ messages in thread
From: Matthieu Baerts @ 2022-04-27 10:09 UTC (permalink / raw)
To: Geliang Tang, mptcp
Hi Geliang,
Thank you for the patch!
On 27/04/2022 03:28, Geliang Tang wrote:
> Add CONFIG_IKCONFIG and CONFIG_IKCONFIG_PROC as Mat suggested.
Mat's second reply on...
Squash to "selftests: bpf: test bpf_skc_to_mptcp_sock"
...patch confuses me but I think he meant: we need this patch as it is
and that's why it is marked as Queued on Patchwork. But for this fix
here, it is probably best to have a dedicated patch and not a Squash-to
one because these two config should have been added before as they are
needed by other BPF selftests.
Did I misunderstand?
Cheers,
Matt
--
Tessares | Belgium | Hybrid Access Solutions
www.tessares.net
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH mptcp-next] Squash to "selftests: bpf: add MPTCP test base"
2022-04-27 10:09 ` [PATCH mptcp-next] Squash to "selftests: bpf: add MPTCP test base" Matthieu Baerts
@ 2022-04-27 17:33 ` Mat Martineau
0 siblings, 0 replies; 8+ messages in thread
From: Mat Martineau @ 2022-04-27 17:33 UTC (permalink / raw)
To: Matthieu Baerts; +Cc: Geliang Tang, mptcp
On Wed, 27 Apr 2022, Matthieu Baerts wrote:
> Hi Geliang,
>
> Thank you for the patch!
>
> On 27/04/2022 03:28, Geliang Tang wrote:
>> Add CONFIG_IKCONFIG and CONFIG_IKCONFIG_PROC as Mat suggested.
>
> Mat's second reply on...
>
> Squash to "selftests: bpf: test bpf_skc_to_mptcp_sock"
>
> ...patch confuses me but I think he meant: we need this patch as it is
> and that's why it is marked as Queued on Patchwork. But for this fix
> here, it is probably best to have a dedicated patch and not a Squash-to
> one because these two config should have been added before as they are
> needed by other BPF selftests.
>
> Did I misunderstand?
>
You understood correctly, Mattheiu. If I send a v2 of the bpf-next patches
today I will add the commit and also queue it in our patchwork.
--
Mat Martineau
Intel
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH mptcp-next] Squash to "selftests: bpf: add MPTCP test base"
2022-05-07 6:17 Geliang Tang
@ 2022-05-09 11:53 ` Matthieu Baerts
0 siblings, 0 replies; 8+ messages in thread
From: Matthieu Baerts @ 2022-05-09 11:53 UTC (permalink / raw)
To: Geliang Tang, mptcp
Hi Geliang,
On 07/05/2022 08:17, Geliang Tang wrote:
> Address to Andrii's comments:
> - add copyright 2022
> - use ASSERT_* instead of CHECK_FAIL
> - drop SEC("version")
Thank you for the patches!
I also replaced a few ASSERT_GT() by ASSERT_GE() and update the commit
messages: prefix + changelog. Please check if I didn't miss anything :)
- f0bf012a62d0: "squashed" in "selftests: bpf: add MPTCP test base"
- bcb1ed91a0e2: use ASSERT_GE instead of _GT: fd == 0 is valid
- d13c2826b435: conflict in t/selftests-bpf-test-bpf_skc_to_mptcp_sock
- Results: 2b6d9d722f05..2b4b3ea4ee81 (export)
- b8c48e454a31: "squashed" in "selftests: bpf: test bpf_skc_to_mptcp_sock"
- c2d9dbcf32da: use ASSERT_GE instead of _GT: fd == 0 is valid
- 909c2e46449c: conflict in
t/selftests-bpf-verify-ca_name-of-struct-mptcp_sock
- Results: 2b4b3ea4ee81..edd1596ddede (export)
- 105fd75cff3a: "squashed" in "selftests: bpf: test bpf_skc_to_mptcp_sock"
- Results: bb750830dfba..21c7846253fc (export)
- d2a584bb2988: "squashed" in "selftests: bpf: verify token of struct
mptcp_sock"
- 023c51695e66: use ASSERT_GE instead of _GT: fd == 0 is valid
- Results: edd1596ddede..44a1ca452f9d (export)
- 18126dc0fe4f: "squashed" in "selftests: bpf: verify ca_name of struct
mptcp_sock"
- 8d3b8669d7a4: use ASSERT_GE instead of _GT: fd == 0 is valid
- Results: 44a1ca452f9d..bb750830dfba (export)
- 67678621ed32: "squashed" in "selftests: bpf: add bpf_first test"
- Results: 21c7846253fc..ae3944c04e7a (export)
- 17c227d200aa: tg:msg: add changelog for "bpf: add
bpf_skc_to_mptcp_sock_proto"
- 94caf3b41f66: tg:msg: add changelog for "selftests: bpf: Enable
CONFIG_IKCONFIG_PROC in config"
- 8da49841ed59: tg:msg: fix prefix for "selftests: bpf: Enable
CONFIG_IKCONFIG_PROC in config"
- 3f14113ff1f6: tg:msg: add changelog for "selftests: bpf: add MPTCP
test base"
- 542fa9c889e0: tg:msg: fix prefix for "selftests: bpf: add MPTCP test base"
- 9f1d3a3094b4: tg:msg: add changelog for "selftests: bpf: test
bpf_skc_to_mptcp_sock"
- e8c7107863e8: tg:msg: fix prefix for "selftests: bpf: test
bpf_skc_to_mptcp_sock"
- b6003fc6580c: tg:msg: add changelog for "selftests: bpf: verify token
of struct mptcp_sock"
- 7195dbb7ee5d: tg:msg: fix prefix for "selftests: bpf: verify token of
struct mptcp_sock"
- 58ce37bdb3ce: tg:msg: add changelog for "selftests: bpf: verify
ca_name of struct mptcp_sock"
- 5431605d68cc: tg:msg: fix prefix for "selftests: bpf: verify ca_name
of struct mptcp_sock"
- 9fc1e8122379: tg:msg: fix prefix for "selftests: bpf: verify first of
struct mptcp_sock"
- c007e06819ef: tg:msg: 'selftests: bpf:' -> 'selftests/bpf:'
- 227c9d78e571: tg:msg: 'selftests: bpf:' -> 'selftests/bpf:'
> diff --git a/tools/testing/selftests/bpf/prog_tests/mptcp.c b/tools/testing/selftests/bpf/prog_tests/mptcp.c
> index cd548bb2828f..760374f1fce4 100644
> --- a/tools/testing/selftests/bpf/prog_tests/mptcp.c
> +++ b/tools/testing/selftests/bpf/prog_tests/mptcp.c
(...)
> prog_fd = bpf_program__fd(prog);
> - if (CHECK_FAIL(prog_fd < 0)) {
> + if (!ASSERT_GT(prog_fd, 0, "bpf_program__fd")) {
See my commit bcb1ed91a0e2 and a few others after: the fd can be zero,
we need to use ASSERT_GE().
Builds and tests are now in progress:
https://cirrus-ci.com/github/multipath-tcp/mptcp_net-next/export/20220509T115202
https://github.com/multipath-tcp/mptcp_net-next/actions/workflows/build-validation.yml?query=branch:export
Cheers,
Matt
--
Tessares | Belgium | Hybrid Access Solutions
www.tessares.net
^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH mptcp-next] Squash to "selftests: bpf: add MPTCP test base"
@ 2022-05-07 6:17 Geliang Tang
2022-05-09 11:53 ` Matthieu Baerts
0 siblings, 1 reply; 8+ messages in thread
From: Geliang Tang @ 2022-05-07 6:17 UTC (permalink / raw)
To: mptcp; +Cc: Geliang Tang
Address to Andrii's comments:
- add copyright 2022
- use ASSERT_* instead of CHECK_FAIL
- drop SEC("version")
Signed-off-by: Geliang Tang <geliang.tang@suse.com>
---
.../testing/selftests/bpf/prog_tests/mptcp.c | 24 +++++++++----------
.../testing/selftests/bpf/progs/mptcp_sock.c | 2 +-
2 files changed, 13 insertions(+), 13 deletions(-)
diff --git a/tools/testing/selftests/bpf/prog_tests/mptcp.c b/tools/testing/selftests/bpf/prog_tests/mptcp.c
index cd548bb2828f..760374f1fce4 100644
--- a/tools/testing/selftests/bpf/prog_tests/mptcp.c
+++ b/tools/testing/selftests/bpf/prog_tests/mptcp.c
@@ -1,5 +1,6 @@
// SPDX-License-Identifier: GPL-2.0
/* Copyright (c) 2020, Tessares SA. */
+/* Copyright (c) 2022, SUSE. */
#include <test_progs.h>
#include "cgroup_helpers.h"
@@ -12,16 +13,15 @@ struct mptcp_storage {
static int verify_sk(int map_fd, int client_fd, const char *msg, __u32 is_mptcp)
{
- int err = 0, cfd = client_fd;
+ int err, cfd = client_fd;
struct mptcp_storage val;
if (is_mptcp == 1)
return 0;
- if (CHECK_FAIL(bpf_map_lookup_elem(map_fd, &cfd, &val) < 0)) {
- perror("Failed to read socket storage");
- return -1;
- }
+ err = bpf_map_lookup_elem(map_fd, &cfd, &val);
+ if (!ASSERT_OK(err, "bpf_map_lookup_elem"))
+ return err;
if (val.invoked != 1) {
log_err("%s: unexpected invoked count %d != 1",
@@ -50,40 +50,40 @@ static int run_test(int cgroup_fd, int server_fd, bool is_mptcp)
return -EIO;
err = bpf_object__load(obj);
- if (CHECK_FAIL(err))
+ if (!ASSERT_OK(err, "bpf_object__load"))
goto out;
prog = bpf_object__find_program_by_name(obj, "_sockops");
- if (CHECK_FAIL(!prog)) {
+ if (!ASSERT_OK_PTR(prog, "bpf_object__find_program_by_name")) {
err = -EIO;
goto out;
}
prog_fd = bpf_program__fd(prog);
- if (CHECK_FAIL(prog_fd < 0)) {
+ if (!ASSERT_GT(prog_fd, 0, "bpf_program__fd")) {
err = -EIO;
goto out;
}
map = bpf_object__find_map_by_name(obj, "socket_storage_map");
- if (CHECK_FAIL(!map)) {
+ if (!ASSERT_OK_PTR(map, "bpf_object__find_map_by_name")) {
err = -EIO;
goto out;
}
map_fd = bpf_map__fd(map);
- if (CHECK_FAIL(map_fd < 0)) {
+ if (!ASSERT_GT(map_fd, 0, "bpf_map__fd")) {
err = -EIO;
goto out;
}
err = bpf_prog_attach(prog_fd, cgroup_fd, BPF_CGROUP_SOCK_OPS, 0);
- if (CHECK_FAIL(err))
+ if (!ASSERT_OK(err, "bpf_prog_attach"))
goto out;
client_fd = is_mptcp ? connect_to_mptcp_fd(server_fd, 0) :
connect_to_fd(server_fd, 0);
- if (client_fd < 0) {
+ if (!ASSERT_GT(client_fd, 0, "connect to fd")) {
err = -EIO;
goto out;
}
diff --git a/tools/testing/selftests/bpf/progs/mptcp_sock.c b/tools/testing/selftests/bpf/progs/mptcp_sock.c
index 0d65fb889d03..19f5f8a183f5 100644
--- a/tools/testing/selftests/bpf/progs/mptcp_sock.c
+++ b/tools/testing/selftests/bpf/progs/mptcp_sock.c
@@ -1,11 +1,11 @@
// SPDX-License-Identifier: GPL-2.0
/* Copyright (c) 2020, Tessares SA. */
+/* Copyright (c) 2022, SUSE. */
#include <linux/bpf.h>
#include <bpf/bpf_helpers.h>
char _license[] SEC("license") = "GPL";
-__u32 _version SEC("version") = 1;
struct mptcp_storage {
__u32 invoked;
--
2.34.1
^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: [PATCH mptcp-next] Squash to "selftests: bpf: add MPTCP test base"
2022-03-31 8:14 Geliang Tang
@ 2022-03-31 13:26 ` Matthieu Baerts
0 siblings, 0 replies; 8+ messages in thread
From: Matthieu Baerts @ 2022-03-31 13:26 UTC (permalink / raw)
To: Geliang Tang, mptcp
Hi Geliang,
On 31/03/2022 10:14, Geliang Tang wrote:
> Update newly added files in MAINTAINERS.
>
> Signed-off-by: Geliang Tang <geliang.tang@suse.com>
> ---
> MAINTAINERS | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/MAINTAINERS b/MAINTAINERS
> index d91f6c6e3d3b..778cbf7c5a3b 100644
> --- a/MAINTAINERS
> +++ b/MAINTAINERS
> @@ -13745,6 +13745,8 @@ F: include/net/mptcp.h
> F: include/trace/events/mptcp.h
> F: include/uapi/linux/mptcp.h
> F: net/mptcp/
> +F: tools/testing/selftests/bpf/progs/mptcp_sock.c
> +F: tools/testing/selftests/bpf/prog_tests/mptcp.c
Thank you for the patch. I applied it a bit differently:
tools/testing/selftests/bpf/*/*mptcp*.c
See commit 4a7ea84d46b3 ("MAINTAINERS: add MPTCP-specific BPF files"),
being published soon.
Cheers,
Matt
--
Tessares | Belgium | Hybrid Access Solutions
www.tessares.net
^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH mptcp-next] Squash to "selftests: bpf: add MPTCP test base"
@ 2022-03-31 8:14 Geliang Tang
2022-03-31 13:26 ` Matthieu Baerts
0 siblings, 1 reply; 8+ messages in thread
From: Geliang Tang @ 2022-03-31 8:14 UTC (permalink / raw)
To: mptcp; +Cc: Geliang Tang
Update newly added files in MAINTAINERS.
Signed-off-by: Geliang Tang <geliang.tang@suse.com>
---
MAINTAINERS | 2 ++
1 file changed, 2 insertions(+)
diff --git a/MAINTAINERS b/MAINTAINERS
index d91f6c6e3d3b..778cbf7c5a3b 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -13745,6 +13745,8 @@ F: include/net/mptcp.h
F: include/trace/events/mptcp.h
F: include/uapi/linux/mptcp.h
F: net/mptcp/
+F: tools/testing/selftests/bpf/progs/mptcp_sock.c
+F: tools/testing/selftests/bpf/prog_tests/mptcp.c
F: tools/testing/selftests/net/mptcp/
NETWORKING [TCP]
--
2.34.1
^ permalink raw reply related [flat|nested] 8+ messages in thread
end of thread, other threads:[~2022-05-09 11:53 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-27 1:28 [PATCH mptcp-next] Squash to "selftests: bpf: add MPTCP test base" Geliang Tang
2022-04-27 2:58 ` Squash to "selftests: bpf: add MPTCP test base": Tests Results MPTCP CI
2022-04-27 10:09 ` [PATCH mptcp-next] Squash to "selftests: bpf: add MPTCP test base" Matthieu Baerts
2022-04-27 17:33 ` Mat Martineau
-- strict thread matches above, loose matches on Subject: below --
2022-05-07 6:17 Geliang Tang
2022-05-09 11:53 ` Matthieu Baerts
2022-03-31 8:14 Geliang Tang
2022-03-31 13:26 ` Matthieu Baerts
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.