From 1bf43a19afdb72f25bc3df0bff3a532b08789ca4 Mon Sep 17 00:00:00 2001 From: Vlad Zolotarov <vladz@cloudius-systems.com> Date: Sun, 18 May 2014 13:52:51 +0300 Subject: [PATCH] virtio-vring: rename db_used() -> update_used_event() Signed-off-by: Vlad Zolotarov <vladz@cloudius-systems.com> Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com> --- drivers/virtio-net.cc | 2 +- drivers/virtio-vring.hh | 17 +++++++++-------- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/drivers/virtio-net.cc b/drivers/virtio-net.cc index f861b319b..92e5d518b 100644 --- a/drivers/virtio-net.cc +++ b/drivers/virtio-net.cc @@ -813,7 +813,7 @@ void net::txq::gc() } if (req_cnt) { - vqueue->db_used(); + vqueue->update_used_event(); } vqueue->get_buf_gc(); diff --git a/drivers/virtio-vring.hh b/drivers/virtio-vring.hh index 84519d0fe..57451ad48 100644 --- a/drivers/virtio-vring.hh +++ b/drivers/virtio-vring.hh @@ -132,21 +132,22 @@ class virtio_driver; /** * Increment the _used_ring_host_head and doorbell if requested. * - * Let the host know we consumed the used entry. We separate that from - * get_buf_elem so no one will re-cycle the request header location - * until we're finished with it in the upper layer. + * If requested let the host know we consumed the used entry. + * We separate that from get_buf_elem so no one will re-cycle the + * request header location until we're finished with it in the upper + * layer. * - * @param doorbell if TRUE - doorbell the host + * @param update_host if TRUE - update the host as well */ - void get_buf_finalize(bool doorbell = true) { + void get_buf_finalize(bool update_host = true) { _used_ring_host_head++; - if (doorbell) { - db_used(); + if (update_host) { + update_used_event(); } } - void db_used() { + void update_used_event() { // only let the host know about our used idx in case irq are enabled if (_avail->interrupt_on()) { set_used_event(_used_ring_host_head, std::memory_order_release); -- GitLab