virtio/net: Try fix virtnet logic
Signed-off-by: Zhe Weng <wengzhe@xiaomi.com>
This commit is contained in:
parent
6214f3cde7
commit
5e42bd97cd
|
@ -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;
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
|
|
Loading…
Reference in New Issue