Re: usb: dwc3: gadget performance insight

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Apr 16, 2024, Grossman, Jake wrote:
> Hello,
> 
>  
> 
> We’re trying to operate a USB gadget backed by the DWC3 core on an iMX8
> processor, but we are seeing issues with performance.
> 
>  
> 
> As a comparison, utilizing iperf3 to benchmark, we are able to see ~230Mbit/s
> with an RNDIS gadget, and ~900Mbit/s with a hardware USB-to-Ethernet
> peripheral.
> 

What is "a hardware USB-to-Ethernet peripheral"? Does it use the same
RNDIS function driver and the same kernel version? If not, you're
comparing 2 very different things. Also, I assume that you're testing
against the same host.

>  
> 
> Looking at the output of perf, we are seeing that with all of the gadget
> drivers (RNDIS, UVC, ACM), there is significant time spent spinning in an IRQ
> context that does not occur with the hardware peripheral. This seems like it
> might be related to the interrupt handler as described here: https://
> docs.kernel.org/usb/dwc3.html.
> 
>  
> 
>  1. We have not yet acquired technical documentation regarding the DWC3
>     module.  Do you have a list of the DWC3 commands that have high latency
>     (~1ms)?
>  2. Do you believe that implementing a per endpoint IRQ framework will resolve
>     the large disparity in performance?  If not, do you have any insight into
>     what the root cause might be?
> 

I'm not familiar with RNDIS. However, my suspicion is that RNDIS
transfers are small, and they may not take advantage of USB burst. Or
perhaps your platform doesn't setup the TxFIFO size for performance? On
a side note, isn't RNDIS getting outdated?

We can achieve close to theoretical USB speeds with the current dwc3
controller driver even on an FPGA platform. There are many factors
contributing to performance. You'd need to review the tracepoints and
perhaps through USB packets using some USB sniffer/analyzer to see what
the bottleneck is. I doubt that it's related to DWC3 commands. More
likely than not implementing per endpoint IRQ will make the performance
even worse (is your dwc3 controller even configured for multiple
interrupters? Somehow I doubt that's the case)

BR,
Thinh




[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux