From patchwork Tue Feb 1 01:30:38 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sridhar Samudrala X-Patchwork-Id: 521891 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id p111Uuo9020596 for ; Tue, 1 Feb 2011 01:30:57 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754339Ab1BABao (ORCPT ); Mon, 31 Jan 2011 20:30:44 -0500 Received: from e2.ny.us.ibm.com ([32.97.182.142]:53170 "EHLO e2.ny.us.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754267Ab1BABan (ORCPT ); Mon, 31 Jan 2011 20:30:43 -0500 Received: from d01dlp02.pok.ibm.com (d01dlp02.pok.ibm.com [9.56.224.85]) by e2.ny.us.ibm.com (8.14.4/8.13.1) with ESMTP id p111D0EP010339; Mon, 31 Jan 2011 20:13:00 -0500 Received: from d01relay06.pok.ibm.com (d01relay06.pok.ibm.com [9.56.227.116]) by d01dlp02.pok.ibm.com (Postfix) with ESMTP id E66F54DE803B; Mon, 31 Jan 2011 20:30:09 -0500 (EST) Received: from d01av04.pok.ibm.com (d01av04.pok.ibm.com [9.56.224.64]) by d01relay06.pok.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id p111Uf3V2060500; Mon, 31 Jan 2011 20:30:41 -0500 Received: from d01av04.pok.ibm.com (loopback [127.0.0.1]) by d01av04.pok.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id p111UeId017006; Mon, 31 Jan 2011 20:30:41 -0500 Received: from [9.47.24.19] (sridhar.beaverton.ibm.com [9.47.24.19]) by d01av04.pok.ibm.com (8.14.4/8.13.1/NCO v10.0 AVin) with ESMTP id p111UdZD016940; Mon, 31 Jan 2011 20:30:39 -0500 Subject: Re: Network performance with small packets From: Sridhar Samudrala To: Steve Dobbelstein Cc: "Michael S. Tsirkin" , David Miller , kvm@vger.kernel.org, mashirle@linux.vnet.ibm.com, netdev@vger.kernel.org In-Reply-To: References: <20110127193131.GD5228@redhat.com> <1296157547.1640.45.camel@localhost.localdomain> <20110127200548.GE5228@redhat.com> <20110127.130240.104065182.davem@davemloft.net> <1296163838.1640.53.camel@localhost.localdomain> <20110128121616.GA8374@redhat.com> Date: Mon, 31 Jan 2011 17:30:38 -0800 Message-Id: <1296523838.30191.39.camel@sridhar.beaverton.ibm.com> Mime-Version: 1.0 X-Mailer: Evolution 2.26.3 (2.26.3-1.fc11) X-Content-Scanned: Fidelis XPS MAILER Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter1.kernel.org [140.211.167.41]); Tue, 01 Feb 2011 01:31:19 +0000 (UTC) diff --git a/drivers/vhost/net.c b/drivers/vhost/net.c index 9b3ca10..5f9fae9 100644 --- a/drivers/vhost/net.c +++ b/drivers/vhost/net.c @@ -197,7 +197,7 @@ static void handle_tx(struct vhost_net *net) if (err != len) pr_debug("Truncated TX packet: " " len %d != %zd\n", err, len); - vhost_add_used_and_signal(&net->dev, vq, head, 0); + vhost_add_used(vq, head, 0); total_len += len; if (unlikely(total_len >= VHOST_NET_WEIGHT)) { vhost_poll_queue(&vq->poll); @@ -205,6 +205,8 @@ static void handle_tx(struct vhost_net *net) } } + if (total_len > 0) + vhost_signal(&net->dev, vq); mutex_unlock(&vq->mutex); }