qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Eugenio Pérez" <eperezma@redhat.com>
To: qemu-devel@nongnu.org
Cc: Laurent Vivier <lvivier@redhat.com>,
	Parav Pandit <parav@mellanox.com>, Cindy Lu <lulu@redhat.com>,
	"Michael S. Tsirkin" <mst@redhat.com>,
	Jason Wang <jasowang@redhat.com>,
	Gautam Dawar <gdawar@xilinx.com>,
	Harpreet Singh Anand <hanand@xilinx.com>,
	Eli Cohen <eli@mellanox.com>,
	Zhu Lingshan <lingshan.zhu@intel.com>
Subject: [RFC PATCH 8/9] vhost: Add vhost_svq_start_op
Date: Mon, 14 Feb 2022 20:16:34 +0100	[thread overview]
Message-ID: <20220214191635.1604932-9-eperezma@redhat.com> (raw)
In-Reply-To: <20220214191635.1604932-1-eperezma@redhat.com>

Signed-off-by: Eugenio Pérez <eperezma@redhat.com>
---
 hw/virtio/vhost-shadow-virtqueue.h | 4 +++-
 hw/virtio/vhost-shadow-virtqueue.c | 4 ++++
 2 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/hw/virtio/vhost-shadow-virtqueue.h b/hw/virtio/vhost-shadow-virtqueue.h
index 767b0a82ba..8f2377bbc4 100644
--- a/hw/virtio/vhost-shadow-virtqueue.h
+++ b/hw/virtio/vhost-shadow-virtqueue.h
@@ -15,11 +15,13 @@
 #include "hw/virtio/vhost-iova-tree.h"
 
 typedef struct VhostShadowVirtqueue VhostShadowVirtqueue;
-
+typedef bool (*vhost_svq_start_op)(VhostShadowVirtqueue *svq,
+                                   VirtIODevice *vdev);
 typedef void (*VirtQueueElementCallback)(VirtIODevice *vdev,
                                          const VirtQueueElement *elem);
 
 typedef struct VhostShadowVirtqueueOps {
+    vhost_svq_start_op start;
     VirtQueueElementCallback used_elem_handler;
 } VhostShadowVirtqueueOps;
 
diff --git a/hw/virtio/vhost-shadow-virtqueue.c b/hw/virtio/vhost-shadow-virtqueue.c
index 26938b059c..18cdb35ea3 100644
--- a/hw/virtio/vhost-shadow-virtqueue.c
+++ b/hw/virtio/vhost-shadow-virtqueue.c
@@ -783,6 +783,10 @@ void vhost_svq_start(VhostShadowVirtqueue *svq, VirtIODevice *vdev,
     for (unsigned i = 0; i < svq->vring.num - 1; i++) {
         svq->vring.desc[i].next = cpu_to_le16(i + 1);
     }
+
+    if (svq->ops && svq->ops->start) {
+        svq->ops->start(svq, vdev);
+    }
 }
 
 /**
-- 
2.27.0



  parent reply	other threads:[~2022-02-14 19:54 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-14 19:16 [RFC PATCH 0/9] Net Control VQ support in vDPA SVQ Eugenio Pérez
2022-02-14 19:16 ` [RFC PATCH 1/9] virtio-net: Expose ctrl virtqueue logic Eugenio Pérez
2022-02-14 19:16 ` [RFC PATCH 2/9] vdpa: Extract get geatures part from vhost_vdpa_get_max_queue_pairs Eugenio Pérez
2022-02-14 19:16 ` [RFC PATCH 3/9] virtio: Make virtqueue_alloc_element non-static Eugenio Pérez
2022-02-14 19:16 ` [RFC PATCH 4/9] vhost: Add SVQElement Eugenio Pérez
2022-02-14 19:16 ` [RFC PATCH 5/9] vhost: Add custom used buffer callback Eugenio Pérez
2022-02-14 19:16 ` [RFC PATCH 6/9] vdpa: Add map/unmap operation callback to SVQ Eugenio Pérez
2022-02-14 19:16 ` [RFC PATCH 7/9] vhost: Add vhost_svq_inject Eugenio Pérez
2022-02-15  9:46   ` Eugenio Perez Martin
2022-02-14 19:16 ` Eugenio Pérez [this message]
2022-02-14 19:16 ` [RFC PATCH 9/9] vdpa: control virtqueue support on shadow virtqueue Eugenio Pérez
2022-02-15 15:51 ` [RFC PATCH 0/9] Net Control VQ support in vDPA SVQ Eugenio Perez Martin

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=20220214191635.1604932-9-eperezma@redhat.com \
    --to=eperezma@redhat.com \
    --cc=eli@mellanox.com \
    --cc=gdawar@xilinx.com \
    --cc=hanand@xilinx.com \
    --cc=jasowang@redhat.com \
    --cc=lingshan.zhu@intel.com \
    --cc=lulu@redhat.com \
    --cc=lvivier@redhat.com \
    --cc=mst@redhat.com \
    --cc=parav@mellanox.com \
    --cc=qemu-devel@nongnu.org \
    /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).