virtio/net: Try fix virtnet logic

Signed-off-by: Zhe Weng <wengzhe@xiaomi.com>
This commit is contained in:
Zhe Weng 2023-01-08 17:39:22 +08:00 committed by Masayuki Ishikawa
parent 6214f3cde7
commit 5e42bd97cd
1 changed files with 5 additions and 4 deletions

View File

@ -435,11 +435,9 @@ static int virtnet_txpoll(FAR struct net_driver_s *dev)
virtnet_reply(priv);
/* If zero is returned, the polling will continue until all connections
* have been examined.
*/
/* Stop the poll now because we only have one tx buffer (g_pktbuf) */
return 0;
return -EBUSY;
}
/****************************************************************************
@ -591,6 +589,7 @@ static void virtnet_rxdispatch(FAR struct virtnet_driver_s *priv)
static void virtnet_receive(FAR struct virtnet_driver_s *priv)
{
FAR uint8_t *buf = priv->vnet_dev.d_buf;
uint16_t used = priv->rxq->used->idx;
uint16_t idx;
@ -632,6 +631,8 @@ static void virtnet_receive(FAR struct virtnet_driver_s *priv)
priv->rxq->last_used_idx = used;
vrtinfo("+++ rxq->last_used_idx=%d\n", priv->rxq->last_used_idx);
priv->vnet_dev.d_buf = buf;
}
/****************************************************************************