aboutsummaryrefslogtreecommitdiffstats
path: root/vnet
diff options
context:
space:
mode:
authorShesha Sreenivasamurthy <shesha@cisco.com>2016-02-02 10:06:07 -0800
committerGerrit Code Review <gerrit@fd.io>2016-02-02 18:24:42 +0000
commitcfe0724b22672369d7d26108eef89362b7006a0c (patch)
tree24b6bd6118889b6b186167fe63ada95a7df10c7a /vnet
parent4189c17afb7b62977b359929e42cacf942900425 (diff)
Use per-thread vlib_main
Change-Id: I8bee9f6661878a74a0375944ac01c9cb3a0acfbf Signed-off-by: Shesha Sreenivasamurthy <shesha@cisco.com>
Diffstat (limited to 'vnet')
-rw-r--r--vnet/vnet/devices/dpdk/device.c12
-rw-r--r--vnet/vnet/devices/dpdk/dpdk_priv.h6
2 files changed, 11 insertions, 7 deletions
diff --git a/vnet/vnet/devices/dpdk/device.c b/vnet/vnet/devices/dpdk/device.c
index 72df02a4455..92f8dcb7870 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 314e280636a..e499e2aec0b 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);
}
}