vhost: simplify async enqueue completion
authorMaxime Coquelin <maxime.coquelin@redhat.com>
Tue, 26 Oct 2021 16:28:59 +0000 (18:28 +0200)
committerMaxime Coquelin <maxime.coquelin@redhat.com>
Fri, 29 Oct 2021 10:32:30 +0000 (12:32 +0200)
commita3cfa8081f65339b356591036ed25a510098a901
tree2c631a222dbe3eaa01f51d29a913adcec94d07dc
parent2cbe826e264742801ffe05fb52cfa2e38a16081b
vhost: simplify async enqueue completion

vhost_poll_enqueue_completed() assumes some inflight
packets could have been completed in a previous call but
not returned to the application. But this is not the case,
since check_completed_copies callback is never called with
more than the current count as argument.

In other words, async->last_pkts_n is always 0. Removing it
greatly simplifies the function.

Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Reviewed-by: Jiayu Hu <jiayu.hu@intel.com>
lib/vhost/vhost.h
lib/vhost/virtio_net.c