Summary: | Poor read/write performance on uhci USB controllers | ||
---|---|---|---|
Product: | Base System | Reporter: | seagull <seagull> |
Component: | misc | Assignee: | freebsd-bugs (Nobody) <bugs> |
Status: | Closed FIXED | ||
Severity: | Affects Only Me | ||
Priority: | Normal | ||
Version: | 4.2-RELEASE | ||
Hardware: | Any | ||
OS: | Any |
Description
seagull
2001-03-22 16:30:01 UTC
Responsible Changed From-To: freebsd-bugs->n_hibma This is a known problem and should be solvable. Just in case this helps... I was finally able to locate a CATC USB protocol analyzer, and made a trace of a file transfer under FreeBSD 4.3-RC2, on an IBM Thinkpad 600E with a UHCI controller. I also have a trace made by another individual of a file transfer, from the same USB device, done under Windows. I have posted the output from the CATC analysis software on the Web at: http://www.aracnet.com/~seagull/BSD/ What this output shows is that the BSD USB stack is requesting multiple data reads in a frame, but when it receives a NAK in response to a read request, it idles out to the end of the frame, and doesn't retry a transmission until the next frame. Essentially, this means that the BSD stack is demanding that data be available from the device every time it is requested in the frame. If that data is not available, then it "gives up" on the current frame, and waits for the next frame to start again, even though the external device may be capable of sending data later in that frame. If you look at the trace, it shows an SOF at packet 0, an IN token at 1, DATA receivedd at 2 with an ACK at 3. In packet 4, BSD requests more data, and the device responds in 5 with a NAK. At this point, BSD is idle until the end of frame, and doesn't generate packet 6 (SOF) until that frame starts. Looking at the trace made under Windows, we see very different behavior from the Win32 USB stack. If a NAK is received, Windows tries again after a brief delay. The IN-NAK-IN-NAK sequence repeats throughout the frame, and it gets as many data packets as the device is capable of sending (roughly 8 or 9 packets) in that frame. This more aggressive behavior is the correct behavior: the USB controller should be attempting to pull in as much data as it can in a frame, up to the allowed bandwidth on the bus. Under FreeBSD, then, bulk data reads using ugen and uhci are limited to 1 packet/frame. Given 1 frame every ms, and a 64-byte packet, this limits the bulk transfer to 64,000 bytes/second, which is very, very low. I hope this helps those who are working on the stack. I am willing to obtain further traces if needed (though I can't guarantee quick turnaround times, since the CATC analyzers aren't mine to play with, and are at my disposal only due to the kindness of others). Cheers, -+JLS State Changed From-To: open->feedback Is this still a problem with modern versions of FreeBSD? Responsible Changed From-To: n_hibma->freebsd-bugs With permission of assignee, reset assignment. State Changed From-To: feedback->closed Fixed in 5.x. A commit in branch main references this bug: URL: https://cgit.FreeBSD.org/ports/commit/?id=927ad383075a183f711afb4b00d6c9539015ea41 commit 927ad383075a183f711afb4b00d6c9539015ea41 Author: Barbara Guida <bar@FreeBSD.org> AuthorDate: 2021-11-26 06:59:49 +0000 Commit: Barbara Guida <bar@FreeBSD.org> CommitDate: 2021-11-26 06:59:49 +0000 net-p2p/amule: fix pkg-plist for AMULEGUI as well. While here, update WX from 2.8 to 3.0 because amulegui seems to not always work correctly with 2.8. PR: 26002 Reported by: echoxxzz@gmail.com net-p2p/amule/Makefile | 10 ++++++++-- net-p2p/amule/pkg-plist | 14 +++++++------- 2 files changed, 15 insertions(+), 9 deletions(-) A commit in branch main references this bug: URL: https://cgit.FreeBSD.org/ports/commit/?id=27392cf64d50cd1898f83624a588bc5c1b5f27d0 commit 27392cf64d50cd1898f83624a588bc5c1b5f27d0 Author: Barbara Guida <bar@FreeBSD.org> AuthorDate: 2021-12-01 08:04:39 +0000 Commit: Barbara Guida <bar@FreeBSD.org> CommitDate: 2021-12-01 08:04:39 +0000 net-p2p/amule: correct the inverted logic for DEBUG option. PR: 26002 Reported by: echoxxzz@gmail.com net-p2p/amule/Makefile | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) |