anchao opened a new pull request, #21026:
URL: https://github.com/apache/nuttx/pull/21026

   ## Summary                                                                   
                                                                                
                           
                                                                                
                                                                                
                           
   This PR improves several common data paths by reducing per-byte or 
unnecessary wrapper overhead:                                                   
                                     
                                                                                
                                                                                
                           
   - copy USB host serial RX data into UART RX rings in chunks                  
                                                                                
                           
   - bypass vector I/O setup for scalar VFS read/write operations               
                                                                                
                           
   - copy UART RX ring data to userspace in chunks for raw serial reads         
                                                                                
                           
                                                                                
                                                                                
                           
   ## Details                                                                   
                                                                                
                           
                                                                                
                                                                                
                           
   ### USB host serial RX                                                       
                                                                                
                           
                                                                                
                                                                                
                           
   The CDC ACM and FT232R USB host drivers previously copied received USB bulk 
IN data into the UART RX ring one byte at a time.                               
                            
                                                                                
                                                                                
                           
   This change copies each contiguous UART RX ring segment with `memcpy()` 
instead, while preserving:                                                      
                                
                                                                                
                                                                                
                           
   - the one-empty-slot ring buffer full/empty rule                             
                                                                                
                           
   - CDC ACM packet accounting                                                  
                                                                                
                           
   - FT232R status-byte handling                                                
                                                                                
                           
   - existing `uart_datareceived()` notification behavior                       
                                                                                
                           
                                                                                
                                                                                
                           
   This reduces loop and branch overhead when larger USB serial packets are 
received.                                                                       
                               
                                                                                
                                                                                
                           
   ### VFS scalar read/write fast path                                          
                                                                                
                           
                                                                                
                                                                                
                           
   With `CONFIG_FS_UIO` enabled, `file_read()` and `file_write()` previously 
built a single-entry `iovec` and routed through `file_readv()` / 
`file_writev()`.                             
                                                                                
                                                                                
                           
   This change lets scalar read/write calls use the plain file operation 
directly when available, while keeping the vector I/O fallback for drivers that 
only implement `readv` / `writev`.
                                                                                
                                                                                
                           
   This avoids unnecessary `iovec` setup and `uio` initialization on the common 
scalar I/O path.                                                                
                           
                                                                                
                                                                                
                           
   ### UART raw RX reads                                                        
                                                                                
                           
                                                                                
                                                                                
                           
   `uart_readv()` previously copied received data from the UART RX ring one 
byte at a time.                                                                 
                               
                                                                                
                                                                                
                           
   This change adds a raw-input fast path that copies contiguous RX ring 
segments with `uio_copyfrom()` when no input translation, canonical processing, 
or echo handling is enabled.      
                                                                                
                                                                                
                           
   The original per-byte path is still used for:                                
                                                                                
                           
                                                                                
                                                                                
                           
   - CR/LF input translation                                                    
                                                                                
                           
   - canonical mode                                                             
                                                                                
                           
   - echo handling                                                              
                                                                                
                           
   - escape sequence tracking                                                   
                                                                                
                           
                                                                                
                                                                                
                           
   ## Testing                                                                   
                                                                                
                           
   
   sim/usbdev


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