From mboxrd@z Thu Jan 1 00:00:00 1970 From: Richard Davies Subject: Re: Slow inbound traffic on macvtap interfaces Date: Thu, 30 Aug 2012 09:20:57 +0100 Message-ID: <20120830082057.GA18072@alpha.arachsys.com> References: <20120816092004.GA1894@arachsys.com> <20120829175256.GC3529@arachsys.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: netdev@vger.kernel.org, qemu-devel@nongnu.org, Jason Wang , Arnd Bergmann , Michael Tsirkin To: Chris Webb Return-path: Received: from alpha.arachsys.com ([91.203.57.7]:46562 "EHLO alpha.arachsys.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752266Ab2H3ItU (ORCPT ); Thu, 30 Aug 2012 04:49:20 -0400 Content-Disposition: inline In-Reply-To: <20120829175256.GC3529@arachsys.com> Sender: netdev-owner@vger.kernel.org List-ID: Chris Webb wrote: > I found that on my laptop, the single change of host kernel config > > -CONFIG_INTEL_IDLE=y > +# CONFIG_INTEL_IDLE is not set > > is sufficient to turn transfers into guests from slow to full wire speed I am not deep enough in this code to write a patch, but I wonder if macvtap_forward in macvtap.c is missing a call to kill_fasync, which I understand is used to signal to interested processes when data arrives? Here is the end of macvtap_forward: skb_queue_tail(&q->sk.sk_receive_queue, skb); wake_up_interruptible_poll(sk_sleep(&q->sk), POLLIN | POLLRDNORM | POLLRDBAND); return NET_RX_SUCCESS; Compared to this end of tun_net_xmit in tun.c: /* Enqueue packet */ skb_queue_tail(&tun->socket.sk->sk_receive_queue, skb); /* Notify and wake up reader process */ if (tun->flags & TUN_FASYNC) kill_fasync(&tun->fasync, SIGIO, POLL_IN); wake_up_interruptible_poll(&tun->wq.wait, POLLIN | POLLRDNORM | POLLRDBAND); return NETDEV_TX_OK; Richard. From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:55112) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T7002-0003YM-Vi for qemu-devel@nongnu.org; Thu, 30 Aug 2012 04:21:20 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1T7001-00053X-U6 for qemu-devel@nongnu.org; Thu, 30 Aug 2012 04:21:14 -0400 Received: from alpha.arachsys.com ([91.203.57.7]:55318) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T7001-00053G-OE for qemu-devel@nongnu.org; Thu, 30 Aug 2012 04:21:13 -0400 Date: Thu, 30 Aug 2012 09:20:57 +0100 From: Richard Davies Message-ID: <20120830082057.GA18072@alpha.arachsys.com> References: <20120816092004.GA1894@arachsys.com> <20120829175256.GC3529@arachsys.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20120829175256.GC3529@arachsys.com> Subject: Re: [Qemu-devel] Slow inbound traffic on macvtap interfaces List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Chris Webb Cc: netdev@vger.kernel.org, Jason Wang , qemu-devel@nongnu.org, Arnd Bergmann , Michael Tsirkin Chris Webb wrote: > I found that on my laptop, the single change of host kernel config > > -CONFIG_INTEL_IDLE=y > +# CONFIG_INTEL_IDLE is not set > > is sufficient to turn transfers into guests from slow to full wire speed I am not deep enough in this code to write a patch, but I wonder if macvtap_forward in macvtap.c is missing a call to kill_fasync, which I understand is used to signal to interested processes when data arrives? Here is the end of macvtap_forward: skb_queue_tail(&q->sk.sk_receive_queue, skb); wake_up_interruptible_poll(sk_sleep(&q->sk), POLLIN | POLLRDNORM | POLLRDBAND); return NET_RX_SUCCESS; Compared to this end of tun_net_xmit in tun.c: /* Enqueue packet */ skb_queue_tail(&tun->socket.sk->sk_receive_queue, skb); /* Notify and wake up reader process */ if (tun->flags & TUN_FASYNC) kill_fasync(&tun->fasync, SIGIO, POLL_IN); wake_up_interruptible_poll(&tun->wq.wait, POLLIN | POLLRDNORM | POLLRDBAND); return NETDEV_TX_OK; Richard.