In our company we have a custom board using Cyclone V 5CSEBA2U19C8SN and USB 3300. We use Linux 4.1.15, build it with Buildroot 2015.11.1. One of my tasks is to setup USB Gadget subsystem. I use combination of FunctionFS and ConfigFS to create a configuration with two bulk endpoints (in and out). It works, but I noticed that while bulk out (host to device) transfers at 20MB/s, bulk in (device to host) transfers at 10MB/s only. I tried mass storage gadget (g_mass_storage, alone, not in combination with my configuration) and got the same results: host to device at 20MB/s, device to host at 10MB/s. It seems odd to me that reading would be 50% slower than writing, I would expect these two at approximately the same speed. Is this normal? Why? If not, what steps should I take to find the cause?
Hi,It's a bit difficult problem. I think that you are probably using the OTG core of the SoC system, but there are various kinds of buffering in the Linux system. Therefore, if you write data to these buffers, you can postpone later processing that takes time, but in case of reading, you need to prepare the data to be transferred. This preparation time may be one of the reasons for lowering the transfer rate. Although it may not be easy, but using the kernel profiler (OProfile?) is one method to watch the kernel process. Kazu