X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=src%2Fvnet%2Fdevices%2Fvirtio%2Fvhost_user_input.c;h=286fa7ed744117a4e65fe87854aba358c7bd17d0;hb=47727c02df4c79c21c6ceffaff65222c32cf6996;hp=812f9d3f6ab4e8e1cbcb9b6768827427b1af0e81;hpb=671e60e65635b8d030bf303c88411192c747b59e;p=vpp.git diff --git a/src/vnet/devices/virtio/vhost_user_input.c b/src/vnet/devices/virtio/vhost_user_input.c index 812f9d3f6ab..286fa7ed744 100644 --- a/src/vnet/devices/virtio/vhost_user_input.c +++ b/src/vnet/devices/virtio/vhost_user_input.c @@ -65,7 +65,7 @@ */ #define VHOST_USER_RX_COPY_THRESHOLD 64 -vlib_node_registration_t vhost_user_input_node; +extern vlib_node_registration_t vhost_user_input_node; #define foreach_vhost_user_input_func_error \ _(NO_ERROR, "no error") \ @@ -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_BUFFER_DATA_SIZE)) + if (PREDICT_FALSE (b_current->current_length == buffer_data_size)) { if (PREDICT_FALSE (cpu->rx_buffers_len == 0)) { @@ -534,7 +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_BUFFER_DATA_SIZE - 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);