Commit Graph
11 Commits
Author SHA1 Message Date
Ali Abu-Foul ac3670f180 vioserial: Add Linux build for server part
Added the option to build the test on Linux using the Makefile.
On Linux, The test will run the speed test on the server mode by default.

Signed-off-by: Ali Abu-Foul <[email protected]>
2020-03-19 15:48:13 +02:00
Ali Abu-Foul 2cdd4720de vioserial: Add speed test to the original serial test
The speed test can be built for both Linux and Windows and intended to run
as following:
* Client in on Windows side.
* Server is on Linux side.
* Client sends a big block prepended by the header.
* Server receives the header, then receives the data, then sends short
respose to the client.
* Client receives the response and can evaluate the speed of the transfer.

On Windows, The test will run the speed test on client mode when the
option "-sp" is used.

When runnig the speed test, the follwing qemu command should be added:
-chardev socket,path=/tmp/foo,id=foo
-device virtserialport,bus=virtio-serial0.0,nr=2,chardev=foo,id=test0,name=test0

Signed-off-by: Ali Abu-Foul <[email protected]>
2020-03-19 15:48:13 +02:00
Yuri Benditovich 064c9b2946 vioser-test: add flexibility to the test
If the port can't be open (probably opened by vdservice), go to
the next one.
Add ability to increase write buffer size and send
entire buffer filled by characters without getting data from the
console.
This helps testing corner cases of vioser.sys, for example:
configure additional test port port with tcp socket backend,
connect to it with 'nc', press ^Z to suspend the 'nc' and send
several large (512K) buffers.
At some point the write does not return immediately and closing
test application causes cancellation flow.
Another scenarion: if 1M buffer sent, the driver fails the operation
due to too large SG table.

Signed-off-by: Yuri Benditovich <[email protected]>
2019-12-11 13:55:04 +01:00
Ladi Prosek a83f8a3a08 vioserial: Static analysis: vioser-test tweaks
Static analysis was failing with:

app\device.cpp(114): warning C6387: 'ol.hEvent' could be '0':  this does not adhere to the specification for the function 'CloseHandle'.
app\device.cpp(196): warning C6387: 'ol.hEvent' could be '0':  this does not adhere to the specification for the function 'CloseHandle'.
app\main.cpp(183): warning C28285: For function 'wmain' '_Param_(2)' syntax error in 'SAL_readableTo(elementCount(Argc))' near 'Argc))'.

Signed-off-by: Ladi Prosek <[email protected]>
2017-12-16 21:36:20 +02:00
Vadim Rozenfeld 121604d31a fix compilation problems 2016-07-17 20:47:22 +10:00
Ladi Prosek 35544f77e8 BZ#1293249: Fix IOCTL_GET_INFORMATION, part 2
The driver now returns STATUS_BUFFER_OVERFLOW if the output buffer is big
enough for the VIRTIO_PORT_INFO structure but not big enough for the port
name. The IOCTL method is now METHOD_OUT_DIRECT to enable passing the
required length back to the caller.

This reverts the user space part of commit a7e92d7e8c.
2016-02-01 15:14:05 +11:00
Ladi Prosek a7e92d7e8c BZ#1293249: Fix IOCTL_GET_INFORMATION
The current code doesn't work. If the supplied output buffer is too small,
the caller does not receive the required size in lpBytesReturned as
intended.

Relevant blog post: http://bit.ly/1NxJik3

I am simply switching to a reasonably sized fixed buffer on the calling
side, exactly what SerialPort::SerialPort() does. The IOCTL implementation
is tweaked to make it clear that the buffer size is not communicated back
on failure.
2015-12-23 18:23:46 +02:00
Yan Vugenfirer 3b8d8d1fc5 [vioserial] Clean out white spaces before merging memory allocation changes in virtio library 2011-12-06 17:17:18 +02:00
Yan Vugenfirer bd10c3ec3c Sync with Vadim's repository 2011-11-10 14:28:24 +02:00
Yan Vugenfirer 9f49609691 This repository only for the virtio library and NetKVM driver 2011-10-25 15:53:09 +02:00
Yan Vugenfirer 76380b33a7 Merge latest vioserial code 2010-10-03 22:34:00 +02:00