From: Shaun Crampton <Shaun.Crampton@metaswitch.com>
To: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: veths often slow to come up
Date: Tue, 4 Aug 2015 13:42:24 +0000 [thread overview]
Message-ID: <D1E67FCC.3FA19%Shaun.Crampton@metaswitch.com> (raw)
Please CC me on any responses, thanks.
Setting both ends of a veth to be oper UP completes very quickly but I
find that pings only start flowing over the veth after about a second.
This seems to correlate with the NO-CARRIER flag being set or the
interface being in "state UNKNOWN" or "state DOWN² for about a second
(demo script below).
If I run the script repeatedly then sometimes it completes very quickly on
subsequent runs as if there¹s a hot cache somewhere.
Could this be a bug or is there a configuration to speed this up? Seems
odd that it¹s almost exactly 1s on the first run.
Seen on these kernels:
* 3.13.0-57-generic #95-Ubuntu SMP Fri Jun 19 09:28:15 UTC 2015 x86_64
x86_64 x86_64 GNU/Linux
* 4.0.9-coreos #2 SMP Thu Jul 30 01:07:55 UTC 2015 x86_64 Intel(R) Xeon(R)
CPU @ 2.50GHz GenuineIntel GNU/Linux
Regards,
-Shaun
Running my test script below (Assumes veth0/1 do not already exist):
$ sudo ./veth-test.sh
Time to create veth:
real 0m0.019s
user 0m0.002s
sys 0m0.010s
Time to wait for carrier:
real 0m1.005s
user 0m0.007s
sys 0m0.123s
# veth-test.sh
#!/bin/bash
function create_veth {
ip link add type veth
ip link set veth0 up
ip link set veth1 up
}
function wait_for_carrier {
while ! ip link show | grep -qE 'veth[01]';
do
sleep 0.05
done
while ip link show | grep -E 'veth[01]¹ | \
grep -Eq 'NO-CARRIER|state DOWN|state UNKNOWN';
do
sleep 0.05
done
}
echo "Time to create veth:"
time create_veth
echo
echo "Time to wait for carrier:"
time wait_for_carrier
ip link del veth0
next reply other threads:[~2015-08-04 13:47 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-08-04 13:42 Shaun Crampton [this message]
2015-08-05 3:26 ` Cong Wang
2015-08-05 15:23 ` Thadeu Lima de Souza Cascardo
2015-08-06 8:09 ` Shaun Crampton
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=D1E67FCC.3FA19%Shaun.Crampton@metaswitch.com \
--to=shaun.crampton@metaswitch.com \
--cc=linux-kernel@vger.kernel.org \
/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
all inboxes | Powered by JetHome®