Is it possible to limit data traffic in kernel USB drivers?

276 views Asked by At

I am working with a device based on Linux version 2.6.32 This device includes a lte module communicating with device processor via USB.

I am running heavy tcp/udp bi-directional iperf traffic between a remote device in lte network and a PC connected to my device via Ethernet or USB.

The CPU of the device reaches 100%. irq + sirq reach more than 90%. Because the device is busy with data all the time, there is almost no chance for any of the running tasks to get CPU time.

After some time, between a couple of minutes and several hours, iperf get stuck and the traffic is stopped. The problem mainly happens when the PC is connected to the device via USB rather than Ethernet. And also when using TCP traffic rather than UDP.

I tried several things to limit the traffic or improve behavior including:

  • tc (traffic control application)
  • set CONFIG_MUSB_PIO_ONLY in kernel
  • ethtool, but it is not supported by the hardware

None of them gave significant results.

My current investigation is to make changes in the code of the kernel USB drivers in order to limit the traffic and free resources. The approach would be to discard packets when a given criteria happens: i.e. CPU or number of interrupts reaches a given threshold.

The changes would be done either in the standard USB driver used

  • for communication with lte module in kernel/drivers/usb/host
  • for communication with PC in kernel/drivers/net/usb

Does this option seem feasible? I have very few knowledge in kernel USB drivers and I would appreciate any help or recommendation how to proceed.

0

There are 0 answers