mirror of
https://github.com/apache/nuttx.git
synced 2026-06-07 09:18:00 +08:00
arch/sim: calling txdone callback after devif_loopback in netdriver
When devif_loopback handles a packet (like a ping targeting at this dev), it does not call the txdone callback, breaking the tx pipeline and may left some packets unhandled, delayed until next transmit on the network interface. Signed-off-by: Zhe Weng <wengzhe@xiaomi.com>
This commit is contained in:
@@ -72,6 +72,12 @@
|
||||
|
||||
#include "up_internal.h"
|
||||
|
||||
/****************************************************************************
|
||||
* Private Function Prototypes
|
||||
****************************************************************************/
|
||||
|
||||
static void netdriver_txdone_interrupt(void *priv);
|
||||
|
||||
/****************************************************************************
|
||||
* Private Data
|
||||
****************************************************************************/
|
||||
@@ -290,6 +296,17 @@ static int netdriver_txpoll(struct net_driver_s *dev)
|
||||
netdev_send(devidx, dev->d_buf, dev->d_len);
|
||||
NETDEV_TXDONE(dev);
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Calling txdone callback after loopback. NETDEV_TXDONE macro is
|
||||
* already called in devif_loopback.
|
||||
*
|
||||
* TODO: Maybe a unified interface with txdone callback registered
|
||||
* is needed, then we can let devif_loopback call this callback.
|
||||
*/
|
||||
|
||||
netdriver_txdone_interrupt(dev);
|
||||
}
|
||||
}
|
||||
|
||||
/* If zero is returned, the polling will continue until all connections
|
||||
|
||||
Reference in New Issue
Block a user