From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:53193) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fH2La-000381-FC for qemu-devel@nongnu.org; Fri, 11 May 2018 03:20:13 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fH2LY-00015y-2U for qemu-devel@nongnu.org; Fri, 11 May 2018 03:20:10 -0400 Received: from mail-qt0-x243.google.com ([2607:f8b0:400d:c0d::243]:46099) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fH2LX-00015k-Si for qemu-devel@nongnu.org; Fri, 11 May 2018 03:20:08 -0400 Received: by mail-qt0-x243.google.com with SMTP id m16-v6so5865431qtg.13 for ; Fri, 11 May 2018 00:20:07 -0700 (PDT) MIME-Version: 1.0 From: Zhu Yijun Date: Fri, 11 May 2018 15:20:05 +0800 Message-ID: Content-Type: text/plain; charset="UTF-8" Subject: [Qemu-devel] ping latency issue on passthrough guest List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: kvm@vger.kernel.org, Alex Williamson , Paolo Bonzini , qemu-devel@nongnu.org Hi all, I booted two sr-iov guests using KVM-VFIO and pinged each other with no-load one night. I found that most of the latency was little than 0.1ms, but several icmp_seq greater than 10ms, even up to 1000ms; root@test-ping01:~# grep "time=[0-9][0-9]" outputfile Mon May 7 23:05:12 201864 bytes from 192.168.0.200: icmp_seq=16703 ttl=64 time=123 ms Mon May 7 23:26:28 201864 bytes from 192.168.0.200: icmp_seq=17979 ttl=64 time=123 ms Mon May 7 23:45:08 201864 bytes from 192.168.0.200: icmp_seq=19099 ttl=64 time=127 ms Tue May 8 00:19:21 201864 bytes from 192.168.0.200: icmp_seq=21152 ttl=64 time=132 ms Tue May 8 00:20:16 201864 bytes from 192.168.0.200: icmp_seq=21207 ttl=64 time=131 ms Tue May 8 00:20:58 201864 bytes from 192.168.0.200: icmp_seq=21249 ttl=64 time=131 ms Tue May 8 00:24:36 201864 bytes from 192.168.0.200: icmp_seq=21467 ttl=64 time=131 ms Tue May 8 03:17:53 201864 bytes from 192.168.0.200: icmp_seq=31864 ttl=64 time=102 ms Tue May 8 04:51:35 201864 bytes from 192.168.0.200: icmp_seq=37486 ttl=64 time=134 ms Tue May 8 04:51:39 201864 bytes from 192.168.0.200: icmp_seq=37490 ttl=64 time=134 ms Tue May 8 04:55:31 201864 bytes from 192.168.0.200: icmp_seq=37722 ttl=64 time=138 ms Tue May 8 04:59:23 201864 bytes from 192.168.0.200: icmp_seq=37954 ttl=64 time=138 ms Tue May 8 05:15:05 201864 bytes from 192.168.0.200: icmp_seq=38896 ttl=64 time=76.4 ms Tue May 8 05:19:05 201864 bytes from 192.168.0.200: icmp_seq=39136 ttl=64 time=146 ms Tue May 8 07:07:40 201864 bytes from 192.168.0.200: icmp_seq=45651 ttl=64 time=10.7 ms Tue May 8 07:12:42 201864 bytes from 192.168.0.200: icmp_seq=45953 ttl=64 time=30.7 ms Tue May 8 07:17:40 201864 bytes from 192.168.0.200: icmp_seq=46251 ttl=64 time=166 ms Tue May 8 08:03:33 201864 bytes from 192.168.0.200: icmp_seq=49004 ttl=64 time=14.6 ms Tue May 8 08:13:34 201864 bytes from 192.168.0.200: icmp_seq=49605 ttl=64 time=174 ms Tue May 8 08:13:36 201864 bytes from 192.168.0.200: icmp_seq=49607 ttl=64 time=174 ms Tue May 8 08:42:38 201864 bytes from 192.168.0.200: icmp_seq=51349 ttl=64 time=84.0 ms Tue May 8 08:51:50 201864 bytes from 192.168.0.200: icmp_seq=51901 ttl=64 time=92.0 ms Tue May 8 09:34:06 201864 bytes from 192.168.0.200: icmp_seq=54437 ttl=64 time=283 ms VF used by these two guest from same port(eth0) of intel X710 Ethernet controller. By contrast, I selected another two VFs and set them to separate network namespace, this issue did not exits, all the latency litter than 0.2ms. Advised by other guys, I disabled the BIOS C-State, set cpu power to "performance", add kernel parameter "idle=poll, pcie_aspm=off", but it makes no sense. I think it may be not the hardware issue, but may relate to KVM hypervisor or guest kernel. As a result, I reported here, any advice and suggestions will be greatly appreciated. The test enviroment as below: CPU model: Intel(R) Xeon(R) CPU E5-2680 v4 @ 2.40GHz HostOS: debian_9.3, kernel_version: 4.9.0-3 QEMU 2.8.1 libvirt 2.4.0 NIC: intel X710 GuestOS: debian_9.1 xml: ping_test01 98132486-7f49-45bf-a6d7-6ceaf71ff4be 134217728 4194304 4194304 /dev/sdb 1000 1000 104857600 104857600 64 /machine OpenStack Foundation OpenStack Nova 2013.2.2 hvm Broadwell Intel destroy restart destroy /usr/bin/kvm