raiden00pl commented on PR #21931:
URL: https://github.com/apache/nuttx/pull/21931#issuecomment-7083672988

    @zhhyu7 @xiaoxiang781216 @GUIDINGLI 
    
    
     This change causes an RX regression on non-VLAN traffic, and #22039 does 
not
     restore the previous behaviour.
   
     Before this PR netdev_upper_rxpoll_work() held netdev_lock() around the 
whole
     receive loop. Now (after #22039) the lock is taken and released once per
     frame:
     
           netdev_lock(dev);
           netpkt_put(dev, pkt, NETPKT_RX);
           netdev_upper_input(dev);
           netdev_unlock(dev);
     
     so the RX work competes for the lock with the TX path on every frame and
     falls behind the device.
     
     Observed on qemu-intel64 (SMP):
   
     - e1000, TCP from NuttX to the host (iperf): about 25 Mbit/s, was about
       1000 Mbit/s.
     - kvaser_pci (SJA1000) SocketCAN: with three concurrent ISO-TP transfers 
the
       controller RX FIFO overruns, a consecutive frame is lost and read() on 
the
       ISO-TP socket fails with EILSEQ.
   
     With the lock held around the whole loop again, and released only around 
the
     VLAN dispatch, both are back to normal:
     
       netdev_lock(dev);
       while ((pkt = lower->ops->receive(lower)) != NULL)
         {
           ...
           netpkt_put(dev, pkt, NETPKT_RX);
           netdev_upper_input(dev);
         }
     
       netdev_unlock(dev);
   


-- 
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