From mboxrd@z Thu Jan 1 00:00:00 1970 From: Mark McLoughlin Subject: Re: [PATCH 3/9] kvm: qemu: Remove virtio_net tx ring-full heuristic Date: Fri, 25 Jul 2008 18:23:04 +0100 Message-ID: <1217006584.7098.93.camel@muff> References: <1216899979-32532-1-git-send-email-markmc@redhat.com> <1216899979-32532-2-git-send-email-markmc@redhat.com> <1216899979-32532-3-git-send-email-markmc@redhat.com> <1216899979-32532-4-git-send-email-markmc@redhat.com> <48890ECD.10104@qumranet.com> Reply-To: Mark McLoughlin Mime-Version: 1.0 Content-Type: text/plain Content-Transfer-Encoding: 7bit Cc: kvm@vger.kernel.org, Herbert Xu , Rusty Russell To: Dor Laor Return-path: Received: from mx1.redhat.com ([66.187.233.31]:36056 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751317AbYGYRXX (ORCPT ); Fri, 25 Jul 2008 13:23:23 -0400 In-Reply-To: <48890ECD.10104@qumranet.com> Sender: kvm-owner@vger.kernel.org List-ID: On Fri, 2008-07-25 at 02:22 +0300, Dor Laor wrote: > Mark McLoughlin wrote: > > virtio_net tries to guess when it has received a tx > > notification from the guest whether it indicates that the > > guest has no more room in the tx ring and it should > > immediately flush the queued buffers. ... > > - if (n->tx_timer_active && > > - (vq->vring.avail->idx - vq->last_avail_idx) == 64) { > > + if (n->tx_timer_active) { > > > Actually it was worthless anyway since if we set the timer, the flag > below would have been cleared, > causing the guest not to notify the host, thus the ==64 never called. No, that's the point I'm trying to make in the commit message - the guest ignores the NO_NOTIFY flag when the tx queue fills up and sends a notification anyway. The "== 64" test seems to be an attempt to catch this ring-full condition. Well, actually the test was worthless for a different reason, I guess. If tx_timer_active is set and we get a notification, then given the current guest code the number of buffers available should *always* be 64. Cheers, Mark.