Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933143AbbBIIkH (ORCPT ); Mon, 9 Feb 2015 03:40:07 -0500 Received: from mx1.redhat.com ([209.132.183.28]:34787 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933117AbbBIIkB (ORCPT ); Mon, 9 Feb 2015 03:40:01 -0500 From: Jason Wang To: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, virtualization@lists.linux-foundation.org, mst@redhat.com Cc: pagupta@redhat.com, Jason Wang Subject: [PATCH RFC v5 net-next 5/6] vhost: let vhost_signal() returns whether signalled Date: Mon, 9 Feb 2015 03:39:24 -0500 Message-Id: <1423471165-34243-6-git-send-email-jasowang@redhat.com> In-Reply-To: <1423471165-34243-1-git-send-email-jasowang@redhat.com> References: <1423471165-34243-1-git-send-email-jasowang@redhat.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2021 Lines: 52 Let vhost_signal() return whether or not vhost has injected an interrupt to guest. This is used for interrupt coalescing implementation to calculate the interval between two interrupts. Signed-off-by: Jason Wang --- drivers/vhost/vhost.c | 7 +++++-- drivers/vhost/vhost.h | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/drivers/vhost/vhost.c b/drivers/vhost/vhost.c index cb807d0..20d6b84 100644 --- a/drivers/vhost/vhost.c +++ b/drivers/vhost/vhost.c @@ -1480,11 +1480,14 @@ static bool vhost_notify(struct vhost_dev *dev, struct vhost_virtqueue *vq) } /* This actually signals the guest, using eventfd. */ -void vhost_signal(struct vhost_dev *dev, struct vhost_virtqueue *vq) +bool vhost_signal(struct vhost_dev *dev, struct vhost_virtqueue *vq) { /* Signal the Guest tell them we used something up. */ - if (vq->call_ctx && vhost_notify(dev, vq)) + if (vq->call_ctx && vhost_notify(dev, vq)) { eventfd_signal(vq->call_ctx, 1); + return true; + } + return false; } EXPORT_SYMBOL_GPL(vhost_signal); diff --git a/drivers/vhost/vhost.h b/drivers/vhost/vhost.h index 8c1c792..a482563 100644 --- a/drivers/vhost/vhost.h +++ b/drivers/vhost/vhost.h @@ -148,7 +148,7 @@ void vhost_add_used_and_signal(struct vhost_dev *, struct vhost_virtqueue *, unsigned int id, int len); void vhost_add_used_and_signal_n(struct vhost_dev *, struct vhost_virtqueue *, struct vring_used_elem *heads, unsigned count); -void vhost_signal(struct vhost_dev *, struct vhost_virtqueue *); +bool vhost_signal(struct vhost_dev *, struct vhost_virtqueue *); void vhost_disable_notify(struct vhost_dev *, struct vhost_virtqueue *); bool vhost_enable_notify(struct vhost_dev *, struct vhost_virtqueue *); -- 1.8.3.1 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/