[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Minios-devel] [UNIKRAFT PATCH v2 6/7] plat/drivers: Starting the virtio device



Reviewed-by: Simon Kuenzer <simon.kuenzer@xxxxxxxxx>

On 19.10.18 15:40, Sharan Santhanam wrote:
Signed-off-by: Sharan Santhanam <sharan.santhanam@xxxxxxxxx>
Signed-off-by: Razvan Cojocaru <razvan.cojocaru93@xxxxxxxxx>
---
  plat/drivers/virtio/virtio_net.c | 26 ++++++++++++++++++++++++++
  1 file changed, 26 insertions(+)

diff --git a/plat/drivers/virtio/virtio_net.c b/plat/drivers/virtio/virtio_net.c
index e1d0a09..e7581f1 100644
--- a/plat/drivers/virtio/virtio_net.c
+++ b/plat/drivers/virtio/virtio_net.c
@@ -685,7 +685,33 @@ static void virtio_net_info_get(struct uk_netdev *dev,
static int virtio_net_start(struct uk_netdev *n)
  {
+       struct virtio_net_device *d;
+       int i = 0;
+
        UK_ASSERT(n != NULL);
+       d = to_virtionetdev(n);
+
+       /*
+        * By default, interrupts are disabled and it is up to the user or
+        * network stack to manually enable them with a call to
+        * enable_tx|rx_intr()
+        */
+       for (i = 0; i < d->rx_vqueue_cnt; i++) {
+               virtqueue_intr_disable(d->rxqs[i].vq);
+               d->rxqs[i].intr_enabled = 0;
+       }
+
+       for (i = 0; i < d->tx_vqueue_cnt; i++) {
+               virtqueue_intr_disable(d->txqs[i].vq);
+               d->txqs[i].intr_enabled = 0;
+       }
+
+       /*
+        * Set the DRIVER_OK status bit. At this point the device is "live".
+        */
+       virtio_dev_drv_up(d->vdev);
+       uk_pr_info(DRIVER_NAME": %"__PRIu16" started\n", d->uid);
+
        return 0;
  }

_______________________________________________
Minios-devel mailing list
Minios-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/minios-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.