- Jan 10, 2014
-
-
Takuya ASADA authored
On VMware, pci_readw(PCI_CFG_DEVICE_ID) returns the *vendor ID*. pci_readw(PCI_CFG_VENDOR_ID) returns vendor ID as well. Compare to FreeBSD implementation of read/write PCI config space, FreeBSD masks lower bit of offset when write to PCI_CONFIG_ADDRESS, and adds lower bit of offset to PCI_CONFIG_DATA. http://fxr.watson.org/fxr/source/amd64/pci/pci_cfgreg.c#L206 This patch changes accessing method in OSv to the FreeBSD way. Tested on QEMU/KVM and VMware. Reviewed-by:
Glauber Costa <glommer@cloudius-systems.com> Signed-off-by:
Takuya ASADA <syuu@cloudius-systems.com> Signed-off-by:
Pekka Enberg <penberg@cloudius-systems.com>
-
Nadav Har'El authored
This patch starts to solve both issue #142 ("Support MONOTONIC_CLOCK") and issue #81 (use <chrono> for time). First, it adds an uptime() function to the "clock" interface, and implements it for kvm/xen/hpet by returning the system time from which we subtract the system time at boot (but not adding any correction for wallclock). Second, it adds a new std::chrono-based interface to this clock, in a new header file <osv/clock.hh>. Instead of the old-style clock::get()->uptime(), one should prefer osv::clock::uptime::now(). This returns a std::chrono::time_point which is type-safe, in the sense that: 1. It knows what its epoch is (i.e., that it belongs to osv::clock::uptime), and 2. It knows what its units are (nanoseconds). This allows the compiler to prevent a user from confusing measurements from this clock with those from other clocks, or making mistakes in its units. Third, this patch implements clock_gettime(MONOTONIC_CLOCK), using the new osv::clock::uptime::now(). Note that though the new osv::clock::uptime is almost identical to std::chrono::steady_clock, they should not be confused. The former is actually OSv's implementation of the latter: steady_clock is implemented by the C++11 standard library using the Posix clock_gettime, and that is implemented (in this patch) using osv::clock::uptime. With this patch, we're *not* done with either issues #142 or #81. For issue #142, i.e., for supporting MONOTONIC_CLOCK in timerfd, we need OSv's timers to work on uptime(), not on clock::get()->time(). For issue #81, we should add a osv::clock::wall type too (similar to what clock::get()->time() does today, but more correctly), and use either osv::clock::wall or osv::clock::uptime everywhere that clock::get()->time() is currently used in the code. clock::get()->time() should be removed. Reviewed-by:
Glauber Costa <glommer@cloudius-systems.com> Signed-off-by:
Nadav Har'El <nyh@cloudius-systems.com> Signed-off-by:
Pekka Enberg <penberg@cloudius-systems.com>
-
- Jan 07, 2014
-
-
Nadav Har'El authored
In very early OSv history, the spinlock was used in the mutex's implementation so it made sense to put it in mutex.cc and mutex.h. But now that the spinlock is all that's left in mutex.cc (the real mutex is in lfmutex.cc), rename this file spinlock.cc. Also, move the spinlock definitions from <osv/mutex.h> to a new <osv/spinlock.h>, so if someone wants to make the grave mistake of using a spinlock - they will at least need to explicitly include this header file. Currently, the only remaining user of the spinlock is the console. Using a spinlock (and not a mutex) in the console allows printing debug messages while preemption is disabled. Arguably, this use-case is no longer important (we have tracepoints), so in the future we can consider dropping the spinlock completely. Signed-off-by:
Nadav Har'El <nyh@cloudius-systems.com> Signed-off-by:
Pekka Enberg <penberg@cloudius-systems.com>
-
- Jan 01, 2014
-
-
Nadav Har'El authored
Each implementation of "struct file" needs to implement 8 different file operations. Most special file implementations, such as pipe, socketpair, epoll and timerfd, don't support many of these operations. We had in unsupported.h functions that can be reused for the unsupported operation, but this resulted in a lot of ugly boiler-plate code. Instead, this patch switches to a cleaner, more C++-like, method: It defines a new "file" subclass, called "special_file", which implements all file operations except close(), with a default implementation identical to the old unsupported.h implementations. The files of pipe(), socketpair(), timerfd() and epoll_create() now inherit from special_file, and only override the file operations they really want to implement. Signed-off-by:
Nadav Har'El <nyh@cloudius-systems.com> Signed-off-by:
Avi Kivity <avi@cloudius-systems.com>
-
- Dec 31, 2013
-
-
Tomasz Grabiec authored
Useful for tracing virtio queue utilization issues. To get plottable data: 1. Save traces to gdb.txt 2. grep virtio_add_buf gdb.txt | grep "queue=0" \ | awk '{print $3 " " $6}' | sed -r 's/avail=(.*)/\1/' Signed-off-by:
Tomasz Grabiec <tgrabiec@cloudius-systems.com> Signed-off-by:
Pekka Enberg <penberg@cloudius-systems.com>
-
Tomasz Grabiec authored
Clean up virtio-vring.hh and move add_buf_wait() out of line. Benefits: - Plays well with tracepoints - Less recompilation when code is changed Signed-off-by:
Tomasz Grabiec <tgrabiec@cloudius-systems.com> Signed-off-by:
Pekka Enberg <penberg@cloudius-systems.com>
-
- Dec 30, 2013
-
-
Avi Kivity authored
The current initialization is to something like 5 bit words, which truncates everything to control characters on VMware. QEMU somehow ignores the word size. Fix to initialize the serial port to 8N1, yielding useful output. Signed-off-by:
Avi Kivity <avi@cloudius-systems.com>
-
- Dec 27, 2013
-
-
Pekka Enberg authored
Signed-off-by:
Pekka Enberg <penberg@cloudius-systems.com>
-
Pekka Enberg authored
Start using tprintf as in drivers/pci.cc, for example, and switch to 'error' severity to disable early boot ACPI messages. Eventually, core/debug.cc needs to be more dynamically configured but for now it's good enough to use a standardized API and make the output silent by default. Signed-off-by:
Pekka Enberg <penberg@cloudius-systems.com>
-
Avi Kivity authored
Indicate to the virtual hardware that our stack supports UDP fragmentation offload. This improves performance by a factor of about 3.3 (from ~20Gbps to ~66Gbps) running the netperf UDP STREAM test. Signed-off-by:
Avi Kivity <avi@cloudius-systems.com> Signed-off-by:
Pekka Enberg <penberg@cloudius-systems.com>
-
Avi Kivity authored
We reported the size of the last buffer in the packet, rather than the size of the complete packet. Fix to report the total size. Signed-off-by:
Avi Kivity <avi@cloudius-systems.com> Signed-off-by:
Pekka Enberg <penberg@cloudius-systems.com>
-
Asias He authored
With indirect descriptor, we can queue more buffers in the queue. Indirect descriptor helps block device by making the large request does not consume the entire ring and making the queue depth deeper. Indirect descriptor does not help net device because it makes the queue longer so it adds latency. The tests show that indirect descriptor makes blk faster and there is no real measurable degradation on net. Also the indirect will turn on only when we are short of descriptors. This patch only enables indirect descriptor for vblk and vscsi. vnet is not enabled. 1) vblk Before: 340MB/s After: 350MB/s 2) vscsi Before: 320MB/s After: 410MB/s Signed-off-by:
Asias He <asias@cloudius-systems.com> Signed-off-by:
Pekka Enberg <penberg@cloudius-systems.com>
-
- Dec 26, 2013
-
-
Asias He authored
VIRTIO_RING_F_INDIRECT_DESC belongs to the base features bits. No need to specify it in net driver. Signed-off-by:
Asias He <asias@cloudius-systems.com> Reviewed-by:
Dor Laor <dor@cloudius-systems.com> Signed-off-by:
Avi Kivity <avi@cloudius-systems.com>
-
- Dec 24, 2013
-
-
Avi Kivity authored
Helps making bsd header changes that xen includes. Signed-off-by:
Avi Kivity <avi@cloudius-systems.com>
-
- Dec 23, 2013
-
-
Avi Kivity authored
Replace divides by variables and by the hard constants with masks and divides by easy constants. Improves netperf by about 1.6%. Noted by Vlad. Reviewed-by:
Dor Laor <dor@cloudius-systems.com> Reviewed-by:
Asias He <asias@cloudius-systems.com> Signed-off-by:
Avi Kivity <avi@cloudius-systems.com>
-
- Dec 20, 2013
-
-
Asias He authored
We are under the virtio namespace, it makes no sense to repeat the virtio prefix again in the virito_rng driver. Change the naming from virtio::virtio_rng to virtio::rng. Signed-off-by:
Asias He <asias@cloudius-systems.com> Signed-off-by:
Pekka Enberg <penberg@cloudius-systems.com>
-
Asias He authored
if_getinfo is shorter and more consistent all the other if_ functions name, e.g., if_init, if_ioctl. Signed-off-by:
Asias He <asias@cloudius-systems.com> Signed-off-by:
Pekka Enberg <penberg@cloudius-systems.com>
-
Asias He authored
Rename it to txq_stats and rxq_stats which are more consistent with struct txq and struct rxq. Signed-off-by:
Asias He <asias@cloudius-systems.com> Signed-off-by:
Pekka Enberg <penberg@cloudius-systems.com>
-
Asias He authored
We are under virtio namespace, no need to repeat the virtio prefix. Signed-off-by:
Asias He <asias@cloudius-systems.com> Signed-off-by:
Pekka Enberg <penberg@cloudius-systems.com>
-
Asias He authored
We are under the virtio namespace, it makes no sense to repeat the virtio prefix again in the virito_net driver. Change the naming from virtio::virtio_net to virtio::net. Signed-off-by:
Asias He <asias@cloudius-systems.com> Signed-off-by:
Pekka Enberg <penberg@cloudius-systems.com>
-
Asias He authored
It's better not to indent after the namespace specifier. Signed-off-by:
Asias He <asias@cloudius-systems.com> Signed-off-by:
Pekka Enberg <penberg@cloudius-systems.com>
-
Asias He authored
Now, virtio-scsi disks use the same name as virtio-blk, e.g., vblk0, vlbk1. If both scsi and blk are added to guest, they share the global disk index number. Signed-off-by:
Asias He <asias@cloudius-systems.com> Signed-off-by:
Pekka Enberg <penberg@cloudius-systems.com>
-
- Dec 19, 2013
-
-
Vlad Zolotarov authored
Added ifnet->if_get_if_info() method to collect the internally gathered statistics into the standard if_data struct. Signed-off-by:
Vlad Zolotarov <vladz@cloudius-systems.com> Reviewed-by:
Asias He <asias@cloudius-systems.com> Signed-off-by:
Pekka Enberg <penberg@cloudius-systems.com>
-
Vlad Zolotarov authored
Signed-off-by:
Vlad Zolotarov <vladz@cloudius-systems.com> Reviewed-by:
Asias He <asias@cloudius-systems.com> Signed-off-by:
Pekka Enberg <penberg@cloudius-systems.com>
-
Vlad Zolotarov authored
Introducing rxq and txq structs representing the Rx and Tx queues data correspondingly. Signed-off-by:
Vlad Zolotarov <vladz@cloudius-systems.com> Reviewed-by:
Asias He <asias@cloudius-systems.com> Signed-off-by:
Pekka Enberg <penberg@cloudius-systems.com>
-
Asias He authored
Signed-off-by:
Asias He <asias@cloudius-systems.com> Signed-off-by:
Pekka Enberg <penberg@cloudius-systems.com>
-
Asias He authored
Signed-off-by:
Asias He <asias@cloudius-systems.com> Signed-off-by:
Pekka Enberg <penberg@cloudius-systems.com>
-
Asias He authored
The add_buf_wait will sleep if there is not enough buf in the avail ring. When there is more space available, it can be woke up by wakeup_waiter. Signed-off-by:
Asias He <asias@cloudius-systems.com> Signed-off-by:
Pekka Enberg <penberg@cloudius-systems.com>
-
Asias He authored
The name is shorter and clearer and more consistent with the name used in virtio-scsi. Signed-off-by:
Asias He <asias.hejun@gmail.com> Signed-off-by:
Pekka Enberg <penberg@cloudius-systems.com>
-
Asias He authored
Signed-off-by:
Asias He <asias.hejun@gmail.com> [ penberg: keep comments vertically aligned ] Signed-off-by:
Pekka Enberg <penberg@cloudius-systems.com>
-
Asias He authored
Signed-off-by:
Asias He <asias@cloudius-systems.com> Signed-off-by:
Pekka Enberg <penberg@cloudius-systems.com>
-
Asias He authored
bio is already signalled in all cases. No need to do it in destructor. Signed-off-by:
Asias He <asias@cloudius-systems.com> Signed-off-by:
Pekka Enberg <penberg@cloudius-systems.com>
-
Asias He authored
Signed-off-by:
Asias He <asias@cloudius-systems.com> Signed-off-by:
Pekka Enberg <penberg@cloudius-systems.com>
-
Asias He authored
It's better not to indent after the namespace specifier. Signed-off-by:
Asias He <asias@cloudius-systems.com> Signed-off-by:
Pekka Enberg <penberg@cloudius-systems.com>
-
Asias He authored
Change from blk::make_virtio_request to blk::make_request. Signed-off-by:
Asias He <asias@cloudius-systems.com> Signed-off-by:
Pekka Enberg <penberg@cloudius-systems.com>
-
Asias He authored
We are under the virtio namespace, it makes no sense to repeat the virtio prefix again in the virito_blk driver. Change the naming from virtio::virtio_blk to virtio::blk. Signed-off-by:
Asias He <asias@cloudius-systems.com> Signed-off-by:
Pekka Enberg <penberg@cloudius-systems.com>
-
Asias He authored
The check is moved to bdev_read and bdev_write. Signed-off-by:
Asias He <asias@cloudius-systems.com> Signed-off-by:
Pekka Enberg <penberg@cloudius-systems.com>
-
Asias He authored
The check is moved to bdev_read and bdev_write. Signed-off-by:
Asias He <asias@cloudius-systems.com> Signed-off-by:
Pekka Enberg <penberg@cloudius-systems.com>
-
Asias He authored
The check is moved to bdev_read and bdev_write. Sigaed-off-by:
Asias He <asias@cloudius-systems.com> Signed-off-by:
Pekka Enberg <penberg@cloudius-systems.com>
-
Asias He authored
Signed-off-by:
Asias He <asias@cloudius-systems.com> Signed-off-by:
Pekka Enberg <penberg@cloudius-systems.com>
-