netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Dean Jenkins <Dean_Jenkins@mentor.com>
To: Andrew Lunn <andrew@lunn.ch>
Cc: Guodong Xu <guodong.xu@linaro.org>,
	John Stultz <john.stultz@linaro.org>,
	lkml <linux-kernel@vger.kernel.org>,
	Mark Craske <Mark_Craske@mentor.com>,
	"David S. Miller" <davem@davemloft.net>,
	YongQin Liu <yongqin.liu@linaro.org>, <linux-usb@vger.kernel.org>,
	<netdev@vger.kernel.org>, Ivan Vecera <ivecera@redhat.com>,
	"David B. Robins" <linux@davidrobins.net>,
	Dean Jenkins <Dean_Jenkins@mentor.com>
Subject: Re: [REGRESSION] asix: Lots of asix_rx_fixup() errors and slow transmissions
Date: Fri, 6 May 2016 17:54:39 +0100	[thread overview]
Message-ID: <572CCC4F.8000808@mentor.com> (raw)
In-Reply-To: <20160506152732.GA23647@lunn.ch>

On 06/05/16 16:27, Andrew Lunn wrote:
>> In other words, the full-speed hub is restricting the USB to
>> Ethernet Adaptor to a 12Mbps (half-duplex) bandwidth to support
>> Ethernet 100Mbps (full-duplex) traffic. That is not going to work
>> very well because Ethernet frames (perhaps partial Ethernet frames)
>> need to be discarded within the USB link.
> If that really is true, the design is broken. I would expect the
> adaptor to reliably transfer whole frames over USB, and drop whole
> frames from its receive queue when the USB is congested. TCP is also
> going to see the USB bottleneck as just like any bottleneck in the
> network and back off. So TCP streams should not cause major congestion
> on the USB link.
The host's USB host controller polls the USB to Ethernet adaptor for 
more data. The USB to Ethernet adaptor cannot predict when the next poll 
request comes. The AX88772B can span Ethernet frames across multiple 
poll requests. This means it is possible get a partial Ethernet frame 
received in the USB host controller on one poll and it is assumed that 
the next poll (sometime in the near future) will get the remaining part 
of the Ethernet frame.

However, the USB to Ethernet adaptor does not contain an infinitely 
sized RX Ethernet buffer for the incoming Ethernet frames. I believe the 
USB to Ethernet adaptor is just a pipe and does not directly implement 
flow control for Ethernet frames so the RX buffer is going to overflow 
causing loss of whole Ethernet frames. I suspect the IP stack in the 
host computer implements flow control for Ethernet frames.

Because the AX88772B can span Ethernet frames across multiple poll 
requests there is a risk that the designers of the device could of 
implemented a solution to discard the remaining part of the Ethernet 
frame before the next poll arrives due to the RX buffer overflowing. I 
don't know the algorithm used in the AX88772B but there will be loss of 
data due to the mismatch in bandwidths. I agree that dropping whole 
Ethernet frames would be preferable to dropping partial Ethernet frames 
which would corrupt the data stream.

My suspicion is that the URB buffers are containing discontinues in the 
data stream because of lost data due to insufficient bandwidth on the 
USB link.

> Going over a 12Mbps USB link should be no different
> to hitting an old Ethernet hub which can only do 10/Half.
Not exactly, because USB is a transport link which is agnostic to the 
type of data that is flowing. It is up to the layers above USB to manage 
the data content.

In other words, the USB speed needs to be higher than the Ethernet speed 
to avoid mismatches in bandwidth.
>> Therefore please retest with a working high-speed USB hub or remove
>> the full-speed USB hub from the test environment and directly
>> connect the USB to Ethernet Adaptor to the root hub of the USB port.
>> Then repeat the tests to see whether anything improved.
>>
>> In other words, you need to eliminate the dmesg messages saying "not
>> running at top speed; connect to a high speed hub".
> I would also suggest testing with the Ethernet at 10/half. You should
> be able to use Ethtool to set that up. Your USB and Ethernet bandwidth
> become more equal. If you still see errors, it suggests a protocol
> implementation error somewhere.
I agree with the suggestion but I hope USB high speed (480Mbps) 
operation was the intended environment rather than the useless USB full 
speed (12Mbps) operation.

Let's hope that not using the USB hub improves things.

Regards,
Dean
>
> 	 Andrew

-- 
Dean Jenkins
Embedded Software Engineer
Linux Transportation Solutions
Mentor Embedded Software Division
Mentor Graphics (UK) Ltd.

  reply	other threads:[~2016-05-06 16:54 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-05-03  4:55 [REGRESSION] asix: Lots of asix_rx_fixup() errors and slow transmissions John Stultz
     [not found] ` <CALAqxLUj+-yUGTNviHu4+KE9=JTxjZyHBv4pdUob=xndAr8ZmA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2016-05-03  9:23   ` Dean Jenkins
2016-05-03 10:04     ` Guodong Xu
2016-05-03 10:54       ` Dean Jenkins
     [not found]         ` <5728837D.60702-nmGgyN9QBj3QT0dZR+AlfA@public.gmane.org>
2016-05-04 23:45           ` John Stultz
2016-05-05  8:11             ` Dean Jenkins
2016-05-05 12:19               ` Guodong Xu
2016-05-06 15:00                 ` Dean Jenkins
2016-05-06 15:27                   ` Andrew Lunn
2016-05-06 16:54                     ` Dean Jenkins [this message]
2016-05-06 17:40                   ` John Stultz
2016-05-06 17:06               ` John Stultz
2016-05-03 14:42 ` David B. Robins
     [not found]   ` <87ed4c76328ed9dc5591359ea0e98ab9-xeNgNI7VTeVeoWH0uzbU5w@public.gmane.org>
2016-05-03 15:44     ` John Stultz
2016-05-03 21:16     ` Dean Jenkins
2016-05-04  0:28       ` David B. Robins
2016-05-04  7:58         ` Dean Jenkins
2016-05-06 20:45           ` David B. Robins
     [not found]       ` <57291539.6080405-nmGgyN9QBj3QT0dZR+AlfA@public.gmane.org>
2016-05-06 18:38         ` John Stultz
2016-05-06 20:57       ` John Stultz
     [not found]         ` <CALAqxLXsna_em_5w8yonXUCcMwbOGknYtL5LhqYCHUK9LKFr0A-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2016-05-11 22:00           ` Dean Jenkins
2016-05-17  0:10             ` John Stultz

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=572CCC4F.8000808@mentor.com \
    --to=dean_jenkins@mentor.com \
    --cc=Mark_Craske@mentor.com \
    --cc=andrew@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=guodong.xu@linaro.org \
    --cc=ivecera@redhat.com \
    --cc=john.stultz@linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=linux@davidrobins.net \
    --cc=netdev@vger.kernel.org \
    --cc=yongqin.liu@linaro.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).