diff options
-rw-r--r-- | vnet/vnet/devices/dpdk/device.c | 12 | ||||
-rw-r--r-- | vnet/vnet/devices/dpdk/dpdk_priv.h | 6 |
2 files changed, 11 insertions, 7 deletions
diff --git a/vnet/vnet/devices/dpdk/device.c b/vnet/vnet/devices/dpdk/device.c index 72df02a4..92f8dcb7 100644 --- a/vnet/vnet/devices/dpdk/device.c +++ b/vnet/vnet/devices/dpdk/device.c @@ -273,8 +273,10 @@ u32 tx_burst_vector_internal (vlib_main_t * vm, dpdk_vu_vring *vring = &(xd->vu_intf->vrings[VIRTIO_RXQ]); vring->n_since_last_int += rv; - if (vring->n_since_last_int > dm->vhost_coalesce_frames) - dpdk_vhost_user_send_interrupt(dm->vlib_main, xd, VIRTIO_RXQ); + f64 now = vlib_time_now (vm); + if (vring->int_deadline < now || + vring->n_since_last_int > dm->vhost_coalesce_frames) + dpdk_vhost_user_send_interrupt(vm, xd, VIRTIO_RXQ); } int c = rv; @@ -299,8 +301,10 @@ u32 tx_burst_vector_internal (vlib_main_t * vm, dpdk_vu_vring *vring = &(xd->vu_intf->vrings[VIRTIO_RXQ]); vring->n_since_last_int += rv; - if (vring->n_since_last_int > dm->vhost_coalesce_frames) - dpdk_vhost_user_send_interrupt(dm->vlib_main, xd, VIRTIO_RXQ); + f64 now = vlib_time_now (vm); + if (vring->int_deadline < now || + vring->n_since_last_int > dm->vhost_coalesce_frames) + dpdk_vhost_user_send_interrupt(vm, xd, VIRTIO_RXQ); } int c = rv; diff --git a/vnet/vnet/devices/dpdk/dpdk_priv.h b/vnet/vnet/devices/dpdk/dpdk_priv.h index 314e2806..e499e2ae 100644 --- a/vnet/vnet/devices/dpdk/dpdk_priv.h +++ b/vnet/vnet/devices/dpdk/dpdk_priv.h @@ -350,7 +350,7 @@ dpdk_rx_burst ( dpdk_main_t * dm, dpdk_device_t * xd, u16 queue_id) bm->pktmbuf_pools[socket_id], xd->rx_vectors[queue_id], VLIB_FRAME_SIZE); - f64 now = vlib_time_now (dm->vlib_main); + f64 now = vlib_time_now (vm); /* send pending interrupts if needed */ if (dpdk_vhost_user_want_interrupt(xd, VIRTIO_TXQ)) { @@ -359,13 +359,13 @@ dpdk_rx_burst ( dpdk_main_t * dm, dpdk_device_t * xd, u16 queue_id) if ((vring->n_since_last_int && (vring->int_deadline < now)) || (vring->n_since_last_int > dm->vhost_coalesce_frames)) - dpdk_vhost_user_send_interrupt(dm->vlib_main, xd, VIRTIO_TXQ); + dpdk_vhost_user_send_interrupt(vm, xd, VIRTIO_TXQ); } if (dpdk_vhost_user_want_interrupt(xd, VIRTIO_RXQ)) { dpdk_vu_vring *vring = &(xd->vu_intf->vrings[VIRTIO_RXQ]); if (vring->n_since_last_int && (vring->int_deadline < now)) - dpdk_vhost_user_send_interrupt(dm->vlib_main, xd, VIRTIO_RXQ); + dpdk_vhost_user_send_interrupt(vm, xd, VIRTIO_RXQ); } } |