All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Michael S. Tsirkin" <mst@redhat.com>
To: qemu-devel@nongnu.org
Cc: Peter Maydell <peter.maydell@linaro.org>,
	Arseny Krasnov <arseny.krasnov@kaspersky.com>,
	Stefano Garzarella <sgarzare@redhat.com>
Subject: [PULL 23/23] vhost-vsock: SOCK_SEQPACKET feature bit support
Date: Tue, 13 Jul 2021 18:11:21 -0400	[thread overview]
Message-ID: <20210713220946.212562-24-mst@redhat.com> (raw)
In-Reply-To: <20210713220946.212562-1-mst@redhat.com>

From: Arseny Krasnov <arseny.krasnov@kaspersky.com>

This adds processing of VIRTIO_VSOCK_F_SEQPACKET features bit. Guest
negotiates it with vhost, thus both will know that SOCK_SEQPACKET
supported by peer.

Signed-off-by: Arseny Krasnov <arseny.krasnov@kaspersky.com>
Message-Id: <20210622144747.2949134-1-arseny.krasnov@kaspersky.com>
Reviewed-by: Stefano Garzarella <sgarzare@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
---
 hw/virtio/vhost-vsock.c | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/hw/virtio/vhost-vsock.c b/hw/virtio/vhost-vsock.c
index 777cafe70d..1b1a5c70ed 100644
--- a/hw/virtio/vhost-vsock.c
+++ b/hw/virtio/vhost-vsock.c
@@ -21,6 +21,11 @@
 #include "hw/virtio/vhost-vsock.h"
 #include "monitor/monitor.h"
 
+const int feature_bits[] = {
+    VIRTIO_VSOCK_F_SEQPACKET,
+    VHOST_INVALID_FEATURE_BIT
+};
+
 static void vhost_vsock_get_config(VirtIODevice *vdev, uint8_t *config)
 {
     VHostVSock *vsock = VHOST_VSOCK(vdev);
@@ -108,8 +113,11 @@ static uint64_t vhost_vsock_get_features(VirtIODevice *vdev,
                                          uint64_t requested_features,
                                          Error **errp)
 {
-    /* No feature bits used yet */
-    return requested_features;
+    VHostVSockCommon *vvc = VHOST_VSOCK_COMMON(vdev);
+
+    virtio_add_feature(&requested_features, VIRTIO_VSOCK_F_SEQPACKET);
+    return vhost_get_features(&vvc->vhost_dev, feature_bits,
+                                requested_features);
 }
 
 static const VMStateDescription vmstate_virtio_vhost_vsock = {
-- 
MST



  parent reply	other threads:[~2021-07-13 22:23 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-13 22:10 [PULL 00/23] pc,pci,virtio: lots of new features Michael S. Tsirkin
2021-07-13 22:10 ` [PULL 01/23] hw/i386/acpi-build: Add ACPI PCI hot-plug methods to Q35 Michael S. Tsirkin
2021-07-13 22:10 ` [PULL 02/23] hw/acpi/ich9: Enable ACPI PCI hot-plug Michael S. Tsirkin
2021-07-13 22:10 ` [PULL 03/23] hw/pci/pcie: Do not set HPC flag if acpihp is used Michael S. Tsirkin
2021-07-13 22:10 ` [PULL 04/23] bios-tables-test: Allow changes in DSDT ACPI tables Michael S. Tsirkin
2021-07-13 22:10 ` [PULL 05/23] hw/acpi/ich9: Set ACPI PCI hot-plug as default on Q35 Michael S. Tsirkin
2021-07-13 22:10 ` [PULL 06/23] bios-tables-test: Update golden binaries Michael S. Tsirkin
2021-07-13 22:10 ` [PULL 07/23] vhost-user-rng: Add vhost-user-rng implementation Michael S. Tsirkin
2021-07-13 22:10 ` [PULL 08/23] vhost-user-rng-pci: Add vhost-user-rng-pci implementation Michael S. Tsirkin
2021-07-13 22:10 ` [PULL 09/23] vhost-user-rng: backend: Add RNG vhost-user daemon implementation Michael S. Tsirkin
2021-07-13 22:10 ` [PULL 10/23] docs: Add documentation for vhost based RNG implementation Michael S. Tsirkin
2021-07-13 22:10 ` [PULL 11/23] hw/virtio: add boilerplate for vhost-user-i2c device Michael S. Tsirkin
2021-07-13 22:10 ` [PULL 12/23] hw/virtio: add vhost-user-i2c-pci boilerplate Michael S. Tsirkin
2021-07-13 22:10 ` [PULL 13/23] docs: Add '-device intel-iommu' entry Michael S. Tsirkin
2021-07-13 22:10 ` [PULL 14/23] hw/pci/pci_host: Allow PCI host to bypass iommu Michael S. Tsirkin
2021-07-13 22:10 ` [PULL 15/23] hw/pxb: Add a bypass iommu property Michael S. Tsirkin
2021-07-13 22:10 ` [PULL 16/23] hw/arm/virt: Add default_bus_bypass_iommu machine option Michael S. Tsirkin
2021-07-13 22:10 ` [PULL 17/23] hw/i386: Add a default_bus_bypass_iommu pc " Michael S. Tsirkin
2021-07-13 22:11 ` [PULL 18/23] hw/pci: Add pci_bus_range() to get PCI bus number range Michael S. Tsirkin
2021-07-13 22:11 ` [PULL 19/23] hw/arm/virt-acpi-build: Add IORT support to bypass SMMUv3 Michael S. Tsirkin
2021-07-13 22:11 ` [PULL 20/23] hw/i386/acpi-build: Add DMAR support to bypass iommu Michael S. Tsirkin
2021-07-13 22:11 ` [PULL 21/23] hw/i386/acpi-build: Add IVRS " Michael S. Tsirkin
2021-07-13 22:11 ` [PULL 22/23] docs: Add documentation for iommu bypass Michael S. Tsirkin
2021-07-13 22:11 ` Michael S. Tsirkin [this message]
2021-07-14 20:31 ` [PULL 00/23] pc,pci,virtio: lots of new features Peter Maydell
2021-07-15  8:54   ` Marcel Apfelbaum
2021-07-15 14:38     ` Michael S. Tsirkin
2021-07-15 21:21   ` Michael S. Tsirkin
2021-07-16  6:41     ` Peter Maydell
2021-07-16  8:41       ` Michael S. Tsirkin
2021-07-16 14:12         ` Peter Maydell
2021-07-16 15:09           ` Michael S. Tsirkin
2021-07-16 15:13           ` Michael S. Tsirkin

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=20210713220946.212562-24-mst@redhat.com \
    --to=mst@redhat.com \
    --cc=arseny.krasnov@kaspersky.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=sgarzare@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.