From a2c1951e56d94de573db6c6f13e3642df953b7e7 Mon Sep 17 00:00:00 2001 From: Benoît Ganne Date: Fri, 24 Jan 2020 18:06:01 +0100 Subject: devices: vhost: fix data offset on input MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Regardless of whether the virtio_net_hdr is sent as a separate descriptors or in the same descriptor as the data, we always want to skip the header length - maybe moving to the next descriptor along the way. Type: fix Change-Id: Iaa70aeb310e589639b20f8c7029aaa8d3ce5d307 Signed-off-by: Benoît Ganne (cherry picked from commit 5ecc1e4d433a34845c7bfd761dc990413e6c321b) --- src/vnet/devices/virtio/vhost_user_input.c | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) (limited to 'src/vnet') diff --git a/src/vnet/devices/virtio/vhost_user_input.c b/src/vnet/devices/virtio/vhost_user_input.c index 11d45812e39..1c3e1806cb5 100644 --- a/src/vnet/devices/virtio/vhost_user_input.c +++ b/src/vnet/devices/virtio/vhost_user_input.c @@ -559,17 +559,7 @@ vhost_user_if_input (vlib_main_t * vm, } } - if (PREDICT_TRUE (vui->is_any_layout) || - (!(desc_table[desc_current].flags & VIRTQ_DESC_F_NEXT))) - { - /* ANYLAYOUT or single buffer */ - desc_data_offset = vui->virtio_net_hdr_sz; - } - else - { - /* CSR case without ANYLAYOUT, skip 1st buffer */ - desc_data_offset = desc_table[desc_current].len; - } + desc_data_offset = vui->virtio_net_hdr_sz; if (enable_csum) { -- cgit 1.2.3-korg