[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v3 8/9] xen/9pfs: send responses back to the fronten
From: |
Stefano Stabellini |
Subject: |
[Qemu-devel] [PATCH v3 8/9] xen/9pfs: send responses back to the frontend |
Date: |
Thu, 16 Mar 2017 13:01:57 -0700 |
Once a request is completed, xen_9pfs_push_and_notify gets called. In
xen_9pfs_push_and_notify, update the indexes (data has already been
copied to the sg by the common code) and send a notification to the
frontend.
Schedule the bottom-half to check if we already have any other requests
pending.
Signed-off-by: Stefano Stabellini <address@hidden>
CC: address@hidden
CC: address@hidden
CC: Aneesh Kumar K.V <address@hidden>
CC: Greg Kurz <address@hidden>
---
hw/9pfs/xen-9p-backend.c | 16 ++++++++++++++++
1 file changed, 16 insertions(+)
diff --git a/hw/9pfs/xen-9p-backend.c b/hw/9pfs/xen-9p-backend.c
index 0a1eb34..c7b748a 100644
--- a/hw/9pfs/xen-9p-backend.c
+++ b/hw/9pfs/xen-9p-backend.c
@@ -177,6 +177,22 @@ static void xen_9pfs_init_in_iov_from_pdu(V9fsPDU *pdu,
static void xen_9pfs_push_and_notify(V9fsPDU *pdu)
{
+ RING_IDX prod;
+ Xen9pfsDev *priv = container_of(pdu->s, Xen9pfsDev, state);
+ Xen9pfsRing *ring = &priv->rings[pdu->tag % priv->num_rings];
+
+ ring->intf->out_cons = ring->out_cons;
+ xen_wmb();
+
+ prod = ring->intf->in_prod;
+ xen_rmb();
+ ring->intf->in_prod = prod + pdu->size;
+ xen_wmb();
+
+ ring->inprogress = false;
+ xenevtchn_notify(ring->evtchndev, ring->local_port);
+
+ qemu_bh_schedule(ring->bh);
}
static const struct V9fsTransport xen_9p_transport = {
--
1.9.1
- [Qemu-devel] [PATCH v3 4/9] xen/9pfs: introduce Xen 9pfs backend, (continued)
- [Qemu-devel] [PATCH v3 7/9] xen/9pfs: implement in/out_iov_from_pdu and vmarshal/vunmarshal, Stefano Stabellini, 2017/03/16
- [Qemu-devel] [PATCH v3 6/9] xen/9pfs: receive requests from the frontend, Stefano Stabellini, 2017/03/16
- [Qemu-devel] [PATCH v3 9/9] xen/9pfs: build and register Xen 9pfs backend, Stefano Stabellini, 2017/03/16
- [Qemu-devel] [PATCH v3 8/9] xen/9pfs: send responses back to the frontend,
Stefano Stabellini <=
- Re: [Qemu-devel] [PATCH v3 1/9] xen: do not build backends for targets that do not support xen, Greg Kurz, 2017/03/17
- Re: [Qemu-devel] [PATCH v3 1/9] xen: do not build backends for targets that do not support xen, Paolo Bonzini, 2017/03/17