From patchwork Sun May 29 12:51:48 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ingo Molnar X-Patchwork-Id: 827592 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 p4TCq2Xs027680 for ; Sun, 29 May 2011 12:52:02 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753287Ab1E2Mv6 (ORCPT ); Sun, 29 May 2011 08:51:58 -0400 Received: from mx2.mail.elte.hu ([157.181.151.9]:33368 "EHLO mx2.mail.elte.hu" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750992Ab1E2Mv6 (ORCPT ); Sun, 29 May 2011 08:51:58 -0400 Received: from elvis.elte.hu ([157.181.1.14]) by mx2.mail.elte.hu with esmtp (Exim) id 1QQfTB-0005s5-Sv from ; Sun, 29 May 2011 14:51:56 +0200 Received: by elvis.elte.hu (Postfix, from userid 1004) id 648D33E252E; Sun, 29 May 2011 14:51:48 +0200 (CEST) Date: Sun, 29 May 2011 14:51:48 +0200 From: Ingo Molnar To: Sasha Levin Cc: penberg@kernel.org, john@jfloren.net, kvm@vger.kernel.org, asias.hejun@gmail.com, gorcunov@gmail.com, prasadjoshi124@gmail.com Subject: Re: [PATCH v2 3/4] kvm tools: Use ioeventfd in virtio-net Message-ID: <20110529125148.GA28836@elte.hu> References: <1306513120-28794-1-git-send-email-levinsasha928@gmail.com> <1306513120-28794-3-git-send-email-levinsasha928@gmail.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <1306513120-28794-3-git-send-email-levinsasha928@gmail.com> User-Agent: Mutt/1.5.20 (2009-08-17) Received-SPF: neutral (mx2.mail.elte.hu: 157.181.1.14 is neither permitted nor denied by domain of elte.hu) client-ip=157.181.1.14; envelope-from=mingo@elte.hu; helo=elvis.elte.hu; X-ELTE-SpamScore: -2.0 X-ELTE-SpamLevel: X-ELTE-SpamCheck: no X-ELTE-SpamVersion: ELTE 2.0 X-ELTE-SpamCheck-Details: score=-2.0 required=5.9 tests=BAYES_00 autolearn=no SpamAssassin version=3.3.1 -2.0 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] 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]); Sun, 29 May 2011 12:52:02 +0000 (UTC) * Sasha Levin wrote: > Use ioeventfds to receive notifications of IO events in virtio-net. > Doing so prevents an exit every time we receive/send a packet. > > Signed-off-by: Sasha Levin > --- > tools/kvm/virtio/net.c | 22 ++++++++++++++++++++++ > 1 files changed, 22 insertions(+), 0 deletions(-) This needs the fix below to build on 32-bit. Thanks, Ingo Signed-off-by: Ingo Molnar --- To unsubscribe from this list: send the line "unsubscribe kvm" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/tools/kvm/virtio/net.c b/tools/kvm/virtio/net.c index 5c39c43..6916af6 100644 --- a/tools/kvm/virtio/net.c +++ b/tools/kvm/virtio/net.c @@ -283,7 +283,7 @@ static bool virtio_net_pci_io_out(struct ioport *ioport, struct kvm *kvm, u16 po static void ioevent_callback(struct kvm *kvm, void *param) { - virtio_net_handle_callback(kvm, (u64)param); + virtio_net_handle_callback(kvm, (u64)(long)param); } static struct ioport_operations virtio_net_io_ops = { @@ -416,7 +416,7 @@ void virtio_net__init(const struct virtio_net_parameters *params) .io_len = sizeof(u16), .fn = ioevent_callback, .datamatch = i, - .fn_ptr = (void *)i, + .fn_ptr = (void *)(long)i, .fn_kvm = params->kvm, .fd = eventfd(0, 0), };