aboutsummaryrefslogtreecommitdiffstats
path: root/src/vnet/devices/virtio
diff options
context:
space:
mode:
authorDamjan Marion <damarion@cisco.com>2019-02-09 23:29:26 +0100
committerDamjan Marion <damarion@cisco.com>2019-02-09 23:29:26 +0100
commit8934a04596d1421c35b194949b2027ca1fe71aef (patch)
tree9506a0f986a04112bcdae86a06834cc571c13841 /src/vnet/devices/virtio
parent54a51fd5869c3451096e6512a927ff864855a24f (diff)
buffers: fix typo
Change-Id: I4e836244409c98739a13092ee252542a2c5fe259 Signed-off-by: Damjan Marion <damarion@cisco.com>
Diffstat (limited to 'src/vnet/devices/virtio')
-rw-r--r--src/vnet/devices/virtio/node.c2
-rw-r--r--src/vnet/devices/virtio/vhost_user_input.c7
2 files changed, 4 insertions, 5 deletions
diff --git a/src/vnet/devices/virtio/node.c b/src/vnet/devices/virtio/node.c
index fc369e5aea9..6b82c418ffb 100644
--- a/src/vnet/devices/virtio/node.c
+++ b/src/vnet/devices/virtio/node.c
@@ -120,7 +120,7 @@ more:
((vif->type == VIRTIO_IF_TYPE_PCI) ? vlib_buffer_get_current_pa (vm,
b) :
pointer_to_uword (vlib_buffer_get_current (b)));
- d->len = vlib_bufer_get_default_size (vm) + hdr_sz;
+ d->len = vlib_buffer_get_default_data_size (vm) + hdr_sz;
d->flags = VRING_DESC_F_WRITE;
vring->avail->ring[avail & mask] = next;
avail++;
diff --git a/src/vnet/devices/virtio/vhost_user_input.c b/src/vnet/devices/virtio/vhost_user_input.c
index 465ec4462a8..3c3d48e9ef4 100644
--- a/src/vnet/devices/virtio/vhost_user_input.c
+++ b/src/vnet/devices/virtio/vhost_user_input.c
@@ -258,6 +258,7 @@ vhost_user_if_input (vlib_main_t * vm,
u32 n_left_to_next, *to_next;
u32 next_index = VNET_DEVICE_INPUT_NEXT_ETHERNET_INPUT;
u32 n_trace = vlib_get_trace_count (vm, node);
+ u32 buffer_data_size = vlib_buffer_get_default_data_size (vm);
u32 map_hint = 0;
vhost_cpu_t *cpu = &vum->cpus[vm->thread_index];
u16 copy_len = 0;
@@ -500,8 +501,7 @@ vhost_user_if_input (vlib_main_t * vm,
}
/* Get more output if necessary. Or end of packet. */
- if (PREDICT_FALSE
- (b_current->current_length == vlib_bufer_get_default_size (vm)))
+ if (PREDICT_FALSE (b_current->current_length == buffer_data_size))
{
if (PREDICT_FALSE (cpu->rx_buffers_len == 0))
{
@@ -534,8 +534,7 @@ vhost_user_if_input (vlib_main_t * vm,
vhost_copy_t *cpy = &cpu->copy[copy_len];
copy_len++;
u32 desc_data_l = desc_table[desc_current].len - desc_data_offset;
- cpy->len =
- vlib_bufer_get_default_size (vm) - b_current->current_length;
+ cpy->len = buffer_data_size - b_current->current_length;
cpy->len = (cpy->len > desc_data_l) ? desc_data_l : cpy->len;
cpy->dst = (uword) (vlib_buffer_get_current (b_current) +
b_current->current_length);