dirivers: virtio: Fix virtnet_transmit() in virtio-mmio-net.c

Summary:
- I noticed that the driver sends incorrect packets sometimes.
- This commit fixes this issue.

Impact:
- None

Testing:
- Tested with qemu-7.1

Signed-off-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>
This commit is contained in:
Masayuki Ishikawa 2023-06-01 11:50:54 +09:00 committed by Xiang Xiao
parent b63b83396b
commit 6b35a49f6e
1 changed files with 8 additions and 0 deletions

View File

@ -394,6 +394,14 @@ static int virtnet_transmit(FAR struct virtnet_driver_s *priv)
wd_start(&priv->vnet_txtimeout, VIRTNET_TXTIMEOUT,
virtnet_txtimeout_expiry, (wdparm_t)priv);
/* Wait for completion */
while (priv->txq->avail->idx != priv->txq->used->idx)
{
virtio_mb();
}
return OK;
}