2010-10-22 10:20:49     BF527 MUSB throughput issue

Document created by Aaronwu Employee on Aug 25, 2013
Version 1Show Document
  • View in full screen mode

2010-10-22 10:20:49     BF527 MUSB throughput issue

Santhosh Raghavan (INDIA)

Message: 94876   

 

Hi,

 

We are using the inbuilt USB stack of BF527EZKIT board. We are using the 2009R1_RC7 toolchain with 2009R1-RC1 uclinux distribution. We are facing very low performance & throughput issue when we are using a USB WLAN.

 

Settings of BF527 Ezkit --> 1) HW revision is 0.2.  2)Selected Inventra Highspeed Dual Role Controller (TI, ADI, ...) with Driver Mode as Host & enabled DMA mode of operation.

 

We tested 2 devices one being a Mass Storage device & another being a USB WLAN device.We have attached the Cat info of both the devices in the file "CatInfo.txt".

 

We connected the USB WLAN device & started to transfer data packets & in the background USB Monitor function was enabled for the bus. We observed that in case of the Bulk transfer both the BULK IN endpoint & BULK OUT endpoint for the was assigned the same address & thereby we observe a very low throughput & very poor performance of the device. Attaching the USB monitored data "MUSB_WLAN.txt" . You can see that both Bo & Bi are using the same endpoint 1 for data transfer.

 

We had earlier faced the same kind of issue in an external USB Host Controller namely Renesas USB HC, where the BULK endpoints were assigned single endpoint address for data transfer. but it was overcome when we changed it by assigning separate endpoints for both IN & OUT endpoints.

 

From the manual of BF527 we understand that the inbuild USB HC has 7 IN & 7 OUT endpoints mainly for Bulk,INT & ISO transfers. Similarly we understand that assigning of 1-4 Endpoints will allow the FIFO of 128 bytes each & in the case of 5-7 endpoint the FIFO is of 1024 bytes. For the WLAN to perform requires a minimum of 512 bytes. If there is a possibilty to change the endpoint such that the WLAN bulk endpoint selects to use 1024 bytes instead of 128 bytes of the FIFO, then the throughput can improve.

 

In the case of MSC device the endpoint address were different. In this case Bo was using endpoint address 2 & Bi was using endpoint address 1.

 

We would like to the know the exact place in the MUSB code where the Endpoint is assigned & where we can modify the assigning of endpoint for better throughput improvements.

 

CatInfo.txt

MUSB_WLAN.txt

QuoteReplyEditDelete

 

 

2010-10-25 21:52:11     Re: BF527 MUSB throughput issue

Bob Liu (CHINA)

Message: 95154   

 

Hi,

 

I think the endpoint number got from usbmon is the device's endpoint but not the musb's.

 

You can add printk at musb_schedule() in musb_host.c to look at which musb's endpoint is used.

 

Thanks

QuoteReplyEditDelete

 

 

2010-11-03 01:03:25     Re: BF527 MUSB throughput issue

Santhosh Raghavan (INDIA)

Message: 95505   

 

Hi ,

 

We are not familiar with MUSB Host Controller. We could not find the exact epnum used for Bulk transfers & so we had enabled prints for the following variable used & its corresponding values alloted.

 

qh->epnum 0 qh->hw_ep->epnum 0 qh->hw_ep->musb->bulk_ep->epnum 5

 

qh->epnum 1 qh->hw_ep->epnum 7 qh->hw_ep->musb->bulk_ep->epnum 5

 

qh->epnum 1 qh->hw_ep->epnum 6 qh->hw_ep->musb->bulk_ep->epnum 5

 

Can you suggest us whether it is equivalent to the endpoint data transfer  taken from USB Monitor Log. Can you let us know what is the max data length used in this case of bulk endpoint ( whether 1024 or 128 bytes as given in the BF527 Manual) .

 

If the details are wrong then can anyone suggest which variable has to be printed to get the endpoint assigning details properly.

 

We are trying to find out the exact root cause of why this MUSB is not giving a good performance when used with RALINK WLAN device. We want to rectify the root cause & improve the WLAN performance in the inbuilt USB itself.

 

Has this MUSB HCD been used with any other USB WLAN & got a good performance. If so please send us the performance details.

QuoteReplyEditDelete

 

 

2010-11-04 07:23:59     Re: BF527 MUSB throughput issue

Bob Liu (CHINA)

Message: 95557   

 

Hi,

 

Is the performance is also bad when you test with USB Mass Storage device ?

QuoteReplyEditDelete

 

 

2010-11-08 01:29:11     Re: BF527 MUSB throughput issue

Santhosh Raghavan (INDIA)

Message: 95625   

 

Hi,

 

The performance is good when the MUSB HCD is used with USB Mass Storage class device. We observed a best case performance using USB HDD which was around 6~7 MBytes(approx 50 MBits/sec).

 

But with Ralink WLAN device, the performance was very low of around 2 ~3 MBits/sec only.

QuoteReplyEditDelete

 

 

2010-11-08 01:36:49     Re: BF527 MUSB throughput issue

Bob Liu (CHINA)

Message: 95626   

 

Both USB Mass Storage and WLAN device are use bulk transfer and the same endpoint,

 

so there is no need to change the endpoint if performance is good when using USB Mass Storage clasee device.

 

And I have heard that because of lot of package failed and retry so WLAN device have bad performance.

 

Maybe you can change a WLAN device for test.

QuoteReplyEditDelete

 

 

2010-11-08 09:43:08     Re: BF527 MUSB throughput issue

Santhosh Raghavan (INDIA)

Message: 95644   

 

Hi Bob,

 

On our telephonic convesation today afternoon with you & Zhang, we understood that you had released a patch for MUSB HCD changes for testing the RALINK WLAN. But we couldnt find your reply on the patch link.

 

Can you send us the link for the downloading the latest patch done for MUSB HCD changes.

QuoteReplyEditDelete

 

 

2010-11-08 21:44:55     Re: BF527 MUSB throughput issue

Bob Liu (CHINA)

Message: 95666   

 

Hi Santhosh,

 

Sorry for misunderstand you opinion yesterday, there is no patch for RALINK WLAN.

 

We think 2-3MBits are reasonable wireless speed on embeded system and reasonable slower than USB Mass storage, could you tell me what's your purpose using WLAN and  which speed you expect to achieved?

 

There maybe interferences on wireless network and the speed depend on which stack used on the AP(802.11 a/b/g/n).

 

And you can confirm this by testing a USB wired network card,if the speed is ok, then there must be the environment of wireless network's or the RALINK network driver's problem instead of MUSB.

 

Thanks

QuoteReplyEditDelete

 

 

2010-11-09 05:56:50     Re: BF527 MUSB throughput issue

Bob Liu (CHINA)

Message: 95701   

 

Hi Santhosh,

 

There are several possible reasons for this performance issue.

 

1. We have already used 1024 bytes endpoints for bulk transfer, but there are only three(5-7) 1024bytes endpoints on our hardware. 

 

2. USB bus is a serial bus, all the endpoints data package are finally transfered in/out one by one, so if the up-level driver have no bug there is little room for performance improve.

 

3. Because of some anomalies, we can't use dma mode1 on musb. We just use dma mode 0 which means one package one interrupt.

 

Because we haven't tested any WLAN device,we aren't sure of these reasons. Would you mind telling us the detail type of your RANLINK WLAN device?

 

We need to buy one for testing and find out whether there is anyway to improve its performance.

 

Thanks.

QuoteReplyEditDelete

 

 

2010-11-09 06:22:19     Re: BF527 MUSB throughput issue

Sonic Zhang (CHINA)

Message: 95702   

 

Hi Santhosh,

 

Maybe you can ship your wifi dongle to Shanghai? So, we can investigate if this is a problem in blackfin MUSB driver or in the wifi device driver. Bad designed driver may have problem on top of USB host with only one TX endpoint available.

 

Our mail address is:

 

Sonic Zhang

 

Analog Devices (Shanghai) Inc.

 

22/F, One Corporate Avenue

 

222 Hu Bin Road, Shanghai 200021, China

QuoteReplyEditDelete

 

 

2010-11-16 06:03:36     Re: BF527 MUSB throughput issue

Bob Liu (CHINA)

Message: 95875   

 

Hi,

 

We have received the device and connected it to a usb plug by ourself.

 

But it can't be recognized even on PC.

 

The dmesg is like this:

 

root@bob-laptop:~/Downloads/compat-wireless-2010-11-15# dmesg -c

[ 7451.491617] usb 2-1.1: new full speed USB device using ehci_hcd and address 47

[ 7451.563506] usb 2-1.1: device descriptor read/64, error -32

[ 7451.739314] usb 2-1.1: device descriptor read/64, error -32

[ 7451.914898] usb 2-1.1: new full speed USB device using ehci_hcd and address 48

[ 7451.986872] usb 2-1.1: device descriptor read/64, error -32

[ 7452.162625] usb 2-1.1: device descriptor read/64, error -32

[ 7452.338305] usb 2-1.1: new full speed USB device using ehci_hcd and address 49

[ 7452.745432] usb 2-1.1: device not accepting address 49, error -32

[ 7452.817470] usb 2-1.1: new full speed USB device using ehci_hcd and address 50

[ 7453.224642] usb 2-1.1: device not accepting address 50, error -32

[ 7453.224890] hub 2-1:1.0: unable to enumerate USB device on port 1

QuoteReplyEditDelete

 

 

2010-11-19 01:07:42     Re: BF527 MUSB throughput issue

Bob Liu (CHINA)

Message: 95969   

 

I tested it with TP LINK TL-WN821N and i think the performance is okay around 5.5Mbit/sec.

 

root:/>

root:/> iperf -c 192.168.3.100 -i 1

 

------------------------------------------------------------

Client connecting to 192.168.3.100, TCP port 5001

TCP window size: 16.0 KByte (default)

------------------------------------------------------------

[  5] local 192.168.3.102 port 43562 connected with 192.168.3.100 port 5001

[ ID] Interval       Transfer     Bandwidth

[  5]  0.0- 1.0 sec    712 KBytes  5.83 Mbits/sec

[ ID] Interval       Transfer     Bandwidth

[  5]  1.0- 2.0 sec    672 KBytes  5.51 Mbits/sec

[ ID] Interval       Transfer     Bandwidth

[  5]  2.0- 3.0 sec    736 KBytes  6.03 Mbits/sec

[ ID] Interval       Transfer     Bandwidth

[  5]  3.0- 4.0 sec    656 KBytes  5.37 Mbits/sec

[ ID] Interval       Transfer     Bandwidth

[  5]  4.0- 5.0 sec    632 KBytes  5.18 Mbits/sec

[ ID] Interval       Transfer     Bandwidth

[  5]  5.0- 6.0 sec    616 KBytes  5.05 Mbits/sec

[ ID] Interval       Transfer     Bandwidth

[  5]  6.0- 7.0 sec    752 KBytes  6.16 Mbits/sec

[ ID] Interval       Transfer     Bandwidth

[  5]  7.0- 8.0 sec    688 KBytes  5.64 Mbits/sec

[ ID] Interval       Transfer     Bandwidth

[  5]  8.0- 9.0 sec    720 KBytes  5.90 Mbits/sec

[ ID] Interval       Transfer     Bandwidth

[  5]  9.0-10.0 sec    392 KBytes  3.21 Mbits/sec

[ ID] Interval       Transfer     Bandwidth

[  5]  0.0-10.0 sec  6.42 MBytes  5.39 Mbits/sec

root:/>

root:/> iperf -c 192.168.3.100 -i 1

------------------------------------------------------------

Client connecting to 192.168.3.100, TCP port 5001

TCP window size: 16.0 KByte (default)

------------------------------------------------------------

[  5] local 192.168.3.102 port 43563 connected with 192.168.3.100 port 5001

[ ID] Interval       Transfer     Bandwidth

[  5]  0.0- 1.0 sec    688 KBytes  5.64 Mbits/sec

[ ID] Interval       Transfer     Bandwidth

[  5]  1.0- 2.0 sec    688 KBytes  5.64 Mbits/sec

[ ID] Interval       Transfer     Bandwidth

[  5]  2.0- 3.0 sec    600 KBytes  4.92 Mbits/sec

[ ID] Interval       Transfer     Bandwidth

[  5]  3.0- 4.0 sec    656 KBytes  5.37 Mbits/sec

[ ID] Interval       Transfer     Bandwidth

[  5]  4.0- 5.0 sec    704 KBytes  5.77 Mbits/sec

[ ID] Interval       Transfer     Bandwidth

[  5]  5.0- 6.0 sec    736 KBytes  6.03 Mbits/sec

[ ID] Interval       Transfer     Bandwidth

[  5]  6.0- 7.0 sec    688 KBytes  5.64 Mbits/sec

[ ID] Interval       Transfer     Bandwidth

[  5]  7.0- 8.0 sec    776 KBytes  6.36 Mbits/sec

[ ID] Interval       Transfer     Bandwidth

[  5]  8.0- 9.0 sec    840 KBytes  6.88 Mbits/sec

[ ID] Interval       Transfer     Bandwidth

[  5]  9.0-10.0 sec    880 KBytes  7.21 Mbits/sec

[ ID] Interval       Transfer     Bandwidth

[  5]  0.0-10.0 sec  7.09 MBytes  5.95 Mbits/sec

root:/> iwconfig

lo        no wireless extensions.

 

eth0      no wireless extensions.

 

wlan0     IEEE 802.11bgn  ESSID:"my_linksys"

          Mode:Managed  Frequency:2.437 GHz  Access Point: 00:1A:70:D4:94:C7 

          Bit Rate=1 Mb/s   Tx-Power=20 dBm 

          Retry  long limit:7   RTS thr:off   Fragment thr:off

          Encryption key:off

          Power Management:off

          Link Quality=64/70  Signal level=-46 dBm

          Rx invalid nwid:0  Rx invalid crypt:0  Rx invalid frag:0

          Tx excessive retries:0  Invalid misc:8   Missed beacon:0

 

root:/>

QuoteReplyEditDelete

 

 

2010-11-22 03:24:07     Re: BF527 MUSB throughput issue

Bob Liu (CHINA)

Message: 96082   

 

The detail usb wlan we use is: TP LINK TL-WN821N(chipsets: ar7010 made by atheros).

 

The wiki link:   docs.blackfin.uclinux.org/doku.php?id=linux-kernel:drivers:wifi_over_usb

QuoteReplyEditDelete

 

 

2010-11-22 03:32:46     Re: BF527 MUSB throughput issue

Sonic Zhang (CHINA)

Message: 96084   

 

The performance result is got under 2010R1 release. I recommend you to upgrade. There are many changes in MUSB and WIFI driver since 2009R1.

QuoteReplyEditDelete

 

 

2010-11-22 08:40:44     Re: BF527 MUSB throughput issue

Ian Jeffray (UNITED KINGDOM)

Message: 96090   

 

Um, did a 2010 release actually happen yet?  I don't see it.

QuoteReplyEditDelete

 

 

2010-11-23 00:39:43     Re: BF527 MUSB throughput issue

Sonic Zhang (CHINA)

Message: 96109   

 

Coming soon. And you can get the latest release candidate 2010R1-RC3 at    blackfin.uclinux.org/gf/project/uclinux-dist/frs/?action=FrsReleaseBrowse&frs_package_id=76

QuoteReplyEditDelete

 

 

2010-11-29 05:58:26     Re: BF527 MUSB throughput issue

Bob Liu (CHINA)

Message: 96283   

 

I have ported the driver from ralink's website.

 

There is only one ko file:

 

root@adam-desktop:~/wifi/tar/2010_0831_RT3070_Linux_STA_v2.4.0.1_DPO# ls -l ./os/linux/rt3070sta.ko

 

-rw-r--r-- 1 root root 11048647 2010-11-29 18:51 ./os/linux/rt3070sta.ko

 

But its size is very large, and during insmod I always get page_alloc failure.

 

What's the size of your ko file ?

 

Attached failure log.

 

failure_log.txt

QuoteReplyEditDelete

 

 

2010-11-29 07:07:06     Re: BF527 MUSB throughput issue

Rajiv Mohan (INDIA)

Message: 96286   

 

Hi Bob,

 

I have just download the driver from the site and after porting and building i have get the file size as 763KB.

 

I think the file size is large at your end because generate debug is enabled in the kernel options.

 

Please disable at try the same.kernel option is

 

Kernel option changed in the make menuconfig->Kernel hacking->Kernel debugging

 

I have loaded the generated .ko file in the setup available and it is working, attaching the log for the same.

 

wifilog.txt

QuoteReplyEditDelete

 

 

2010-11-30 01:43:22     Re: BF527 MUSB throughput issue

Bob Liu (CHINA)

Message: 96306   

 

Hi, Rajiv

 

I have finished the test and the result is around 2-3MBits/sec as you described.

 

But we used other wifi chip such as TL-WN821N,it's more than twice faster.

 

In my opinion, there maybe some problem in ralink's driver which is not our responsibility, could try other devices instead of

 

rt3070 or ask ralink's driver team for some help?

 

Thanks

QuoteReplyEditDelete

 

 

2010-11-30 04:26:11     Re: BF527 MUSB throughput issue

Rajiv Mohan (INDIA)

Message: 96331   

 

Hi Bob,

 

The main reason why we feel that the performance is getting effected is because with another USB stack (Renasas Stack) we are able to get with the same device and driver aroung 16 tp 18 Mbits/sec. The only difference in the 2 setup that we have is the USB stack.

 

We would also like to share some observations which we were able to get during some of the debuging session. Will give this information in comparision with the other stack just to see if any options are possible.

 

1) When we use the in-built USB stack we see that the bulk-in and bulk-out (EP-1)are assigned to the same end point. When we use the other USB stack we see that different end points are assigned to bulf-in(EP-1) and bulk-out(EP-2).

 

2) The we see that the FIFO size of the end point (EP-1 )assigned is 128bytes where as in the other stack the FIFO size is 512byte.

 

Is it possible to let us know how we can change these 2 parameters

 

                      1) End point assignment (different EP for bulk-in and bulk-out)

 

                      2) FIFO size increase to 512bytes (I think max configuration possible is 1028)

 

If we are able to configure there 2 parameters we might be able to increase the performance.

 

It would be really great if you could let us know how we can configure these 2 parameters so that we can test and see.

 

regards,

 

Rajiv Mohan

QuoteReplyEditDelete

 

 

2010-11-30 05:06:04     Re: BF527 MUSB throughput issue

Bob Liu (CHINA)

Message: 96333   

 

> 1) When we use the in-built USB stack we see that the bulk-in and bulk-out (EP-1)are assigned to the same end point. >When we use the other USB stack we see that different end points are assigned to bulf-in(EP-1) and bulk-out(EP-2).

 

How did you see this info? Use usb-monitor?

QuoteReplyEditDelete

 

 

2010-12-01 08:31:16     Re: BF527 MUSB throughput issue

Santhosh Raghavan (INDIA)

Message: 96371   

 

Hi Bob,

 

We saw this info by enabling the USB monitoring only. We had already posted the USB monitoring information in a txt file MUSB_WLAN.txt . For your reference we are again attaching the USB Monitored file.

 

On the basis of this information only we had suspected the issue may be because of single endpoint usage.

 

From your side can you confirm what exact  Bulk endpoint are being used for transfer & what is the FIFO size assigned for that bulk endpoint & what exactly is the data size been trasfered through them when Ralink is used for bulk transfer through MUSB HC .

 

Can you confirm whether the Endpoint used for BULK IN & BULK OUT in case of Ralink are different or the same.

 

If possible can you compare the same information of Ralink Endpoint usage with MUSB HC to that of any other USB WLAN for eg: TL-WN821N Endpoint usage. I hope both the WLAN are using Bulk Endpoint for data transfer.

 

As specified earlier the same Ralink driver is giving a throughput of around 16 to 18 Mbits with external Renesas HC.

 

MUSB_WLAN.txt

QuoteReplyEditDelete

 

 

2010-12-02 02:36:32     Re: BF527 MUSB throughput issue

Bob Liu (CHINA)

Message: 96380   

 

Hi,

 

The info got from USB monitoring means: which endpoints in device(rt3070) are used instead of the musb host's endpoint.

 

So in my opinion the issue is how ralink choose which endpoint to use.

 

It seems that while using Renesas HC the ralink driver can use two endpoints but use musb as host it can only using endpoint 1.  I think we can try to fix this problem in this direction.

 

BTW: I always get "Bulk In Failed", the log is:

 

==============================

 

root:/> insmod rt3070sta.ko

rtusb init --->

<-- RTMPAllocAdapterBlock, Status=0

BULK IN MaxPacketSize = 512

EP address = 0x81

BULK OUT MaxPacketSize = 512

EP address = 0x 1

BULK OUT MaxPacketSize = 512

EP address = 0x 2

BULK OUT MaxPacketSize = 512

EP address = 0x 3

BULK OUT MaxPacketSize = 512

EP address = 0x 4

BULK OUT MaxPacketSize = 512

EP address = 0x 5

BULK OUT MaxPacketSize = 512

EP address = 0x 6

usbcore: registered new interface driver rt2870

root:/>

 

root:/> ifconfig ra0 192.168.3.103 up

<-- RTMPAllocTxRxRingMemory, Status=0

-->RTUSBVenderReset

<--RTUSBVenderReset

Current MAC: =00:0d:f0:8d:47:b7

NICReadEEPROMParameters: RxPath = 1, TxPath = 1

phy mode> Error! The chip does not support 5G band 5!

BuildChannel # 1 :: Pwr0 = 5, Pwr1 =5,

BuildChannel # 2 :: Pwr0 = 5, Pwr1 =5,

BuildChannel # 3 :: Pwr0 = 5, Pwr1 =5,

BuildChannel # 4 :: Pwr0 = 5, Pwr1 =5,

BuildChannel # 5 :: Pwr0 = 6, Pwr1 =5,

BuildChannel # 6 :: Pwr0 = 6, Pwr1 =5,

BuildChannel # 7 :: Pwr0 = 6, Pwr1 =5,

BuildChannel # 8 :: Pwr0 = 6, Pwr1 =5,

BuildChannel # 9 :: Pwr0 = 6, Pwr1 =5,

BuildChannel # 10 :: Pwr0 = 6, Pwr1 =5,

BuildChannel # 11 :: Pwr0 = 10, Pwr1 =5,

BuildChannel # 12 :: Pwr0 = 10, Pwr1 =5,

BuildChannel # 13 :: Pwr0 = 10, Pwr1 =5,

BuildChannel # 14 :: Pwr0 = 10, Pwr1 =5,

20MHz BW, 2.4G band-aaaa6666,  Adata = aaaa6666,  Gdata = aaaa6666

20MHz BW, 2.4G band-aaaa6688,  Adata = aaaa6688,  Gdata = aaaa6688

20MHz BW, 2.4G band-aaaa6688,  Adata = aaaa6688,  Gdata = aaaa6688

20MHz BW, 2.4G band-aaaa6688,  Adata = aaaa6688,  Gdata = aaaa6688

20MHz BW, 2.4G band-ffff6688,  Adata = ffff6688,  Gdata = ffff6688

BuildChannel # 1 :: Pwr0 = 5, Pwr1 =5,

BuildChannel # 2 :: Pwr0 = 5, Pwr1 =5,

BuildChannel # 3 :: Pwr0 = 5, Pwr1 =5,

BuildChannel # 4 :: Pwr0 = 5, Pwr1 =5,

BuildChannel # 5 :: Pwr0 = 6, Pwr1 =5,

BuildChannel # 6 :: Pwr0 = 6, Pwr1 =5,

BuildChannel # 7 :: Pwr0 = 6, Pwr1 =5,

BuildChannel # 8 :: Pwr0 = 6, Pwr1 =5,

BuildChannel # 9 :: Pwr0 = 6, Pwr1 =5,

BuildChannel # 10 :: Pwr0 = 6, Pwr1 =5,

BuildChannel # 11 :: Pwr0 = 10, Pwr1 =5,

BuildChannel # 12 :: Pwr0 = 10, Pwr1 =5,

BuildChannel # 13 :: Pwr0 = 10, Pwr1 =5,

BuildChannel # 14 :: Pwr0 = 10, Pwr1 =5,

<==== rt28xx_init, Status=0

0x1300 = 00064300

root:/> Bulk In Failed. Status=-71, BIIdx=0x6, BIRIdx=0x6, actual_length= 0x0

CmdThread : CMDTHREAD_RESET_BULK_IN === >

CMDTHREAD_RESET_BULK_IN: Submit Rx URB Done, status=-115!

CmdThread : CMDTHREAD_RESET_BULK_IN <===

 

root:/>

QuoteReplyEditDelete

 

 

2010-12-02 03:36:40     Re: BF527 MUSB throughput issue

Rajiv Mohan (INDIA)

Message: 96400   

 

Hi Bob,

 

This error is coming because i think we are getting this error status from the USB stack.

 

The pURB->status is coming as failure in the receive handler.

QuoteReplyEditDelete

 

 

2010-12-03 05:15:41     Re: BF527 MUSB throughput issue

Bob Liu (CHINA)

Message: 96443   

 

Hi, Rajiv

 

I have captured the packets using usb analyzer and found that the ralink driver send and receive packets just using one endpoint 1, but tp-link driver can using two.(Here endpoint means endpoints on the device instead of the host.)

 

So in my opinion the ralink driver may have some compatible problem, you need to dig it out.

 

Thanks

QuoteReplyEditDelete

 

 

2010-12-09 02:41:30     Re: BF527 MUSB throughput issue

Santhosh Raghavan (INDIA)

Message: 96574   

 

Hi Bob,

 

From our understanding, the Endpoint assignment for a driver are done by the Linux USB Core Driver & the USB Host Controller used.

 

In our case of Renesas, each endpoint will be assigned a separate pipe to transfer the data from any direction. The Renesas HC has totally 10 pipes & any endpoint can be assigned from Pipe1 to Pipe9. For specific to Bulk transfers it is possible to assign the endpoint address from Pipe1 to Pipe5.

 

So in the case of Ralink WLAN driver the Bulk OUT endpoint was assigned a separate pipe(PIPE 3) & for BULK  IN endpoint a separate pipe (PIPE4). So any transfer of data would be collected in the respective Pipe assigned for the Endpoints & transfered further.

 

But we are unaware of the behaviour in the MUSB HC. As stated earlier in this thread when we checked the MUSB Endpoint assignment, below is what we had reported.

 

/******************************************************************************************************/

 

We could not find the exact epnum used for Bulk transfers & so we had enabled prints for the following variable used & its corresponding values alloted in the MUSB function.

 

qh->epnum 0 qh->hw_ep->epnum 0 qh->hw_ep->musb->bulk_ep->epnum 5

 

qh->epnum 1 qh->hw_ep->epnum 7 qh->hw_ep->musb->bulk_ep->epnum 5

 

qh->epnum 1 qh->hw_ep->epnum 6 qh->hw_ep->musb->bulk_ep->epnum 5

 

Can you suggest us whether it is equivalent to the endpoint data transfer  taken from USB Monitor Log. Can you let us know what is the max data length used in this case of bulk endpoint ( whether 1024 or 128 bytes as given in the BF527 Manual) .

 

If the details are wrong then can anyone suggest which variable has to be printed to get the endpoint assigning details properly.

 

/********************************************************************************************************/

 

Please recheck the Endpoint assignement of MUSB for Ralink case & check whether the assignement of this endpoint is correct or not. Or can this be verified by varying the endpoint assigment for BULK IN & BULK OUT in MUSB.

QuoteReplyEditDelete

 

 

2010-12-09 03:25:34     Re: BF527 MUSB throughput issue

Bob Liu (CHINA)

Message: 96584   

 

>/******************************************************************************************************/

 

> We could not find the exact epnum used for Bulk transfers & so we had enabled prints for the following variable used & its >corresponding values alloted in the MUSB function.

 

>qh->epnum 0 qh->hw_ep->epnum 0 qh->hw_ep->musb->bulk_ep->epnum 5

 

>qh->epnum 1 qh->hw_ep->epnum 7 qh->hw_ep->musb->bulk_ep->epnum 5

 

>qh->epnum 1 qh->hw_ep->epnum 6 qh->hw_ep->musb->bulk_ep->epnum 5

 

Yes,there are correct.    Epnum 5, 6, 7 are all of 1024k size.

 

And you can add printk at file common/rtusb_bulk.c: function RTUSBInitTxDesc() like this:

 

  50 VOID    RTUSBInitTxDesc(

  51         IN      PRTMP_ADAPTER   pAd,

  52         IN      PTX_CONTEXT             pTxContext,

  53         IN      UCHAR                   BulkOutPipeId,

  54         IN      usb_complete_t  Func)

  55 {

  56         PURB                            pUrb;

  57         PUCHAR                          pSrc = NULL;

  58         POS_COOKIE                      pObj = (POS_COOKIE) pAd->OS_Cookie;

  59

  60         pUrb = pTxContext->pUrb;

  61         ASSERT(pUrb);

  62

  63         // Store BulkOut PipeId

  64         pTxContext->BulkOutPipeId = BulkOutPipeId;

  65

  66         if (pTxContext->bAggregatible)

  67         {

  68                 pSrc = &pTxContext->TransferBuffer->Aggregation[2];

  69         }

  70         else

  71         {

  72                 pSrc = (PUCHAR) pTxContext->TransferBuffer->field.WirelessPacket;

  73         }

  74

  75         printk("pipe id %d, dest endpoint num %d\n", BulkOutPipeId, pAd->BulkOutEpAddr[BulkOutPipeId]);

  76         //Initialize a tx bulk urb

  77         RTUSB_FILL_TX_BULK_URB(pUrb,

  78                                pObj->pUsb_Dev,

  79                                pAd->BulkOutEpAddr[BulkOutPipeId],

  80                                pSrc,

  81                                pTxContext->BulkOutSize,

  82                                Func,

  83                                pTxContext);

  84 }

 

In my test, it always print like below during iperf test, It always use dest endpoint num 1 only!!

 

root:/> pipe id 0, dest endpoint num 1

pipe id 0, dest endpoint num 1

pipe id 0, dest endpoint num 1

pipe id 0, dest endpoint num 1

pipe id 0, dest endpoint num 1

pipe id 0, dest endpoint num 1

pipe id 0, dest endpoint num 1

pipe id 0, dest endpoint num 1

pipe id 0, dest endpoint num 1

pipe id 0, dest endpoint num 1

pipe id 0, dest endpoint num 1

pipe id 0, dest endpoint num 1

pipe id 0, dest endpoint num 1

 

You need to confirm whether this is true on your platform and when using Renesas as usb host.

 

So, in my opinion the problem is caused by ralink driver, why it just use dest endpoint num 1??

 

Thanks.

QuoteReplyEditDelete

 

 

2010-12-09 03:27:47     Re: BF527 MUSB throughput issue

Bob Liu (CHINA)

Message: 96585   

 

>Yes,there are correct.    Epnum 5, 6, 7 are all of 1024k size.

 

Sorry, 1024 bytes size max.

QuoteReplyEditDelete

 

 

2010-12-09 04:40:40     Re: BF527 MUSB throughput issue

Rajiv Mohan (INDIA)

Message: 96587   

 

Hi Bob,

 

Function RTUSBInitTxDesc() is used for bulk-out transfer and the index passed to this function BulkOutPipeId is always 0 therefore the address value (pAd->BulkOutEpAddr[BulkOutPipeId] )assigned in this index will always be used and the value is 0x01.

 

Similar to this there is function RTUSBInitRxDesc() this is used for bulk-in transfer and the the address value assigned is pAd->BulkInEpAddr which is 0x80.

 

Both these values are assigned during the init face itself.

 

BULK IN MaxPacketSize = 512

EP address = 0x81

BULK OUT MaxPacketSize = 512

EP address = 0x 1

BULK OUT MaxPacketSize = 512

EP address = 0x 2

BULK OUT MaxPacketSize = 512

EP address = 0x 3

BULK OUT MaxPacketSize = 512

EP address = 0x 4

BULK OUT MaxPacketSize = 512

EP address = 0x 5

BULK OUT MaxPacketSize = 512

EP address = 0x 6

 

The first and the second values are used.

 

We get the same values when we use the Renasas USB host driver.

 

We would like to know how we can change the end point assignment from the USB host just to see if there is any improvement.

 

When using the renasas host stack we had faced one issue which was when both USB wifi card and USB Mass storage device were connected in the device the throughput had come down badly. When debugging we found that bulk-out end point assignment done in the Renasas host was same for the both the USB wifi card and the USB Mass storage device. When we had changed this assignment and made it different for both the case we found that the performance was improved and same as when no USB mass storage device was connected.

 

This is the main reason we feel that  we will be able to improve the throughput if we can change the end point values.

 

Regards,

 

Rajiv Mohan

QuoteReplyEditDelete

 

 

2010-12-09 05:08:52     Re: BF527 MUSB throughput issue

Bob Liu (CHINA)

Message: 96588   

 

Could you try the attached patch can help to improve the performance?

 

Thanks

 

musb_host.patch

QuoteReplyEditDelete

 

 

2010-12-13 01:26:12     Re: BF527 MUSB throughput issue

Rajiv Mohan (INDIA)

Message: 96654   

Hi Bob,

I have applied the patch and checked but still there is no improvement in performance in fact we are seeing a problem when running iperf as client.

 

We are always getting the below error and board gets reset in next few seconds.

 

musb_h_tx_flush_fifo 124: Could not flush host TX fifo: csr: 000a

 

root:/> ./iperf -c 10.203.126.200 -u -i 2 -p 5001 -t 60

------------------------------------------------------------

Client connecting to 10.203.126.200, UDP port 5001

Sending 1470 byte datagrams

UDP buffer size:   104 KByte (default)

------------------------------------------------------------

[ 5] local 10.203.126.195 port 55592 connected with 10.203.126.200 port 5001

[ ID] Interval       Transfer     Bandwidth

[ 5] 0.0- 2.0 sec    257 KBytes  1.05 Mbits/sec

[ ID] Interval       Transfer     Bandwidth

[ 5] 2.0- 4.0 sec    254 KBytes 1.04 Mbits/sec

[ ID] Interval       Transfer     Bandwidth

[ 5] 4.0- 6.0 sec 1.44 KBytes 5.88 Kbits/sec

[ ID] Interval       Transfer     Bandwidth

[ 5] 6.0- 8.0 sec 0.00 Bytes 0.00 bits/sec

[ ID] Interval       Transfer     Bandwidth

[ 5] 8.0-10.0 sec 0.00 Bytes 0.00 bits/sec

[ ID] Interval       Transfer     Bandwidth

[ 5] 10.0-12.0 sec 57.4 KBytes    235 Kbits/sec

[ ID] Interval       Transfer     Bandwidth

[ 5] 12.0-14.0 sec    256 KBytes 1.05 Mbits/sec

[ ID] Interval       Transfer     Bandwidth

[ 5] 14.0-16.0 sec    256 KBytes 1.05 Mbits/sec

[ ID] Interval       Transfer     Bandwidth

[ 5] 16.0-18.0 sec    257 KBytes 1.05 Mbits/sec

[ ID] Interval       Transfer     Bandwidth

[ 5] 18.0-20.0 sec    257 KBytes 1.05 Mbits/sec

musb_h_tx_flush_fifo 124: Could not flush host TX fifo: csr: 000a

musb_h_tx_flush_fifo 124: Could not flush host TX fifo: csr: 000a

musb_h_tx_flush_fifo 124: Could not flush host TX fifo: csr: 000a

musb_h_tx_flush_fifo 124: Could not flush host TX fifo: csr: 000a

musb_h_tx_flush_fifo 124: Could not flush host TX fifo: csr: 000a

musb_h_tx_flush_fifo 124: Could not flush host TX fifo: csr: 000a

musb_h_tx_flush_fifo 124: Could not flush host TX fifo: csr: 000a

musb_h_tx_flush_fifo 124: Could not flush host TX fifo: csr: 000a

musb_h_tx_flush_fifo 124: Could not flush host TX fifo: csr: 000a

musb_h_tx_flush_fifo 124: Could not flush host TX fifo: csr: 000a

musb_h_tx_flush_fifo 124: Could not flush host TX fifo: csr: 000a

 

 

U-Boot 1.1.6-svn1273 (ADI-2008R1.5) (Jul 21 2008 - 00:29:36)

 

CPU:   ADSP bf527-0.0 (Detected Rev: 0.2)

Board: ADI BF527 EZ-Kit board

       Support:   blackfin.uclinux.org/

Clock: VCO: 525 MHz, Core: 525 MHz, System: 131 MHz

RAM:   64 MB

Flash: 4 MB

In:    serial

Out:   serial

Err:   serial

Net:   Blackfin EMAC

MAC:   00:1F:A4:A8:87:E8

Hit any key to stop autoboot: 0

bfin> <INTERRUPT>

bfin>

 

Can you share the results at your end after applying the patch.

QuoteReplyEditDelete

 

 

2010-12-13 20:56:52     Re: BF527 MUSB throughput issue

Bob Liu (CHINA)

Message: 96675   

 

Hi, Rajiv

 

In my test it didn't improve the performance although without error like you got.

 

The patch is just following what you want: using different host endpoints for bulk in and out.

 

And I am still not agree with it, because during iperf test there is just one direction transfer(PC as iperf host or musb as iperf host) which means just bulk-in or bulk-out transfer.

 

So using different endpoints can't make things better in iperf test.

QuoteReplyEditDelete

 

 

2010-12-14 02:37:48     Re: BF527 MUSB throughput issue

Rajiv Mohan (INDIA)

Message: 96676   

 

Hi Bob,

 

Could you let us know what could be the possible reason for the following error to come. This error comes mainly when we run the client in the device side.

 

musb_h_tx_flush_fifo 124: Could not flush host TX fifo: csr: 000a

 

 

 

This might give us some clue as to what the problem could be.

 

 

 

Regards,

 

Rajiv Mohan

QuoteReplyEditDelete

 

 

2010-12-14 03:13:31     Re: BF527 MUSB throughput issue

Bob Liu (CHINA)

Message: 96677   

 

Hi, Rajiv

 

I am not clear about this problem, but I find a similar problem in our forum.

 

The link is:   blackfin.uclinux.org/gf/project/uclinux-dist/forum/?_forum_action=ForumMessageBrowse&thread_id=33754&action=ForumBrowse

 

Maybe you can try what Michael said:

 

 

 

"The voltage drop is due to missing capacitance on the VBUS supply.

A simple 100uF Low ESR across VBUS fixes the problems.

 

See atached picture"

 

Thanks

QuoteReplyEditDelete

 

 

2010-12-14 04:27:42     Re: BF527 MUSB throughput issue

Rajiv Mohan (INDIA)

Message: 96703   

 

Hi Bob,

 

We have done this already in the setup but still we are seeing this. This is seen only when we run client (-c) option using iperf. When we run as server we are not seeing this issue.

 

Just to clarify.

 

1) While running iperf are you observing large number of packet losses?

 

2) Is the connection reliable connection?

 

3) When we send packets in different speeds using -b option what is the observation? (for example with options -b 2M, -b 5M, -b 10M)

 

iperf -c <server-ip> -p <port> -i 2 -b 2M.

 

with different options in -b what is the observation?

 

I am attaching the logs obtained in your set up for different data rates. We are observing that at after every few number of transfers some packets is getting lost and therefore not able to get reliable connection. are you observing the same at your end or do you get consistant data rates. Please send us the logs so that we can check.

 

Regards,

 

Rajiv Mohan

 

wifi.log

QuoteReplyEditDelete

 

 

2010-12-15 04:27:58     Re: BF527 MUSB throughput issue

Bob Liu (CHINA)

Message: 96761   

 

Hi, Rajiv

 

Please give the full detail steps then I can send out my test result because I can't distinguish the iperf server and client in your wifi.log.  And I need the detail command run in the iperf server and client(bf527) for testing.

 

BTW: This problem happens only after apply the patch I attached in 2010-12-13 ?

 

Thanks

QuoteReplyEditDelete

 

 

2010-12-23 04:28:44     Re: BF527 MUSB throughput issue

Rajiv Mohan (INDIA)

Message: 96967   

 

Hi Bob,

 

 

 

We would ike to get result / teraterm output of the following commands:

 

1) When server is running in the device and client in the PC connected.

 

      a) Server in the device command:

 

                       iperf -s -u -i 2 -p 5001

 

     b) Client command list in the PC connected:

 

                       1) iperf -c <ipaddress of server> -u -p 5001 -i 2 -t 90 -b 2M

 

                       2) iperf -c <ipaddress of server> -u -p 5001 -i 2 -t 90 -b 4M

 

                       3) iperf -c <ipaddress of server> -u -p 5001 -i 2 -t 90 -b 6M

 

                       4) iperf -c <ipaddress of server> -u -p 5001 -i 2 -t 90 -b 10M

 

                        5)iperf -c <ipaddress of server> -u -p 5001 -i 2 -t 90 -b 16M

 

2) When client in run in the device and server in the pc connected.

 

    a) Server in the PC  command:

 

                       iperf -s -u -i 2 -p 5001

 

     b) Client command list in the device connected:

 

                       1) iperf -c <ipaddress of server> -u -p 5001 -i 2 -t 90 -b 2M

 

                       2) iperf -c <ipaddress of server> -u -p 5001 -i 2 -t 90 -b 4M

 

                       3) iperf -c <ipaddress of server> -u -p 5001 -i 2 -t 90 -b 6M

 

                       4) iperf -c <ipaddress of server> -u -p 5001 -i 2 -t 90 -b 10M

 

                        5)iperf -c <ipaddress of server> -u -p 5001 -i 2 -t 90 -b 16M

 

 

 

Please do send the output of the following both client and the server. This is help in seeing if we are able to get consistant data rates without breakage in the connection and also without packet loss.

 

We were seeing the packet loss and other inconsistances in our setup before also without the patch. We want to make sure that it is not due to some setup related issue.

 

regards,

 

Rajiv Mohan

QuoteReplyEditDelete

 

 

2010-12-23 05:33:01     Re: BF527 MUSB throughput issue

Bob Liu (CHINA)

Message: 96970   

 

Attached the four log files:

 

1) When server is running in the device and client in the PC connected.

 

      a) Server in the device command:

 

                       file: musb_host.log

 

     b) Client command list in the PC connected:

 

                       file: pc_client.log

 

2) When client in run in the device and server in the pc connected.

 

    a) Server in the PC  command:

 

                       file: pc_host.log

 

     b) Client command list in the device connected:

 

                       file: musb_client.log

 

pc_host.log

pc_client.log

musb_client.log

musb_host.log

QuoteReplyEditDelete

 

 

2010-12-30 06:27:29     Re: BF527 MUSB throughput issue

Rajiv Mohan (INDIA)

Message: 97069   

 

HI Bob,

 

            Can you please upload the uImage that you are using.we want to just confirm that errors are not caused by the uImage that we are using.

QuoteReplyEditDelete

Outcomes