* [PATCH mptcp-next v2 0/2] cleanups for main_loop
@ 2025-03-19 3:39 Geliang Tang
2025-03-19 3:39 ` [PATCH mptcp-next v2 1/2] selftests: mptcp: open cfg_input once in main_loop Geliang Tang
` (2 more replies)
0 siblings, 3 replies; 5+ messages in thread
From: Geliang Tang @ 2025-03-19 3:39 UTC (permalink / raw)
To: mptcp; +Cc: Geliang Tang
From: Geliang Tang <tanggeliang@kylinos.cn>
v2:
- update the pending patches from Cong Liu, he said to me that he has
no time to deal with this recently.
- delete the second "open(cfg_input)" instead of the first one as Matt
suggested.
- drop freeaddrinfo, no need to do this.
Based-on: <59caf78b9d67a0a61a19a46f7820456f6ced3d6e.1742296236.git.tanggeliang@kylinos.cn>
v1:
- https://patchwork.kernel.org/project/mptcp/cover/20250113085228.121778-1-liucong2@kylinos.cn/
Geliang Tang (2):
selftests: mptcp: open cfg_input once in main_loop
selftests: mptcp: close fds when copyfd_io fails
.../testing/selftests/net/mptcp/mptcp_connect.c | 17 ++++++-----------
1 file changed, 6 insertions(+), 11 deletions(-)
--
2.43.0
^ permalink raw reply [flat|nested] 5+ messages in thread* [PATCH mptcp-next v2 1/2] selftests: mptcp: open cfg_input once in main_loop 2025-03-19 3:39 [PATCH mptcp-next v2 0/2] cleanups for main_loop Geliang Tang @ 2025-03-19 3:39 ` Geliang Tang 2025-03-19 3:39 ` [PATCH mptcp-next v2 2/2] selftests: mptcp: close fds when copyfd_io fails Geliang Tang 2025-03-19 4:47 ` [PATCH mptcp-next v2 0/2] cleanups for main_loop MPTCP CI 2 siblings, 0 replies; 5+ messages in thread From: Geliang Tang @ 2025-03-19 3:39 UTC (permalink / raw) To: mptcp; +Cc: Geliang Tang, Cong Liu From: Geliang Tang <tanggeliang@kylinos.cn> cfg_input is opened twice regardless of whether cfg_sockopt_types.mptfo is configured. This can be simplified to open it once at the beginning of main_loop() and close it at the end, because no need to repeatedly open and close cfg_input during cfg_repeat. Co-developed-by: Cong Liu <liucong2@kylinos.cn> Signed-off-by: Cong Liu <liucong2@kylinos.cn> Signed-off-by: Geliang Tang <tanggeliang@kylinos.cn> --- tools/testing/selftests/net/mptcp/mptcp_connect.c | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/tools/testing/selftests/net/mptcp/mptcp_connect.c b/tools/testing/selftests/net/mptcp/mptcp_connect.c index 893dc36b12f6..5301062a5f3b 100644 --- a/tools/testing/selftests/net/mptcp/mptcp_connect.c +++ b/tools/testing/selftests/net/mptcp/mptcp_connect.c @@ -1268,7 +1268,7 @@ int main_loop(void) struct addrinfo *peer; struct wstate winfo; - if (cfg_input && cfg_sockopt_types.mptfo) { + if (cfg_input) { fd_in = open(cfg_input, O_RDONLY); if (fd_in < 0) xerror("can't open %s:%d", cfg_input, errno); @@ -1291,12 +1291,6 @@ int main_loop(void) if (cfg_cmsg_types.cmsg_enabled) apply_cmsg_types(fd, &cfg_cmsg_types); - if (cfg_input && !cfg_sockopt_types.mptfo) { - fd_in = open(cfg_input, O_RDONLY); - if (fd_in < 0) - xerror("can't open %s:%d", cfg_input, errno); - } - ret = copyfd_io(fd_in, fd, 1, 0, &winfo); if (ret) return ret; @@ -1312,14 +1306,14 @@ int main_loop(void) set_nonblock(fd, false); if (connect(fd, peer->ai_addr, peer->ai_addrlen)) xerror("can't reconnect: %d", errno); - if (cfg_input) - close(fd_in); memset(&winfo, 0, sizeof(winfo)); goto again; } else { close(fd); } + if (cfg_input) + close(fd_in); return 0; } -- 2.43.0 ^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH mptcp-next v2 2/2] selftests: mptcp: close fds when copyfd_io fails 2025-03-19 3:39 [PATCH mptcp-next v2 0/2] cleanups for main_loop Geliang Tang 2025-03-19 3:39 ` [PATCH mptcp-next v2 1/2] selftests: mptcp: open cfg_input once in main_loop Geliang Tang @ 2025-03-19 3:39 ` Geliang Tang 2025-03-19 4:47 ` [PATCH mptcp-next v2 0/2] cleanups for main_loop MPTCP CI 2 siblings, 0 replies; 5+ messages in thread From: Geliang Tang @ 2025-03-19 3:39 UTC (permalink / raw) To: mptcp; +Cc: Geliang Tang, Cong Liu From: Geliang Tang <tanggeliang@kylinos.cn> When copyfd_io fails, it should not simply return an error, but should close all open file descriptors before that. Here an "out" tag is added to do this. Fixes: 05be5e273c84 ("selftests: mptcp: add disconnect tests") Co-developed-by: Cong Liu <liucong2@kylinos.cn> Signed-off-by: Cong Liu <liucong2@kylinos.cn> Signed-off-by: Geliang Tang <tanggeliang@kylinos.cn> --- tools/testing/selftests/net/mptcp/mptcp_connect.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tools/testing/selftests/net/mptcp/mptcp_connect.c b/tools/testing/selftests/net/mptcp/mptcp_connect.c index 5301062a5f3b..f190f95a3338 100644 --- a/tools/testing/selftests/net/mptcp/mptcp_connect.c +++ b/tools/testing/selftests/net/mptcp/mptcp_connect.c @@ -1293,7 +1293,7 @@ int main_loop(void) ret = copyfd_io(fd_in, fd, 1, 0, &winfo); if (ret) - return ret; + goto out; if (cfg_truncate > 0) { shutdown(fd, SHUT_WR); @@ -1309,12 +1309,13 @@ int main_loop(void) memset(&winfo, 0, sizeof(winfo)); goto again; } else { +out: close(fd); } if (cfg_input) close(fd_in); - return 0; + return ret; } int parse_proto(const char *proto) -- 2.43.0 ^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH mptcp-next v2 0/2] cleanups for main_loop 2025-03-19 3:39 [PATCH mptcp-next v2 0/2] cleanups for main_loop Geliang Tang 2025-03-19 3:39 ` [PATCH mptcp-next v2 1/2] selftests: mptcp: open cfg_input once in main_loop Geliang Tang 2025-03-19 3:39 ` [PATCH mptcp-next v2 2/2] selftests: mptcp: close fds when copyfd_io fails Geliang Tang @ 2025-03-19 4:47 ` MPTCP CI 2025-03-19 5:44 ` Geliang Tang 2 siblings, 1 reply; 5+ messages in thread From: MPTCP CI @ 2025-03-19 4:47 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: Unstable: 1 failed test(s): selftest_mptcp_connect 🔴 - KVM Validation: debug: Unstable: 1 failed test(s): selftest_mptcp_connect 🔴 - KVM Validation: btf-normal (only bpftest_all): Success! ✅ - KVM Validation: btf-debug (only bpftest_all): Success! ✅ - Task: https://github.com/multipath-tcp/mptcp_net-next/actions/runs/13938550896 Initiator: Patchew Applier Commits: https://github.com/multipath-tcp/mptcp_net-next/commits/ee7ab4397474 Patchwork: https://patchwork.kernel.org/project/mptcp/list/?series=945419 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-normal 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 (NGI0 Core) ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH mptcp-next v2 0/2] cleanups for main_loop 2025-03-19 4:47 ` [PATCH mptcp-next v2 0/2] cleanups for main_loop MPTCP CI @ 2025-03-19 5:44 ` Geliang Tang 0 siblings, 0 replies; 5+ messages in thread From: Geliang Tang @ 2025-03-19 5:44 UTC (permalink / raw) To: mptcp, Geliang Tang On Wed, 2025-03-19 at 04:47 +0000, MPTCP CI wrote: > Hi Geliang, > > Thank you for your modifications, that's great! > > Our CI did some validations and here is its report: > > - KVM Validation: normal: Unstable: 1 failed test(s): > selftest_mptcp_connect 🔴 > - KVM Validation: debug: Unstable: 1 failed test(s): > selftest_mptcp_connect 🔴 Oops, I fixed this in v3. Thanks, -Geliang > - KVM Validation: btf-normal (only bpftest_all): Success! ✅ > - KVM Validation: btf-debug (only bpftest_all): Success! ✅ > - Task: > https://github.com/multipath-tcp/mptcp_net-next/actions/runs/13938550896 > > Initiator: Patchew Applier > Commits: > https://github.com/multipath-tcp/mptcp_net-next/commits/ee7ab4397474 > Patchwork: > https://patchwork.kernel.org/project/mptcp/list/?series=945419 > > > 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-normal > > 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 (NGI0 Core) > ^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2025-03-19 5:44 UTC | newest] Thread overview: 5+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2025-03-19 3:39 [PATCH mptcp-next v2 0/2] cleanups for main_loop Geliang Tang 2025-03-19 3:39 ` [PATCH mptcp-next v2 1/2] selftests: mptcp: open cfg_input once in main_loop Geliang Tang 2025-03-19 3:39 ` [PATCH mptcp-next v2 2/2] selftests: mptcp: close fds when copyfd_io fails Geliang Tang 2025-03-19 4:47 ` [PATCH mptcp-next v2 0/2] cleanups for main_loop MPTCP CI 2025-03-19 5:44 ` Geliang Tang
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.