Skip to content
Snippets Groups Projects
Commit 7f3fc780 authored by Vlad Zolotarov's avatar Vlad Zolotarov Committed by Avi Kivity
Browse files

virtio::net::txq: Fix the bug causing the false asserts


vec_sz in net::txq::try_xmit_one_locked(net_req*) should be initialized to 1 and not to 0
since there is always net_hdr element and vec_sz is incremented only for fragments not taking
into an account the header element.

This miscalculation caused vqueue->add_buf() return false while vqueue->avail_ring_has_room(vec_sz)
was returning true when the amount of elements in the avail ring was equal to vec_sz
since the actual size of the _sg_vec was "vec_sz + 1".

Signed-off-by: default avatarVlad Zolotarov <vladz@cloudius-systems.com>
Signed-off-by: default avatarAvi Kivity <avi@cloudius-systems.com>
parent 5df56084
No related branches found
No related tags found
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment