# Low USB3 speed

**URL:** <https://forum.openwrt.org/t/low-usb3-speed/174044>\
**Category:** For Developers\
**Created:** [October 11, 2023, 9:43am UTC](https://forum.openwrt.org/t/low-usb3-speed/174044 "2023-10-11T09:43:11Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![mespersen](https://forum.openwrt.org/letter_avatar/mespersen/32/6_449c533f586939b6e5f246632a46421f.png) [@mespersen](https://forum.openwrt.org/u/mespersen)\
**Post date:** [October 11, 2023, 9:43am UTC](https://forum.openwrt.org/t/low-usb3-speed/174044/1 "2023-10-11T09:43:11Z")

</div>

Hi,  
We testing a Quectel (RM520N-GL) modem on a Habanero (IPQ40XX) module using the USB3 interface the Max speed we have seen is 250Mbs on this combination. When we move the modem to a raspberryPi we get more than 800Mbs (also running OpenWrt). Any thoughts are appreciated?  
The usages of the used CPU is 100% during this speedtest. IPQ40XX has 4 CPUs  
The network is not an issue and the modem have a proven throughput of more than 1.2Gbs.  
Our thoughts are USB3 driver is not configured properly like buffersizes, DMA etc. but it not clear how to configure this. OpenWrt version 23-05-RC3

---

<div class="post-metadata">

**Author:** ![frollic](https://forum.openwrt.org/user_avatar/forum.openwrt.org/frollic/32/30113_2.png) [@frollic](https://forum.openwrt.org/u/frollic)\
**Post date:** [October 11, 2023, 11:16am UTC](https://forum.openwrt.org/t/low-usb3-speed/174044/2 "2023-10-11T11:16:41Z")

</div>

> [@mespersen](#):
>
> The usages of the used CPU is 100% during this speedtest  
> Our thoughts are USB3 driver is not configured properly like buffersizes

My thought is you max out the CPU....

---

<div class="post-metadata">

**Author:** ![WarHawk8080](https://forum.openwrt.org/user_avatar/forum.openwrt.org/warhawk8080/32/82520_2.png) [@WarHawk8080](https://forum.openwrt.org/u/WarHawk8080)\
**Post date:** [October 11, 2023, 12:56pm UTC](https://forum.openwrt.org/t/low-usb3-speed/174044/3 "2023-10-11T12:56:24Z")

</div>

This thing?

> **[Habanero - 8devices](https://www.8devices.com/products/habanero)**
>
> 8devices is a company engaged in development, manufacturing and sales of unique design and functionality electronic equipment.

ARM Cortex-A7, quad-core ( **717 MHz** ) IPQ4019/IPQ4029

Might wanna read this

> [@So you have 500Mbps-1Gbps fiber and need a router READ THIS FIRST](https://forum.openwrt.org/t/so-you-have-500mbps-1gbps-fiber-and-need-a-router-read-this-first/90305):
>
> It's such a frequently asked question over the last few years that we really need a post we can point people to. So your cable company rolled out 500Mbps or 1Gbps download speeds, or you have 1Gbps symmetric fiber (GPON/EPON) from ATT or Centurylink or Orange or whoever. You realize your old all in one router from 2009 is not up to the task of handling this, but hey by now stuff should be cheap and available that will handle your new fiber connection right? So you want advice about a router for…

Is the RPi overclocked to 2Ghz?? If so...even though it's the same arm chip...it's clocked to 2-3x the speed

With that said...the data sheet is pretty daggum nice...even with a slow speed (was digging for a way to overclock??!??)  
[[https://drive.google.com/file/d/1R\_a1nTq\_a59-EuQpVAdg8PbLWRdOpyoe/view?pli=1](https://drive.google.com/file/d/1R_a1nTq_a59-EuQpVAdg8PbLWRdOpyoe/view?pli=1)]( 8DEV6000 HABANERO FEATURES spec sheet on google drive )

---

<div class="post-metadata">

**Author:** ![mespersen](https://forum.openwrt.org/letter_avatar/mespersen/32/6_449c533f586939b6e5f246632a46421f.png) [@mespersen](https://forum.openwrt.org/u/mespersen)\
**Post date:** [October 11, 2023, 2:09pm UTC](https://forum.openwrt.org/t/low-usb3-speed/174044/4 "2023-10-11T14:09:37Z")

</div>

Yes, I have the same and that's why I ask for DMA configuration, buffer size etc.

---

<div class="post-metadata">

**Author:** ![mespersen](https://forum.openwrt.org/letter_avatar/mespersen/32/6_449c533f586939b6e5f246632a46421f.png) [@mespersen](https://forum.openwrt.org/u/mespersen)\
**Post date:** [October 11, 2023, 2:19pm UTC](https://forum.openwrt.org/t/low-usb3-speed/174044/5 "2023-10-11T14:19:08Z")

</div>

No the RPi is clocked at 1.8Ghz and is only using 20% of the CPU. In my minds it does not make sense to add an USB3 interface if the HW does not support at least a better performance than USB2. This is why I would expect one of the three DMA controllers could do the job, but the default config in OpenWrt only enables the PIO control on the USB interfaces.

---

<div class="post-metadata">

**Author:** ![frollic](https://forum.openwrt.org/user_avatar/forum.openwrt.org/frollic/32/30113_2.png) [@frollic](https://forum.openwrt.org/u/frollic)\
**Post date:** [October 11, 2023, 2:32pm UTC](https://forum.openwrt.org/t/low-usb3-speed/174044/6 "2023-10-11T14:32:49Z")

</div>

Is this performance difference reproducable using some other Linux platform?

---

<div class="post-metadata">

**Author:** ![Dairyman](https://forum.openwrt.org/user_avatar/forum.openwrt.org/dairyman/32/71285_2.png) [@Dairyman](https://forum.openwrt.org/u/Dairyman)\
**Post date:** [October 12, 2023, 3:39pm UTC](https://forum.openwrt.org/t/low-usb3-speed/174044/7 "2023-10-12T15:39:50Z")

</div>

Yes it is.

We see this constantly in ROOter with MT7621 routers and now in the MT7981 as well.

ROOter use the completely standard OpenWrt USB packages without any changes yet we have 5G modems that top out at 250-300 Mbps with MT7621 and 500 Mbps with the MT7981. This is with modems and connections that should be producing over 800 Mbps.

We seem to have tracked this down to the USB system as the same modem and connection in a M.2 to Ethernet adapter will give the higher speeds. Put it in the USB based M.2 interface and you get the lower speeds.

The other thing that we see is that the factory firmware will give the higher speeds as well on different routers using the MT7621 or MT7981 chips set. These firmware are mostly based on a hacked up version of 17.01 with the MT7981 using 21.02. In some cases they will give speeds twice as fast.

I have been told that 19.07 will give the higher speeds but have yet to have that confirmed. It appears that something in the USB system was changed after 17.01 (or possibly 19.07) but none of the people that are involved in tracking this down have a clue what it is.

But it is a real problem that appears on different chip sets when high speed 5G modems that use the USB system are present.

---

<div class="post-metadata">

**Author:** ![abidarwish](https://forum.openwrt.org/user_avatar/forum.openwrt.org/abidarwish/32/85920_2.png) [@abidarwish](https://forum.openwrt.org/u/abidarwish)\
**Post date:** [December 1, 2023, 3:52am UTC](https://forum.openwrt.org/t/low-usb3-speed/174044/8 "2023-12-01T03:52:51Z")

</div>

> [@mespersen](#):
>
> Hi,  
> We testing a Quectel (RM520N-GL) modem on a Habanero (IPQ40XX) module using the USB3 interface the Max speed we have seen is 250Mbs on this combination. When we move the modem to a raspberryPi we get more than 800Mbs (also running OpenWrt). Any thoughts are appreciated?  
> The usages of the used CPU is 100% during this speedtest. IPQ40XX has 4 CPUs  
> The network is not an issue and the modem have a proven throughput of more than 1.2Gbs.  
> Our thoughts are USB3 driver is not configured properly like buffersizes, DMA etc. but it not clear how to configure this. OpenWrt version 23-05-RC3

We are facing this issue in Arcadyan AW1000 also which uses IPQ807x soc.

We can see through htop, every time we run ookla speedtest, the core0 will spike to 100% meanwhile the other 3 cores are like doing nothing which we believe what causes the bottleneck. The speed can't go beyond 700mbps.

To check what processes are maxing out the core0, we looked at /proc/interrupts and found that xhci-hcd:usb3 is the culprit.

To verify this, we set the irq of xhci-hcd:usb3 to run in the other cores, for exampe, core1 as so:

```plaintext
echo 2 > "/proc/irq/$(grep usb3 /proc/interrupts | awk -F: '{print $1}' | sed 's/^ //')/smp_affinity"

```

Indeed, core1 maxes out to 100% of usage each time we run ookla speedtest. Interestingly, even if we echo f in the command above which means to be run in all cores, xhci-hcd:usb3 still running in only 1 core.

In conclusion, we believe that the usb3 driver (we are not sure if this is the right term) doesn't support multithreading which causes the speed being capped below 700mbps.

As a workaround, we write this script to increase the speed until somebody can fix the usb3 driver at the kernel level.

```plaintext
#!/bin/sh
#script by Abi Darwish

INTERRUPT=$(ls /proc/irq/ | sed '/default/d')
USB3_NUMBER=$(grep usb3 /proc/interrupts | awk -F: '{print $1}' | sed 's/^ //')

for I in ${INTERRUPT}; do
	if [[${I} = ${USB3_NUMBER}]]; then
        	echo 2 > /proc/irq/${I}/smp_affinity 2>/dev/null
        else
        	echo 1 > /proc/irq/${I}/smp_affinity 2>/dev/null
        fi
        printf "%-10s" ${I}:
        cat /proc/irq/${I}/smp_affinity
done

```

---

<div class="post-metadata">

**Author:** ![suyuan168](https://forum.openwrt.org/user_avatar/forum.openwrt.org/suyuan168/32/11796_2.png) [@suyuan168](https://forum.openwrt.org/u/suyuan168)\
**Post date:** [December 1, 2023, 8:20am UTC](https://forum.openwrt.org/t/low-usb3-speed/174044/9 "2023-12-01T08:20:41Z")

</div>

This is the fact. I have also encountered low performance problems using the 301W ipq8072a. especially usb3

> [@Ipq8072a VS MT7986A Speed performance comparison](https://forum.openwrt.org/t/ipq8072a-vs-mt7986a-speed-performance-comparison/178154/10):
>
> + & no parallel processing all these tests are with QCA ECM etc that are community builds + [image] yes mediatek are much more open but qualcomm has a "secret sauce" that is not opensource!

---

<div class="post-metadata">

**Author:** ![robimarko](https://forum.openwrt.org/user_avatar/forum.openwrt.org/robimarko/32/617_2.png) [@robimarko](https://forum.openwrt.org/u/robimarko)\
**Post date:** [December 5, 2023, 12:22pm UTC](https://forum.openwrt.org/t/low-usb3-speed/174044/16 "2023-12-05T12:22:56Z")

</div>

Sorry, but this community doesn't work like this, if you have a solution please share it, otherwise there is no need to even advertise you have it.

---

<div class="post-metadata">

**Author:** ![frollic](https://forum.openwrt.org/user_avatar/forum.openwrt.org/frollic/32/30113_2.png) [@frollic](https://forum.openwrt.org/u/frollic)\
**Post date:** [December 5, 2023, 12:23pm UTC](https://forum.openwrt.org/t/low-usb3-speed/174044/17 "2023-12-05T12:23:59Z")

</div>

> [@robimarko](#):
>
> otherwise there is no need to even advertise you have it

flagged the posts, hopefully we'll get them removed.

---

<div class="post-metadata">

**Author:** ![IceG](https://forum.openwrt.org/user_avatar/forum.openwrt.org/iceg/32/133129_2.png) [@IceG](https://forum.openwrt.org/u/IceG)\
**Post date:** [December 5, 2023, 1:47pm UTC](https://forum.openwrt.org/t/low-usb3-speed/174044/18 "2023-12-05T13:47:55Z")

</div>

The USB script provided above does not solve the problem. At least in my case.

I hope that someone will come up with a solution to this problem and share it with the community.

---

<div class="post-metadata">

**Author:** ![abidarwish](https://forum.openwrt.org/user_avatar/forum.openwrt.org/abidarwish/32/85920_2.png) [@abidarwish](https://forum.openwrt.org/u/abidarwish)\
**Post date:** [December 8, 2023, 2:41am UTC](https://forum.openwrt.org/t/low-usb3-speed/174044/19 "2023-12-08T02:41:41Z")

</div>

I think I have found the cause of the issue and some fix, at least on my arcadyan aw1000 IPQ807x.

As we already know, when we do speedtest, we can see that the speed cannot go beyond 700mbps. After some troubleshootings, we can see that the CPU core0 is maxing out while other cores look like doing nothing.

Therefore, I write a patch so that the CPU, especially, core0 runs more efficiently and not spike to 100% all the time which causes what I call a speed cap.

This patch needs more testing and tuning so that the cpu becomes more efficient.

Here a quick video to demo before and after the patch:

[![](https://img.youtube.com/vi/2VUm_KwXkFg/hqdefault.jpg "How to Speedup Arcadyan AW1000 5g Modem (Booster)") ](https://www.youtube.com/watch?v=2VUm_KwXkFg)

---

<div class="post-metadata">

**Author:** ![IceG](https://forum.openwrt.org/user_avatar/forum.openwrt.org/iceg/32/133129_2.png) [@IceG](https://forum.openwrt.org/u/IceG)\
**Post date:** [December 8, 2023, 3:34pm UTC](https://forum.openwrt.org/t/low-usb3-speed/174044/20 "2023-12-08T15:34:42Z")

</div>

Hi All 👋

Has anyone else tested the script presented by @abidarwish ?

I wonder if we are going in the right direction or if we are looking for the problem in the right place. @Dairyman wrote above that recent OpenWrt releases reduce the performance of LTE-A/5G modems by about 20-30%.

In the video presented by @abidarwish , we can see that the CPU load is distributed across all cores, but we don't see a "big increase in connection speed".  
Unless I'm wrong and please correct what I wrote.

---

<div class="post-metadata">

**Author:** ![abidarwish](https://forum.openwrt.org/user_avatar/forum.openwrt.org/abidarwish/32/85920_2.png) [@abidarwish](https://forum.openwrt.org/u/abidarwish)\
**Post date:** [December 9, 2023, 2:34am UTC](https://forum.openwrt.org/t/low-usb3-speed/174044/21 "2023-12-09T02:34:38Z")

</div>

Well, the speed in the video is the maximum speed I can get at the location.

The purpose of the video is to demo how inefficient cpu load on a default installation and how a patch could resolve the issue.

Regarding speed, my team have tested it and got more than 1gbps.

I share a video made by one of my tester demoing the potential of the modem after the patch:

[![](https://img.youtube.com/vi/L_zE--xiQz8/maxresdefault.jpg "Arcadyan 1.2gbps") ](https://www.youtube.com/watch?v=L_zE--xiQz8)

---

<div class="post-metadata">

**Author:** ![suyuan168](https://forum.openwrt.org/user_avatar/forum.openwrt.org/suyuan168/32/11796_2.png) [@suyuan168](https://forum.openwrt.org/u/suyuan168)\
**Post date:** [December 9, 2023, 7:03am UTC](https://forum.openwrt.org/t/low-usb3-speed/174044/22 "2023-12-09T07:03:45Z")

</div>

Can you please share the patch, anyone. I also want to do a test. As mentioned above, the latest openwrt main has a 20-30% speed drop in 5G/LTE.  
How to solve the problem of slow 5G speed using USB3 as M2.  
Thank you all very much for exploring.

---

<div class="post-metadata">

**Author:** ![IceG](https://forum.openwrt.org/user_avatar/forum.openwrt.org/iceg/32/133129_2.png) [@IceG](https://forum.openwrt.org/u/IceG)\
**Post date:** [December 9, 2023, 7:44am UTC](https://forum.openwrt.org/t/low-usb3-speed/174044/23 "2023-12-09T07:44:21Z")

</div>

Hi @abidarwish ,

I asked for tests and I received them.. Wow..  
Looking at your speed results, my internet is fast as a turtle.  
Out of shame, I should delete my github account and not admit that I use mobile internet.

Will you share "magic solution" with the Community or keep the secret to yourself?

---

<div class="post-metadata">

**Author:** ![frollic](https://forum.openwrt.org/user_avatar/forum.openwrt.org/frollic/32/30113_2.png) [@frollic](https://forum.openwrt.org/u/frollic)\
**Post date:** [December 9, 2023, 7:53am UTC](https://forum.openwrt.org/t/low-usb3-speed/174044/24 "2023-12-09T07:53:52Z")

</div>

> [@IceG](#):
>
> Out of shame

because your speed is lower ... ?

I get 800 mbit with a 5G modem sitting in my basement, the 1.2gbit isn't very surprising (to me).

---

<div class="post-metadata">

**Author:** ![IceG](https://forum.openwrt.org/user_avatar/forum.openwrt.org/iceg/32/133129_2.png) [@IceG](https://forum.openwrt.org/u/IceG)\
**Post date:** [December 9, 2023, 7:57am UTC](https://forum.openwrt.org/t/low-usb3-speed/174044/25 "2023-12-09T07:57:22Z")

</div>

> [@frollic](#):
>
> I get 800 mbit with a 5G modem sitting in my basement, the 1.2gbit isn't very surprising (to me).

😮

Exactly. It's a shame where 5G is in my country.

---

<div class="post-metadata">

**Author:** ![frollic](https://forum.openwrt.org/user_avatar/forum.openwrt.org/frollic/32/30113_2.png) [@frollic](https://forum.openwrt.org/u/frollic)\
**Post date:** [December 9, 2023, 8:25am UTC](https://forum.openwrt.org/t/low-usb3-speed/174044/26 "2023-12-09T08:25:14Z")

</div>

Not really your fault then, is it ?  
,)

[Next page](https://forum.openwrt.org/t/low-usb3-speed/174044.md?page=2)
