Linux-kselftest Archive on lore.kernel.org
 help / color / Atom feed
WARNING: multiple messages have this Message-ID
From: bhole_prashant_q7 at lab.ntt.co.jp (Prashant Bhole)
Subject: [PATCH bpf-next v4 3/5] selftests/bpf: test_sockmap, timing improvements
Date: Thu, 31 May 2018 13:42:38 +0900
Message-ID: <20180531044240.796-4-bhole_prashant_q7@lab.ntt.co.jp> (raw)
In-Reply-To: <20180531044240.796-1-bhole_prashant_q7@lab.ntt.co.jp>

Currently 10us delay is too low for many tests to succeed. It needs to
be increased. Also, many corked tests are expected to hit rx timeout
irrespective of timeout value.

- This patch sets 1000usec timeout value for corked tests because less
than that causes broken-pipe error in tx thread. Also sets 1 second
timeout for all other tests because less than that results in RX
timeout
- tests with apply=1 and higher number of iterations were taking lot
of time. This patch reduces test run time by reducing iterations.

real    0m12.968s
user    0m0.219s
sys     0m14.337s

Fixes: a18fda1a62c3 ("bpf: reduce runtime of test_sockmap tests")
Signed-off-by: Prashant Bhole <bhole_prashant_q7 at lab.ntt.co.jp>
---
 tools/testing/selftests/bpf/test_sockmap.c | 13 +++++++++----
 1 file changed, 9 insertions(+), 4 deletions(-)

diff --git a/tools/testing/selftests/bpf/test_sockmap.c b/tools/testing/selftests/bpf/test_sockmap.c
index 7f9ca79aadbc..5cd0550af595 100644
--- a/tools/testing/selftests/bpf/test_sockmap.c
+++ b/tools/testing/selftests/bpf/test_sockmap.c
@@ -345,8 +345,13 @@ static int msg_loop(int fd, int iov_count, int iov_length, int cnt,
 		if (err < 0)
 			perror("recv start time: ");
 		while (s->bytes_recvd < total_bytes) {
-			timeout.tv_sec = 0;
-			timeout.tv_usec = 10;
+			if (txmsg_cork) {
+				timeout.tv_sec = 0;
+				timeout.tv_usec = 1000;
+			} else {
+				timeout.tv_sec = 1;
+				timeout.tv_usec = 0;
+			}
 
 			/* FD sets */
 			FD_ZERO(&w);
@@ -1025,14 +1030,14 @@ static int test_send(struct sockmap_options *opt, int cgrp)
 
 	opt->iov_length = 1;
 	opt->iov_count = 1;
-	opt->rate = 1024;
+	opt->rate = 512;
 	err = test_exec(cgrp, opt);
 	if (err)
 		goto out;
 
 	opt->iov_length = 256;
 	opt->iov_count = 1024;
-	opt->rate = 10;
+	opt->rate = 2;
 	err = test_exec(cgrp, opt);
 	if (err)
 		goto out;
-- 
2.17.0


--
To unsubscribe from this list: send the line "unsubscribe linux-kselftest" in
the body of a message to majordomo at vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

From: bhole_prashant_q7@lab.ntt.co.jp (Prashant Bhole)
Subject: [PATCH bpf-next v4 3/5] selftests/bpf: test_sockmap, timing improvements
Date: Thu, 31 May 2018 13:42:38 +0900
Message-ID: <20180531044240.796-4-bhole_prashant_q7@lab.ntt.co.jp> (raw)
Message-ID: <20180531044238.f8zZcL-OGtOUtjyyFhNc8uDehumJ5jxI2isBsC35Vjw@z> (raw)
In-Reply-To: <20180531044240.796-1-bhole_prashant_q7@lab.ntt.co.jp>

Currently 10us delay is too low for many tests to succeed. It needs to
be increased. Also, many corked tests are expected to hit rx timeout
irrespective of timeout value.

- This patch sets 1000usec timeout value for corked tests because less
than that causes broken-pipe error in tx thread. Also sets 1 second
timeout for all other tests because less than that results in RX
timeout
- tests with apply=1 and higher number of iterations were taking lot
of time. This patch reduces test run time by reducing iterations.

real    0m12.968s
user    0m0.219s
sys     0m14.337s

Fixes: a18fda1a62c3 ("bpf: reduce runtime of test_sockmap tests")
Signed-off-by: Prashant Bhole <bhole_prashant_q7 at lab.ntt.co.jp>
---
 tools/testing/selftests/bpf/test_sockmap.c | 13 +++++++++----
 1 file changed, 9 insertions(+), 4 deletions(-)

diff --git a/tools/testing/selftests/bpf/test_sockmap.c b/tools/testing/selftests/bpf/test_sockmap.c
index 7f9ca79aadbc..5cd0550af595 100644
--- a/tools/testing/selftests/bpf/test_sockmap.c
+++ b/tools/testing/selftests/bpf/test_sockmap.c
@@ -345,8 +345,13 @@ static int msg_loop(int fd, int iov_count, int iov_length, int cnt,
 		if (err < 0)
 			perror("recv start time: ");
 		while (s->bytes_recvd < total_bytes) {
-			timeout.tv_sec = 0;
-			timeout.tv_usec = 10;
+			if (txmsg_cork) {
+				timeout.tv_sec = 0;
+				timeout.tv_usec = 1000;
+			} else {
+				timeout.tv_sec = 1;
+				timeout.tv_usec = 0;
+			}
 
 			/* FD sets */
 			FD_ZERO(&w);
@@ -1025,14 +1030,14 @@ static int test_send(struct sockmap_options *opt, int cgrp)
 
 	opt->iov_length = 1;
 	opt->iov_count = 1;
-	opt->rate = 1024;
+	opt->rate = 512;
 	err = test_exec(cgrp, opt);
 	if (err)
 		goto out;
 
 	opt->iov_length = 256;
 	opt->iov_count = 1024;
-	opt->rate = 10;
+	opt->rate = 2;
 	err = test_exec(cgrp, opt);
 	if (err)
 		goto out;
-- 
2.17.0


--
To unsubscribe from this list: send the line "unsubscribe linux-kselftest" in
the body of a message to majordomo at vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

  parent reply index

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-31  4:42 [PATCH bpf-next v4 0/5] fix test_sockmap bhole_prashant_q7
2018-05-31  4:42 ` Prashant Bhole
2018-05-31  4:42 ` [PATCH bpf-next v4 1/5] selftests/bpf: test_sockmap, check test failure bhole_prashant_q7
2018-05-31  4:42   ` Prashant Bhole
2018-06-01 14:04   ` john.fastabend
2018-06-01 14:04     ` John Fastabend
2018-05-31  4:42 ` [PATCH bpf-next v4 2/5] selftests/bpf: test_sockmap, join cgroup in selftest mode bhole_prashant_q7
2018-05-31  4:42   ` Prashant Bhole
2018-05-31  4:42 ` bhole_prashant_q7 [this message]
2018-05-31  4:42   ` [PATCH bpf-next v4 3/5] selftests/bpf: test_sockmap, timing improvements Prashant Bhole
2018-06-01 14:11   ` john.fastabend
2018-06-01 14:11     ` John Fastabend
2018-05-31  4:42 ` [PATCH bpf-next v4 4/5] selftests/bpf: test_sockmap, fix data verification bhole_prashant_q7
2018-05-31  4:42   ` Prashant Bhole
2018-05-31  4:42 ` [PATCH bpf-next v4 5/5] selftests/bpf: test_sockmap, print additional test options bhole_prashant_q7
2018-05-31  4:42   ` Prashant Bhole
2018-06-02  4:16 ` [PATCH bpf-next v4 0/5] fix test_sockmap daniel
2018-06-02  4:16   ` Daniel Borkmann

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=20180531044240.796-4-bhole_prashant_q7@lab.ntt.co.jp \
    --to= \
    /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

Linux-kselftest Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-kselftest/0 linux-kselftest/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-kselftest linux-kselftest/ https://lore.kernel.org/linux-kselftest \
		linux-kselftest@vger.kernel.org
	public-inbox-index linux-kselftest

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-kselftest


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git