Sarthak-Pandey commented on code in PR #20622:
URL: https://github.com/apache/nuttx/pull/20622#discussion_r4258328143


##########
drivers/net/netdev_upperhalf.c:
##########
@@ -882,7 +883,17 @@ static inline void netdev_upper_queue_work(FAR struct 
net_driver_s *dev)
 
 static int netdev_upper_txavail(FAR struct net_driver_s *dev)
 {
-  netdev_upper_txavail_work(dev->d_private);
+  FAR struct netdev_upperhalf_s *upper = dev->d_private;
+
+  if (upper->lower->rxtype == NETDEV_RX_DIRECT)
+    {
+      netdev_upper_txavail_work(upper);
+    }
+  else
+    {
+      netdev_upper_queue_work(dev);
+    }
+

Review Comment:
   "Thanks @raiden00pl! That makes complete sense — using nxrmutex_trylock 
ensures we transmit immediately when the lock is free or held by the current 
thread to prevent txq overflow, while still avoiding the ABBA deadlock when the 
peer thread holds the lock. Applied the suggested change!"



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to