[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <m31vd95tv2.fsf@trasno.mitica>
Date: Tue, 18 May 2010 13:31:29 +0200
From: Juan Quintela <quintela@...hat.com>
To: "Michael S. Tsirkin" <mst@...hat.com>
Cc: davem@...emloft.net, Rusty Russell <rusty@...tcorp.com.au>,
"Paul E. McKenney" <paulmck@...ux.vnet.ibm.com>,
Arnd Bergmann <arnd@...db.de>, kvm@...r.kernel.org,
virtualization@...ts.osdl.org, netdev@...r.kernel.org,
linux-kernel@...r.kernel.org, alex.williamson@...hat.com,
amit.shah@...hat.com
Subject: Re: [PATCHv2] vhost-net: utilize PUBLISH_USED_IDX feature
"Michael S. Tsirkin" <mst@...hat.com> wrote:
> With PUBLISH_USED_IDX, guest tells us which used entries
> it has consumed. This can be used to reduce the number
> of interrupts: after we write a used entry, if the guest has not yet
> consumed the previous entry, or if the guest has already consumed the
> new entry, we do not need to interrupt.
> This imporves bandwidth by 30% under some workflows.
>
> Signed-off-by: Michael S. Tsirkin <mst@...hat.com>
> ---
>
> This is on top of Rusty's tree and depends on the virtio patch.
>
> Changes from v1:
> fix build
Minor nit if you have to respin it:
> /* This actually signals the guest, using eventfd. */
> -void vhost_signal(struct vhost_dev *dev, struct vhost_virtqueue *vq)
> +static void vhost_signal(struct vhost_dev *dev, struct vhost_virtqueue *vq)
> {
> __u16 flags;
> + __u16 used;
local var named "used" here
> /* Flush out used index updates. This is paired
> * with the barrier that the Guest executes when enabling
> * interrupts. */
> @@ -1053,6 +1057,17 @@ void vhost_signal(struct vhost_dev *dev, struct vhost_virtqueue *vq)
> !vhost_has_feature(dev, VIRTIO_F_NOTIFY_ON_EMPTY)))
> return;
>
> + if (vhost_has_feature(dev, VIRTIO_RING_F_PUBLISH_USED)) {
> + __u16 used;
and a "more" local one also named "used" :)
I guess you want to remove the previous declaration, as var is only used
in this block.
> + if (get_user(used, vq->last_used)) {
> + vq_err(vq, "Failed to get last used idx");
> + return;
> + }
> +
> + if (used != (u16)(vq->last_used_idx - 1))
> + return;
> + }
> +
> /* Signal the Guest tell them we used something up. */
> if (vq->call_ctx)
> eventfd_signal(vq->call_ctx, 1);
Rest of patch looks ok, and as a bonus un-export two functions.
Later, Juan.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists