diff options
author | Mohsin Kazmi <sykazmi@cisco.com> | 2022-02-01 18:35:59 +0000 |
---|---|---|
committer | Damjan Marion <dmarion@me.com> | 2022-03-01 16:08:11 +0000 |
commit | 0f8912f0d6af49ec8093e3c478b48767a00b3710 (patch) | |
tree | c919de059799fb89029f470c96b81cffa9dacec3 /src/vnet/devices/virtio/virtio_inline.h | |
parent | 855ad3373ee9257ce7c917b90c638bd2f8a76da4 (diff) |
virtio: refactor code
Type: refactor
Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
Change-Id: I3788cc857023fafcc8eb6d6ff4524425026a75d8
Diffstat (limited to 'src/vnet/devices/virtio/virtio_inline.h')
-rw-r--r-- | src/vnet/devices/virtio/virtio_inline.h | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/src/vnet/devices/virtio/virtio_inline.h b/src/vnet/devices/virtio/virtio_inline.h index 209817d48c7..179f319aa4c 100644 --- a/src/vnet/devices/virtio/virtio_inline.h +++ b/src/vnet/devices/virtio/virtio_inline.h @@ -29,11 +29,11 @@ typedef enum static_always_inline void virtio_refill_vring_split (vlib_main_t *vm, virtio_if_t *vif, - virtio_if_type_t type, virtio_vring_t *vring, + virtio_if_type_t type, vnet_virtio_vring_t *vring, const int hdr_sz, u32 node_index) { u16 used, next, avail, n_slots, n_refill; - u16 sz = vring->size; + u16 sz = vring->queue_size; u16 mask = sz - 1; more: @@ -47,8 +47,9 @@ more: next = vring->desc_next; avail = vring->avail->idx; - n_slots = vlib_buffer_alloc_to_ring_from_pool ( - vm, vring->buffers, next, vring->size, n_refill, vring->buffer_pool_index); + n_slots = vlib_buffer_alloc_to_ring_from_pool (vm, vring->buffers, next, + vring->queue_size, n_refill, + vring->buffer_pool_index); if (PREDICT_FALSE (n_slots != n_refill)) { @@ -60,7 +61,7 @@ more: while (n_slots) { - vring_desc_t *d = &vring->desc[next]; + vnet_virtio_vring_desc_t *d = &vring->desc[next]; ; vlib_buffer_t *b = vlib_get_buffer (vm, vring->buffers[next]); /* @@ -94,11 +95,11 @@ more: static_always_inline void virtio_refill_vring_packed (vlib_main_t *vm, virtio_if_t *vif, - virtio_if_type_t type, virtio_vring_t *vring, + virtio_if_type_t type, vnet_virtio_vring_t *vring, const int hdr_sz, u32 node_index) { u16 used, next, n_slots, n_refill, flags = 0, first_desc_flags; - u16 sz = vring->size; + u16 sz = vring->queue_size; more: used = vring->desc_in_use; @@ -124,7 +125,7 @@ more: while (n_slots) { - vring_packed_desc_t *d = &vring->packed_desc[next]; + vnet_virtio_vring_packed_desc_t *d = &vring->packed_desc[next]; vlib_buffer_t *b = vlib_get_buffer (vm, vring->buffers[next]); /* * current_data may not be initialized with 0 and may contain |