qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: jiangyiwen <jiangyiwen@huawei.com>
To: "Michael S. Tsirkin" <mst@redhat.com>,
	Stefan Hajnoczi <stefanha@redhat.com>,
	Jason Wang <jasowang@redhat.com>
Cc: qemu-devel@nongnu.org
Subject: [Qemu-devel] [PATCH] vhost-vsock: support parse mergeable feature
Date: Wed, 12 Dec 2018 17:54:49 +0800	[thread overview]
Message-ID: <5C10DAE9.3010605@huawei.com> (raw)

Currently vhost-vsock doesn't have any feature bits, so it
don't support parse mergeable rx buffer feature. And the
feature is support in another series of patches named
"VSOCK: support mergeable rx buffer in vhost-vsock".

So we neet to support parse mergeable feature in vhost-vsock
if above patches are merged.

Signed-off-by: Yiwen Jiang <jiangyiwen@huawei.com>
---
 hw/virtio/vhost-vsock.c                       | 9 +++++++--
 include/standard-headers/linux/virtio_vsock.h | 3 +++
 2 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/hw/virtio/vhost-vsock.c b/hw/virtio/vhost-vsock.c
index aa5af92..5023c05 100644
--- a/hw/virtio/vhost-vsock.c
+++ b/hw/virtio/vhost-vsock.c
@@ -178,8 +178,13 @@ static uint64_t vhost_vsock_get_features(VirtIODevice *vdev,
                                          uint64_t requested_features,
                                          Error **errp)
 {
-    /* No feature bits used yet */
-    return requested_features;
+    VHostVSock *vsock = VHOST_VSOCK(vdev);
+    uint64_t features;
+
+    virtio_add_feature(&requested_features, VIRTIO_VSOCK_F_MRG_RXBUF);
+    features = requested_features & vsock->vhost_dev.features;
+
+    return features;
 }

 static void vhost_vsock_handle_output(VirtIODevice *vdev, VirtQueue *vq)
diff --git a/include/standard-headers/linux/virtio_vsock.h b/include/standard-headers/linux/virtio_vsock.h
index be44321..4c583ec 100644
--- a/include/standard-headers/linux/virtio_vsock.h
+++ b/include/standard-headers/linux/virtio_vsock.h
@@ -38,6 +38,9 @@
 #include "standard-headers/linux/virtio_ids.h"
 #include "standard-headers/linux/virtio_config.h"

+/* Virtio-vsock feature */
+#define VIRTIO_VSOCK_F_MRG_RXBUF 0 /* Host can merge receive buffers. */
+
 struct virtio_vsock_config {
 	uint64_t guest_cid;
 } QEMU_PACKED;
-- 
1.8.3.1

             reply	other threads:[~2018-12-12  9:55 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-12-12  9:54 jiangyiwen [this message]
2018-12-12 13:19 ` [Qemu-devel] [PATCH] vhost-vsock: support parse mergeable feature Michael S. Tsirkin
2018-12-13  3:27   ` jiangyiwen
2018-12-13 14:54     ` Michael S. Tsirkin
2018-12-14  9:43       ` jiangyiwen
2018-12-14 12:58         ` Michael S. Tsirkin
2018-12-13 15:34     ` Stefan Hajnoczi
2018-12-14  9:45       ` jiangyiwen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5C10DAE9.3010605@huawei.com \
    --to=jiangyiwen@huawei.com \
    --cc=jasowang@redhat.com \
    --cc=mst@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=stefanha@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).