Re: iperf UDP packet loss with Chipidea HDRC

2015-10-15 Thread akash
did you get any solutions  ???









--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: iperf UDP packet loss with Chipidea HDRC

2015-10-08 Thread Peter Chen
On Mon, Oct 05, 2015 at 07:27:23PM +0530, Jayan John wrote:
> We are developing a custom USB device on a iMX6q platform with a Chipidea
> HDRC. The device uses a single NCM interface for communication with another
> OTG device i.e. Chipidea HDRC again. I see very poor iperf UDP performance
> after role reversal with iperf server running on gadget.
> 
> Kernel: 3.10.17 using Wandboard config
> 
> Test sequence:
> 1. Connect both boards (board A and board B) using OTG cable
> 2. Board A is assigned as A device and board B is assigned as B device
> 3. B device initiates role reversal
> echo -n host > /sys/kernel/debug/ci_hdrc.0/role
> 4. A device switches to gadget mode
> echo -n gadget > /sys/kernel/debug/ci_hdrc.0/role
> 5. Assign IPV6 address on board A (now gadget).. ifconfig usb0 2012::1/64 up
> 6. Assign IPV6 address on board B (now host).. ifconfig usb0 2012::2/64 up
> 7. Run iperf server on board A.. iperf -V -s -u
> 8. Run iperf client on board B.. iperf -u -t 10 -V -c 2012::1 -b 150M
> 
> iperf server logs:
> [  4] local fe80::6cc9:b6ff:fec5:be28 port 5001 connected with
> fe80::54e0:86ff:fea6:8987 port 35629
> [  4]  0.0-10.0 sec  63.7 MBytes  53.4 Mbits/sec 0.171 ms 61701/107109 (58%)
> [  4]  0.0-10.0 sec  1 datagrams received out-of-order
> [  3] local fe80::6cc9:b6ff:fec5:be28 port 5001 connected with
> fe80::54e0:86ff:fea6:8987 port 33609
> [  3]  0.0-10.0 sec  62.1 MBytes  52.1 Mbits/sec 0.215 ms 62551/106825 (59%)
> [  3]  0.0-10.0 sec  1 datagrams received out-of-order
> 
> Query:
> 1. The UDP packet loss is seen only in the case of iperf server on gadget
> after role reversal. I see there are patches (12) from Peter for performance
> improvements on the newer kernels. Will they help?

If you only see this problem after role switch, compare the controller
registers may help it.

> 2. The issue is not seen if UDP socket buffer size/ datagram size on iperf is
> increased i.e. iperf -u -t 10 -l 32k -V -c 2012::1 -b 150M. Is this only
> hiding an issue with Chipidea driver e.g. TXFIFO or burst size?
> 3. Should ncm be tweaked to have different buffer size or NTB handling?

NCM stack may be updated from v3.10, I just tried (without role switch), it
can get 110Mbps, and about 3% loss rate using your command at v4.3-rc1.

-- 

Best Regards,
Peter Chen
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: iperf UDP packet loss with Chipidea HDRC

2015-10-08 Thread Jayan John
On Thu, Oct 8, 2015 at 1:37 PM, Peter Chen  wrote:
> On Mon, Oct 05, 2015 at 07:27:23PM +0530, Jayan John wrote:
>> We are developing a custom USB device on a iMX6q platform with a Chipidea
>> HDRC. The device uses a single NCM interface for communication with another
>> OTG device i.e. Chipidea HDRC again. I see very poor iperf UDP performance
>> after role reversal with iperf server running on gadget.
>>
>> Kernel: 3.10.17 using Wandboard config
>>
>> Test sequence:
>> 1. Connect both boards (board A and board B) using OTG cable
>> 2. Board A is assigned as A device and board B is assigned as B device
>> 3. B device initiates role reversal
>> echo -n host > /sys/kernel/debug/ci_hdrc.0/role
>> 4. A device switches to gadget mode
>> echo -n gadget > /sys/kernel/debug/ci_hdrc.0/role
>> 5. Assign IPV6 address on board A (now gadget).. ifconfig usb0 2012::1/64 up
>> 6. Assign IPV6 address on board B (now host).. ifconfig usb0 2012::2/64 up
>> 7. Run iperf server on board A.. iperf -V -s -u
>> 8. Run iperf client on board B.. iperf -u -t 10 -V -c 2012::1 -b 150M
>>
>> iperf server logs:
>> [  4] local fe80::6cc9:b6ff:fec5:be28 port 5001 connected with
>> fe80::54e0:86ff:fea6:8987 port 35629
>> [  4]  0.0-10.0 sec  63.7 MBytes  53.4 Mbits/sec 0.171 ms 61701/107109 (58%)
>> [  4]  0.0-10.0 sec  1 datagrams received out-of-order
>> [  3] local fe80::6cc9:b6ff:fec5:be28 port 5001 connected with
>> fe80::54e0:86ff:fea6:8987 port 33609
>> [  3]  0.0-10.0 sec  62.1 MBytes  52.1 Mbits/sec 0.215 ms 62551/106825 (59%)
>> [  3]  0.0-10.0 sec  1 datagrams received out-of-order
>>
>> Query:
>> 1. The UDP packet loss is seen only in the case of iperf server on gadget
>> after role reversal. I see there are patches (12) from Peter for performance
>> improvements on the newer kernels. Will they help?
>
> If you only see this problem after role switch, compare the controller
> registers may help it.
>
>> 2. The issue is not seen if UDP socket buffer size/ datagram size on iperf is
>> increased i.e. iperf -u -t 10 -l 32k -V -c 2012::1 -b 150M. Is this only
>> hiding an issue with Chipidea driver e.g. TXFIFO or burst size?
>> 3. Should ncm be tweaked to have different buffer size or NTB handling?
>
> NCM stack may be updated from v3.10, I just tried (without role switch), it
> can get 110Mbps, and about 3% loss rate using your command at v4.3-rc1.
>
> --
>
> Best Regards,
> Peter Chen

Thanks Peter, I will try that. I saw the packet loss only after role
switch.

I will close this thread for now, as I intend to make a kernel upgrade
before I continue investigation on this issue.

I will update the community/ push a patch when I root cause/ fix this.

BR,
Jayan
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: iperf UDP packet loss with Chipidea HDRC

2015-10-07 Thread Greg KH
On Tue, Oct 06, 2015 at 10:54:46PM +0530, Jayan John wrote:
> On Tue, Oct 6, 2015 at 1:31 PM, Greg KH  wrote:
> > On Tue, Oct 06, 2015 at 06:07:50AM +0530, Jayan John wrote:
> >> On Tue, Oct 6, 2015 at 3:38 AM, Fabio Estevam  wrote:
> >> > On Mon, Oct 5, 2015 at 10:57 AM, Jayan John  
> >> > wrote:
> >> >> We are developing a custom USB device on a iMX6q platform with a 
> >> >> Chipidea
> >> >> HDRC. The device uses a single NCM interface for communication with 
> >> >> another
> >> >> OTG device i.e. Chipidea HDRC again. I see very poor iperf UDP 
> >> >> performance
> >> >> after role reversal with iperf server running on gadget.
> >> >>
> >> >> Kernel: 3.10.17 using Wandboard config
> >> >
> >> > Could you test this using kernel 4.2.3 or 4.3-rc4?
> >> Thanks. Moving to 4.2.3 or 4.3 would be a rather large exercise as a 
> >> number of
> >> drivers would need changes and significant testing efforts as well.
> >
> >
> > Why is this?  Your drivers should all be upstream by now, right?  What
> > else needs to be changed to update to a new kernel version?
> >
> > Remember just how old and obsolete 3.10 is, you are on your own if you
> > use this, you will have to get support from the company that forces you
> > to use this kernel version, sorry.
> >
> > good luck!
> >
> > greg k-h
> 
> Greg, I completely agree with you on moving to a newer kernel.
> Unfortunately, this is not an option I can pick at this time.

Then you need to push this issue back to the people that are forcing you
to not have this option, as this is their responsibility, not the
community's.

Best of luck,

greg k-h
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: iperf UDP packet loss with Chipidea HDRC

2015-10-06 Thread Greg KH
On Tue, Oct 06, 2015 at 06:07:50AM +0530, Jayan John wrote:
> On Tue, Oct 6, 2015 at 3:38 AM, Fabio Estevam  wrote:
> > On Mon, Oct 5, 2015 at 10:57 AM, Jayan John  wrote:
> >> We are developing a custom USB device on a iMX6q platform with a Chipidea
> >> HDRC. The device uses a single NCM interface for communication with another
> >> OTG device i.e. Chipidea HDRC again. I see very poor iperf UDP performance
> >> after role reversal with iperf server running on gadget.
> >>
> >> Kernel: 3.10.17 using Wandboard config
> >
> > Could you test this using kernel 4.2.3 or 4.3-rc4?
> Thanks. Moving to 4.2.3 or 4.3 would be a rather large exercise as a number of
> drivers would need changes and significant testing efforts as well.


Why is this?  Your drivers should all be upstream by now, right?  What
else needs to be changed to update to a new kernel version?

Remember just how old and obsolete 3.10 is, you are on your own if you
use this, you will have to get support from the company that forces you
to use this kernel version, sorry.

good luck!

greg k-h
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: iperf UDP packet loss with Chipidea HDRC

2015-10-06 Thread Jayan John
On Tue, Oct 6, 2015 at 1:31 PM, Greg KH  wrote:
> On Tue, Oct 06, 2015 at 06:07:50AM +0530, Jayan John wrote:
>> On Tue, Oct 6, 2015 at 3:38 AM, Fabio Estevam  wrote:
>> > On Mon, Oct 5, 2015 at 10:57 AM, Jayan John  wrote:
>> >> We are developing a custom USB device on a iMX6q platform with a Chipidea
>> >> HDRC. The device uses a single NCM interface for communication with 
>> >> another
>> >> OTG device i.e. Chipidea HDRC again. I see very poor iperf UDP performance
>> >> after role reversal with iperf server running on gadget.
>> >>
>> >> Kernel: 3.10.17 using Wandboard config
>> >
>> > Could you test this using kernel 4.2.3 or 4.3-rc4?
>> Thanks. Moving to 4.2.3 or 4.3 would be a rather large exercise as a number 
>> of
>> drivers would need changes and significant testing efforts as well.
>
>
> Why is this?  Your drivers should all be upstream by now, right?  What
> else needs to be changed to update to a new kernel version?
>
> Remember just how old and obsolete 3.10 is, you are on your own if you
> use this, you will have to get support from the company that forces you
> to use this kernel version, sorry.
>
> good luck!
>
> greg k-h

Greg, I completely agree with you on moving to a newer kernel.
Unfortunately, this is
not an option I can pick at this time. I was hoping I might get
pointers on the issue
as there have been fixes related to performance on chipidea hdrc. I
will keep this
 thread open for a day or two.

thanks,
jayan
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: iperf UDP packet loss with Chipidea HDRC

2015-10-05 Thread Fabio Estevam
On Mon, Oct 5, 2015 at 10:57 AM, Jayan John  wrote:
> We are developing a custom USB device on a iMX6q platform with a Chipidea
> HDRC. The device uses a single NCM interface for communication with another
> OTG device i.e. Chipidea HDRC again. I see very poor iperf UDP performance
> after role reversal with iperf server running on gadget.
>
> Kernel: 3.10.17 using Wandboard config

Could you test this using kernel 4.2.3 or 4.3-rc4?
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: iperf UDP packet loss with Chipidea HDRC

2015-10-05 Thread Jayan John
On Tue, Oct 6, 2015 at 3:38 AM, Fabio Estevam  wrote:
> On Mon, Oct 5, 2015 at 10:57 AM, Jayan John  wrote:
>> We are developing a custom USB device on a iMX6q platform with a Chipidea
>> HDRC. The device uses a single NCM interface for communication with another
>> OTG device i.e. Chipidea HDRC again. I see very poor iperf UDP performance
>> after role reversal with iperf server running on gadget.
>>
>> Kernel: 3.10.17 using Wandboard config
>
> Could you test this using kernel 4.2.3 or 4.3-rc4?
Thanks. Moving to 4.2.3 or 4.3 would be a rather large exercise as a number of
drivers would need changes and significant testing efforts as well.This maybe
planned at a later point if there is a real need identified.
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


iperf UDP packet loss with Chipidea HDRC

2015-10-05 Thread Jayan John
We are developing a custom USB device on a iMX6q platform with a Chipidea
HDRC. The device uses a single NCM interface for communication with another
OTG device i.e. Chipidea HDRC again. I see very poor iperf UDP performance
after role reversal with iperf server running on gadget.

Kernel: 3.10.17 using Wandboard config

Test sequence:
1. Connect both boards (board A and board B) using OTG cable
2. Board A is assigned as A device and board B is assigned as B device
3. B device initiates role reversal
echo -n host > /sys/kernel/debug/ci_hdrc.0/role
4. A device switches to gadget mode
echo -n gadget > /sys/kernel/debug/ci_hdrc.0/role
5. Assign IPV6 address on board A (now gadget).. ifconfig usb0 2012::1/64 up
6. Assign IPV6 address on board B (now host).. ifconfig usb0 2012::2/64 up
7. Run iperf server on board A.. iperf -V -s -u
8. Run iperf client on board B.. iperf -u -t 10 -V -c 2012::1 -b 150M

iperf server logs:
[  4] local fe80::6cc9:b6ff:fec5:be28 port 5001 connected with
fe80::54e0:86ff:fea6:8987 port 35629
[  4]  0.0-10.0 sec  63.7 MBytes  53.4 Mbits/sec 0.171 ms 61701/107109 (58%)
[  4]  0.0-10.0 sec  1 datagrams received out-of-order
[  3] local fe80::6cc9:b6ff:fec5:be28 port 5001 connected with
fe80::54e0:86ff:fea6:8987 port 33609
[  3]  0.0-10.0 sec  62.1 MBytes  52.1 Mbits/sec 0.215 ms 62551/106825 (59%)
[  3]  0.0-10.0 sec  1 datagrams received out-of-order

Query:
1. The UDP packet loss is seen only in the case of iperf server on gadget
after role reversal. I see there are patches (12) from Peter for performance
improvements on the newer kernels. Will they help?
2. The issue is not seen if UDP socket buffer size/ datagram size on iperf is
increased i.e. iperf -u -t 10 -l 32k -V -c 2012::1 -b 150M. Is this only
hiding an issue with Chipidea driver e.g. TXFIFO or burst size?
3. Should ncm be tweaked to have different buffer size or NTB handling?
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html