Bug 889218

Summary: Add support for bulk in buffering to the usb-redir device
Product: Red Hat Enterprise Linux 7 Reporter: Hans de Goede <hdegoede>
Component: qemu-kvmAssignee: Hans de Goede <hdegoede>
Status: CLOSED CURRENTRELEASE QA Contact: Virtualization Bugs <virt-bugs>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 7.0CC: acathrow, hdegoede, juzhang, michen, pbonzini, shu, sluo, virt-maint
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: 1.4.0 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-06-13 12:48:32 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Hans de Goede 2012-12-20 14:36:19 UTC
USB <-> serial converters use bulk transfers to send / receive data. When such a converter is receiving data at 115200 bps without flowcontrol, it needs to be read at a certain minimum frequency to avoid its internal data buffer to overflow.

And the number of bulk in transfer packets / second is limited to 1 second / round-trip-time. With the latencies involved in usb-redirection over the network the round-trip-time becomes so large that
we do not reach the minimum frequency and data gets lost.

Upstream qemu has a new usb-redir feature called bulk in buffering, which treats the bulk in endpoints
of these devices as if they were isoc endpoints (which would have been a much better choice, as the usb spec gives no bandwidth guarentees for bulk endpoints), Employing the same latency hiding techniques as isoc endpoints for these endpoints allows receiving data with USB <-> serial adapters without data loss.

Comment 3 Hans de Goede 2014-01-16 10:42:42 UTC
Hi,

Testing instructions:

1) Run a serial null-modem cable from a serial port to a usb <-> serial converter 
2) Set both ports to 115200 bps, no flow-control using stty
3) Do cat somefile.gz > /dev/ttyXXX in one terminal
4) Do cat /dev/ttyYYY > newfile.gz in another terminal
5) Once the cat from 3 is done, do ctrl+c for the cat in 4).
6) Do gzip -t newfile.gz ,  this should succeed. Serial data transfer is not without errors, but if you use a not too large file (say 1 MB), then it should come over to the otherside without errors most of the time

Do this on physical hardware first! Once you've this working do the test with the usb <-> serial converter as the receiver, and with the usb <-> serial converter redirected to a vm, and the cat /dev/ttyYYY > newfile.gz running inside the vm.

The bulk-buffering is necessary to allow the usb ,-> serial converter to keep up when receiving data at 115200 bps, so if this works, then the buffering is working.

Regards,

Hans

Comment 4 Shaolong Hu 2014-03-14 06:41:08 UTC
Test on qemu-kvm-rhev-1.5.3-50.el7.x86_64 with steps in Comment 3:

file transfer success through usb-redirected usb-serial converter cable from source host to vm.

Comment 5 Ludek Smid 2014-06-13 12:48:32 UTC
This request was resolved in Red Hat Enterprise Linux 7.0.

Contact your manager or support representative in case you have further questions about the request.