[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [RESEND Patch v1 35/37] vhost-pci-net: start the vhost-pci-
From: |
Wei Wang |
Subject: |
[Qemu-devel] [RESEND Patch v1 35/37] vhost-pci-net: start the vhost-pci-net device |
Date: |
Mon, 19 Dec 2016 13:59:10 +0800 |
If the peer device on the other side doesn't need to be reset, then
start the device when DRIVER_OK is received.
Signed-off-by: Wei Wang <address@hidden>
---
hw/net/vhost-pci-net.c | 15 +++++++++++++++
1 file changed, 15 insertions(+)
diff --git a/hw/net/vhost-pci-net.c b/hw/net/vhost-pci-net.c
index 3289f4d..4f2fab4 100644
--- a/hw/net/vhost-pci-net.c
+++ b/hw/net/vhost-pci-net.c
@@ -22,6 +22,16 @@
#define VPNET_CQ_SIZE 32
#define VPNET_RQ_SIZE 256
+static void vpnet_set_link_up(VhostPCINet *vpnet)
+{
+ VirtIODevice *vdev = VIRTIO_DEVICE(vpnet);
+ uint16_t old_status = vpnet->status;
+
+ vpnet->status |= VPNET_S_LINK_UP;
+ if (vpnet->status != old_status)
+ virtio_notify_config(vdev);
+}
+
void vpnet_set_peer_vq_num(VhostPCINet *vpnet, uint16_t num)
{
vpnet->peer_vq_num = num;
@@ -127,6 +137,11 @@ static void vpnet_set_status(struct VirtIODevice *vdev,
uint8_t status)
if (status & VIRTIO_CONFIG_S_DRIVER_OK) {
vpnet_send_peer_mem_msg(vpnet);
vpnet_send_peer_vq_msg(vpnet);
+ /* If the peer device is not reset, start the device now */
+ if (!vp_slave->peer_reset) {
+ vdev->status = status;
+ vpnet_set_link_up(vpnet);
+ }
}
}
--
2.7.4
- [Qemu-devel] [RESEND Patch v1 25/37] vhost-pci-slave/msg: VHOST_USER_SEND_RARP, (continued)
- [Qemu-devel] [RESEND Patch v1 25/37] vhost-pci-slave/msg: VHOST_USER_SEND_RARP, Wei Wang, 2016/12/19
- [Qemu-devel] [RESEND Patch v1 26/37] vhost-pci-slave/msg: VHOST_USER_GET_VRING_BASE, Wei Wang, 2016/12/19
- [Qemu-devel] [RESEND Patch v1 28/37] vhost-pci-net: pass the mem and vring info to the driver, Wei Wang, 2016/12/19
- [Qemu-devel] [RESEND Patch v1 27/37] vhost-pci-net: pass the info collected by vp_slave to the device, Wei Wang, 2016/12/19
- [Qemu-devel] [RESEND Patch v1 29/37] vhost-pci-slave/msg: VHOST_USER_SET_VHOST_PCI (start), Wei Wang, 2016/12/19
- [Qemu-devel] [RESEND Patch v1 30/37] vhost-pci-slave/msg: VHOST_USER_SET_VHOST_PCI (stop), Wei Wang, 2016/12/19
- [Qemu-devel] [RESEND Patch v1 33/37] vhost-pci-net: send the negotiated feature bits to the master, Wei Wang, 2016/12/19
- [Qemu-devel] [RESEND Patch v1 31/37] vhost-user/msg: send VHOST_USER_SET_VHOST_PCI (start/stop), Wei Wang, 2016/12/19
- [Qemu-devel] [RESEND Patch v1 32/37] vhost-user: add asynchronous read for the vhost-user master, Wei Wang, 2016/12/19
- [Qemu-devel] [RESEND Patch v1 34/37] vhost-pci-slave: add "peer_reset", Wei Wang, 2016/12/19
- [Qemu-devel] [RESEND Patch v1 35/37] vhost-pci-net: start the vhost-pci-net device,
Wei Wang <=
- [Qemu-devel] [RESEND Patch v1 37/37] vl: enable vhost-pci-slave, Wei Wang, 2016/12/19
- [Qemu-devel] [RESEND Patch v1 36/37] vhost-user/msg: handling VHOST_USER_SET_FEATURES, Wei Wang, 2016/12/19
- Re: [Qemu-devel] [RESEND Patch v1 00/37] Implementation of vhost-pci for inter-vm commucation, no-reply, 2016/12/19
- Re: [Qemu-devel] [RESEND Patch v1 00/37] Implementation of vhost-pci for inter-vm commucation, Marc-André Lureau, 2016/12/19