diff options
author | Benoît Ganne <bganne@cisco.com> | 2020-01-24 18:06:01 +0100 |
---|---|---|
committer | Dave Barach <openvpp@barachs.net> | 2020-01-29 17:27:21 +0000 |
commit | 0d40954b42519994b6b8ae1769d7a628d5f839fb (patch) | |
tree | 6d784a0e8eaf4bc96428464dc03abd173d4672d8 | |
parent | 95993c64a375887120466d750c750a27861fca96 (diff) |
devices: vhost: fix data offset on input
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 <bganne@cisco.com>
(cherry picked from commit 5ecc1e4d433a34845c7bfd761dc990413e6c321b)
-rw-r--r-- | src/vnet/devices/virtio/vhost_user_input.c | 12 |
1 files changed, 1 insertions, 11 deletions
diff --git a/src/vnet/devices/virtio/vhost_user_input.c b/src/vnet/devices/virtio/vhost_user_input.c index ef35d23a03c..ee02b3b86ee 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) { |