[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Minios-devel] [UNIKRAFT PATCH v2 5/7] plat/drivers: Configure receive queue interrupt
Reviewed-by: Simon Kuenzer <simon.kuenzer@xxxxxxxxx> On 19.10.18 15:40, Sharan Santhanam wrote: The patch implements enable and disabling interrupt on the receive queue. Signed-off-by: Sharan Santhanam <sharan.santhanam@xxxxxxxxx> Signed-off-by: Razvan Cojocaru <razvan.cojocaru93@xxxxxxxxx> --- plat/drivers/virtio/virtio_net.c | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/plat/drivers/virtio/virtio_net.c b/plat/drivers/virtio/virtio_net.c index 7effe15..e1d0a09 100644 --- a/plat/drivers/virtio/virtio_net.c +++ b/plat/drivers/virtio/virtio_net.c @@ -635,19 +635,39 @@ err_negotiate_feature: }static int virtio_net_rx_intr_enable(struct uk_netdev *n,- struct uk_netdev_rx_queue *queue __unused) + struct uk_netdev_rx_queue *queue) { + struct virtio_net_device *d __unused; int rc = 0;UK_ASSERT(n);+ d = to_virtionetdev(n); + /* If the interrupt is enabled */ + if (queue->intr_enabled & VTNET_INTR_EN) + return 0; + + /** + * Enable the user configuration bit. This would cause the interrupt to + * be enabled automatically, if the interrupt could not be enabled now + * due to data in the queue. + */ + queue->intr_enabled = VTNET_INTR_USR_EN; + rc = virtqueue_intr_enable(queue->vq); + if (!rc) + queue->intr_enabled |= VTNET_INTR_EN;return rc;}static int virtio_net_rx_intr_disable(struct uk_netdev *n,- struct uk_netdev_rx_queue *queue __unused) + struct uk_netdev_rx_queue *queue) { + struct virtio_net_device *vndev __unused; + UK_ASSERT(n); + vndev = to_virtionetdev(n); + virtqueue_intr_disable(queue->vq); + queue->intr_enabled &= ~(VTNET_INTR_USR_EN | VTNET_INTR_EN); return 0; } _______________________________________________ Minios-devel mailing list Minios-devel@xxxxxxxxxxxxxxxxxxxx https://lists.xenproject.org/mailman/listinfo/minios-devel
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |