All of lore.kernel.org
 help / color / mirror / Atom feed
* [LTP] [PATCH] network/mpls: sleep 1 after setup in mpls02
@ 2021-08-26  5:26 suy.fnst
  2021-08-26  9:36 ` Alexey Kodanev
  0 siblings, 1 reply; 12+ messages in thread
From: suy.fnst @ 2021-08-26  5:26 UTC (permalink / raw)
  To: ltp

While running mpls02.sh -6 in our slow test box with kernel
version > v5.11, we found the test hangs at ping6 occasionally:

  + grep -q 'invalid option'
  + for size in ${msg_sizes:-"56"}
  + EXPECT_PASS ping6 -I fd00:23::2 -c 500 -s 10 -f fd00:23::1
  '>/dev/null'
  + _tst_expect_pass tst_res ping6 -I fd00:23::2 -c 500 -s 10 -f
  fd00:23::1 '>/dev/null'
  + local fnc=tst_res
  + shift
  + tst_rod ping6 -I fd00:23::2 -c 500 -s 10 -f fd00:23::1 '>/dev/null'

The weird part is that manual ping6 works in the meantime.

Then we found that adding `sleep 1` at end of mpls02.sh/setup() make
the test pass in 100%. Dig depper in the problem, ftrace catched during
the 1 second shows (The test started at [ 3979.485488]):

 3981.210701 |   2) kworker-24742  |               |  addrconf_dad_work() {
 3981.210712 |   2) kworker-24742  |               |    addrconf_dad_completed() {
 3981.210712 |   2) kworker-24742  |   0.417 us    |      addrconf_del_dad_work();
 3981.210713 |   2) kworker-24742  |               |      __ipv6_ifa_notify() {
 3981.210716 |   2) kworker-24742  |   1.097 us    |        inet6_fill_ifaddr();
 3981.210730 |   2) kworker-24742  |               |        ip6_ins_rt() {
 3981.210731 |   2) kworker-24742  |               |          fib6_add() {

In kernel, addrconf_dad_work() is delegated by inet6_addr_add() to do
route related jobs in a delayed workqueue . Hence, there is tiny period
we need to wait for it. Adding the `sleep 1` seems suffcient for now.

Signed-off-by: Su Yue <suy.fnst@fujitsu.com>
---
 testcases/network/mpls/mpls02.sh | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/testcases/network/mpls/mpls02.sh b/testcases/network/mpls/mpls02.sh
index 2fd3ec5bf4ba..75f5fca32f9a 100755
--- a/testcases/network/mpls/mpls02.sh
+++ b/testcases/network/mpls/mpls02.sh
@@ -35,6 +35,8 @@ setup()
 	tst_rhost_run -s -c "ip addr add $ip_rmt/$mask dev lo"
 	tst_rhost_run -s -c "ip route add $ip_loc/$mask encap mpls 60 via inet$TST_IPV6 $(tst_ipaddr)"
 	tst_rhost_run -s -c "ip -f mpls route add 50 dev lo"
+
+	sleep 1
 }
 
 do_test()
-- 
2.30.1 (Apple Git-130)


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

end of thread, other threads:[~2021-09-13 12:56 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-26  5:26 [LTP] [PATCH] network/mpls: sleep 1 after setup in mpls02 suy.fnst
2021-08-26  9:36 ` Alexey Kodanev
2021-08-30  6:46   ` suy.fnst
2021-08-30  9:26   ` suy.fnst
2021-09-09 15:53     ` pvorel
2021-09-09 15:53       ` pvorel
2021-09-10  8:39         ` Alexey Kodanev
2021-09-10  8:39           ` Alexey Kodanev
2021-09-10  9:36             ` Petr Vorel
2021-09-10  9:36               ` Petr Vorel
2021-09-13 11:14                 ` Alexey Kodanev
2021-09-13 11:14                   ` Alexey Kodanev
2021-09-13 12:28                     ` Petr Vorel
2021-09-13 12:28                       ` Petr Vorel
2021-09-13 12:38                         ` Alexey Kodanev
2021-09-13 12:38                           ` Alexey Kodanev
2021-09-13 12:55                             ` Petr Vorel
2021-09-13 12:55                               ` Petr Vorel
2021-09-12  3:45             ` suy.fnst
2021-09-12  3:45               ` suy.fnst

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.