vhost-user: simplify input loop
@@ -382,8 +382,6 @@ vhost_user_if_input (vlib_main_t * vm,
&next_index, 0);
}
- while (n_left > 0)
- {
vlib_get_new_next_frame (vm, node, next_index, to_next, n_left_to_next);
if (next_index == VNET_DEVICE_INPUT_NEXT_ETHERNET_INPUT)
@@ -401,7 +399,7 @@ vhost_user_if_input (vlib_main_t * vm,
ef->hw_if_index = vui->hw_if_index;
}
- while (n_left > 0 && n_left_to_next > 0)
+ while (n_left > 0)
{
vlib_buffer_t *b_head, *b_current;
u32 bi_current;
@@ -419,8 +417,7 @@ vhost_user_if_input (vlib_main_t * vm,
break;
}
- desc_current =
- txvq->avail->ring[txvq->last_avail_idx & txvq->qsz_mask];
+ desc_current = txvq->avail->ring[txvq->last_avail_idx & txvq->qsz_mask];
cpu->rx_buffers_len--;
bi_current = cpu->rx_buffers[cpu->rx_buffers_len];
b_head = b_current = vlib_get_buffer (vm, bi_current);
@@ -436,8 +433,7 @@ vhost_user_if_input (vlib_main_t * vm,
desc_current;
txvq->used->ring[txvq->last_used_idx & txvq->qsz_mask].len = 0;
vhost_user_log_dirty_ring (vui, txvq,
- ring[txvq->last_used_idx &
- txvq->qsz_mask]);
+ ring[txvq->last_used_idx & txvq->qsz_mask]);
/* The buffer should already be initialized */
b_head->total_length_not_including_first_buffer = 0;
@@ -534,8 +530,7 @@ vhost_user_if_input (vlib_main_t * vm,
/* Prepare a copy order executed later for the data */
vhost_copy_t *cpy = &cpu->copy[copy_len];
copy_len++;
- u32 desc_data_l =
- desc_table[desc_current].len - desc_data_offset;
+ u32 desc_data_l = desc_table[desc_current].len - desc_data_offset;
cpy->len = VLIB_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) +
@@ -549,7 +544,6 @@ vhost_user_if_input (vlib_main_t * vm,
}
out:
- CLIB_PREFETCH (&n_left, sizeof (n_left), LOAD);
n_rx_bytes += b_head->total_length_not_including_first_buffer;
n_rx_packets++;
@@ -598,7 +592,6 @@ vhost_user_if_input (vlib_main_t * vm,
}
stop:
vlib_put_next_frame (vm, node, next_index, n_left_to_next);
- }
/* Do the memory copies */
if (PREDICT_FALSE (vhost_user_input_copy (vui, cpu->copy, copy_len,
