This is an automated email from the ASF dual-hosted git repository. xiaoxiang781216 pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/nuttx.git
commit 9e491fdc89bfb6b2fa3fd50317842757d703785e Author: zhanghongyu <[email protected]> AuthorDate: Fri Apr 10 18:35:56 2026 +0800 net/netdev: fix tx error handling in upper half driver. When the packet is too long, return NETDEV_TX_CONTINUE instead of -EMSGSIZE to allow the tx poll to continue processing. When lower half transmit fails while quota is not exhausted, set txdone flag to ensure subsequent packet transmissions can be triggered through the txdone process. Signed-off-by: zhanghongyu <[email protected]> --- drivers/net/netdev_upperhalf.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/drivers/net/netdev_upperhalf.c b/drivers/net/netdev_upperhalf.c index cc4c7193e41..d92e68e6e90 100644 --- a/drivers/net/netdev_upperhalf.c +++ b/drivers/net/netdev_upperhalf.c @@ -322,7 +322,7 @@ static int netdev_upper_txpoll(FAR struct net_driver_s *dev) if (netpkt_getdatalen(lower, pkt) > NETDEV_PKTSIZE(dev)) { nerr("ERROR: Packet too long to send!\n"); - ret = -EMSGSIZE; + ret = NETDEV_TX_CONTINUE; } else { @@ -338,6 +338,13 @@ static int netdev_upper_txpoll(FAR struct net_driver_s *dev) NETDEV_TXERRORS(dev); nerr("ERROR: Transmit failed: %d\n", ret); netpkt_put(dev, pkt, NETPKT_TX); + + /* When the quota is not 0, lower half may also return a failure, + * in which case the txdone process is required to trigger subsequent + * packet transmissions. + */ + + lower->txdone = true; return ret; }
