netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Mat Martineau <mathew.j.martineau@linux.intel.com>
To: netdev@vger.kernel.org
Cc: Menglong Dong <imagedong@tencent.com>,
	davem@davemloft.net, kuba@kernel.org, pabeni@redhat.com,
	edumazet@google.com, matthieu.baerts@tessares.net,
	mptcp@lists.linux.dev,
	Mat Martineau <mathew.j.martineau@linux.intel.com>
Subject: [PATCH net-next 8/9] selftest: mptcp: exit from copyfd_io_poll() when receive SIGUSR1
Date: Fri,  6 Jan 2023 10:57:24 -0800	[thread overview]
Message-ID: <20230106185725.299977-9-mathew.j.martineau@linux.intel.com> (raw)
In-Reply-To: <20230106185725.299977-1-mathew.j.martineau@linux.intel.com>

From: Menglong Dong <imagedong@tencent.com>

For now, mptcp_connect won't exit after receiving the 'SIGUSR1' signal
if '-r' is set. Fix this by skipping poll and sleep in copyfd_io_poll()
if 'quit' is set.

Acked-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: Menglong Dong <imagedong@tencent.com>
Signed-off-by: Mat Martineau <mathew.j.martineau@linux.intel.com>
---
 tools/testing/selftests/net/mptcp/mptcp_connect.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/tools/testing/selftests/net/mptcp/mptcp_connect.c b/tools/testing/selftests/net/mptcp/mptcp_connect.c
index 8a8266957bc5..b25a31445ded 100644
--- a/tools/testing/selftests/net/mptcp/mptcp_connect.c
+++ b/tools/testing/selftests/net/mptcp/mptcp_connect.c
@@ -627,7 +627,7 @@ static int copyfd_io_poll(int infd, int peerfd, int outfd,
 		char rbuf[8192];
 		ssize_t len;
 
-		if (fds.events == 0)
+		if (fds.events == 0 || quit)
 			break;
 
 		switch (poll(&fds, 1, poll_timeout)) {
@@ -733,7 +733,7 @@ static int copyfd_io_poll(int infd, int peerfd, int outfd,
 	}
 
 	/* leave some time for late join/announce */
-	if (cfg_remove)
+	if (cfg_remove && !quit)
 		usleep(cfg_wait);
 
 	return 0;
-- 
2.39.0


  parent reply	other threads:[~2023-01-06 18:58 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-06 18:57 [PATCH net-next 0/9] mptcp: Protocol in-use tracking and code cleanup Mat Martineau
2023-01-06 18:57 ` [PATCH net-next 1/9] mptcp: use msk_owned_by_me helper Mat Martineau
2023-01-06 18:57 ` [PATCH net-next 2/9] mptcp: use net instead of sock_net Mat Martineau
2023-01-06 18:57 ` [PATCH net-next 3/9] mptcp: use local variable ssk in write_options Mat Martineau
2023-01-06 18:57 ` [PATCH net-next 4/9] mptcp: introduce 'sk' to replace 'sock->sk' in mptcp_listen() Mat Martineau
2023-01-06 18:57 ` [PATCH net-next 5/9] mptcp: init sk->sk_prot in build_msk() Mat Martineau
2023-01-06 18:57 ` [PATCH net-next 6/9] mptcp: rename 'sk' to 'ssk' in mptcp_token_new_connect() Mat Martineau
2023-01-06 18:57 ` [PATCH net-next 7/9] mptcp: add statistics for mptcp socket in use Mat Martineau
2023-01-06 18:57 ` Mat Martineau [this message]
2023-01-06 18:57 ` [PATCH net-next 9/9] selftest: mptcp: add test " Mat Martineau
2023-01-09  7:50 ` [PATCH net-next 0/9] mptcp: Protocol in-use tracking and code cleanup patchwork-bot+netdevbpf

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230106185725.299977-9-mathew.j.martineau@linux.intel.com \
    --to=mathew.j.martineau@linux.intel.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=imagedong@tencent.com \
    --cc=kuba@kernel.org \
    --cc=matthieu.baerts@tessares.net \
    --cc=mptcp@lists.linux.dev \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).