Skip to content

Commit

Permalink
devices: vhost: fix data offset on input
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
bganne authored and dmarion committed Jan 27, 2020
1 parent 864872a commit 5ecc1e4
Showing 1 changed file with 1 addition and 11 deletions.
12 changes: 1 addition & 11 deletions src/vnet/devices/virtio/vhost_user_input.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down

0 comments on commit 5ecc1e4

Please sign in to comment.