aboutsummaryrefslogtreecommitdiff
path: root/lib/libvirtio/virtio.code
AgeCommit message (Collapse)AuthorFilesLines
2019-11-11virtio: Make virtio_set_qaddr staticAlexey Kardashevskiy1-8/+0
It is never called outside of virtio, make it static. Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
2017-08-07virtio-net: rework the driver to support multiple openNikunj A Dadhania1-11/+13
Found that virtio-net is using a around 200K receive buffer per device, if we connect more than 40 virtio-net devices the heap(8MB) gets over. Because of which allocation starts failing and the VM does not boot. Moreover, the driver did not support opening multiple device, which is possible using the OF client interface. As it was using globals to store the state information of the driver. Now the driver allocates a virtio_net structure during device open stage and fills in the state information. This details are used during various device functions and finally for cleaning up on close operation. Now as the buffer memory is allocated during open and freed during the close operations the heap usage is contained. Reported-by: Satheesh Rajendran <sathnaga@linux.vnet.ibm.com> Signed-off-by: Nikunj A Dadhania <nikunj@linux.vnet.ibm.com> Reviewed-by: Thomas Huth <thuth@redhat.com> Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
2016-11-24virtio: Implement block write supportThomas Huth1-1/+10
Refactor the virtio-block code a little bit to provide block write access, too. Write access to the first 34 sectors is not allowed, though, to avoid that the user / client program accidentially destroys the partition table. Signed-off-by: Thomas Huth <thuth@redhat.com> Reviewed-by: Nikunj A Dadhania <nikunj@linux.vnet.ibm.com> Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
2016-11-10virtio: Fix stack comment of virtio-blk-readThomas Huth1-1/+1
The real parameters differ from the current stack comment. Signed-off-by: Thomas Huth <thuth@redhat.com> Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
2016-10-13Add virtio-serial device supportNikunj A Dadhania1-0/+33
Add support for virtio serial device to be used as a console device. Currently, SLOF only supports spapr-vty device. With this addition virtio console can be used during boot. Signed-off-by: Nikunj A Dadhania <nikunj@linux.vnet.ibm.com> Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
2016-02-08virtio: add and enable 1.0 device setupNikunj A Dadhania1-0/+5
Introduce parsing routines for virtio capabilities. This would also determine whether we need to function in legacy mode or virtio 1.0. Update routine to start using the base address from the updated legacy structure. With the removal for base address setting in the Forth code and most of the device setup happening in C code, code in virtio.fs is redundant. Remove virtio.fs and move the allocation of the virtio_device structure to the C code instead of the Forth code in individual files. Also, drop the packed attribute for the virtio_{device,cap} structure. The structure is not shared anymore. Drivers need to negotiate the 1.0 feature capability before starting to use 1.0. Disable it in all the drivers until 1.0 is enabled. Signed-off-by: Nikunj A Dadhania <nikunj@linux.vnet.ibm.com> Reviewed-by: Thomas Huth <thuth@redhat.com> Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
2016-02-08virtio-net: move setup-mac to the open routineNikunj A Dadhania1-5/+3
MAC reading should be done after the initialization of the device after the features negotiation. Adjust the open routine accordingly. There is no point in sending the mac address to the virtionet_open. Change the signature. Also read the mac address directly from the config space to remove the dependency of getting the mac address from the open routine. Signed-off-by: Nikunj A Dadhania <nikunj@linux.vnet.ibm.com> Reviewed-by: Thomas Huth <thuth@redhat.com> Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
2016-02-08virtio: fix code style/design issues.Nikunj A Dadhania1-7/+7
The patch does not make any functional changes. Signed-off-by: Nikunj A Dadhania <nikunj@linux.vnet.ibm.com> Reviewed-by: Thomas Huth <thuth@redhat.com> Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
2014-04-25virtio-blk: support variable block sizeNikunj A Dadhania1-3/+3
Current code only works with 512 bytes read. Moreover, Qemu ignores the guest set features request. In the set features request SLOF indicates to qemu that it is not support VIRTIO_BLK_F_BLK_SIZE feature. Code in qemu suggests that virtio-blk is not implementing set_guest_feature. Tested-by: Bharata B Rao <bharata@linux.ibm.com> Reviewed-by: Thomas Huth <thuth@linux.vnet.ibm.com> Signed-off-by: Nikunj A Dadhania <nikunj@linux.vnet.ibm.com>
2013-10-04Add virtio-net driver in libvirtioAvik Sil1-0/+43
Signed-off-by: Avik Sil <aviksil@linux.vnet.ibm.com> Signed-off-by: Nikunj A Dadhania <nikunj@linux.vnet.ibm.com>
2013-06-05SLOF: virtio-scsi helper routinesNikunj A. Dadhania1-0/+27
* initialize/shutdown virtio-scsi device * routine for sending scsi commands to virtio-scsi device [ Modified to pass the whole virtio req/resp from forth to allow better handling of status and sense buffer -- BenH ] Signed-off-by: Nikunj A. Dadhania <nikunj@linux.vnet.ibm.com> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2013-05-21virtio: Add a virtio-set-qaddr helperNikunj A. Dadhania1-0/+8
A simple function that can be used from forth code for setting virtqueue address. virito-scsi has multiple virtqueues(atleast 3) and need to use set queue address for all the 3 queues. Signed-off-by: Nikunj A. Dadhania <nikunj@linux.vnet.ibm.com> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2012-01-19Add virtfs supportBenjamin Herrenschmidt1-0/+33
Code originally written by Timothy Rule and reworked & bug fixed by myself Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2012-01-19Move virtio to a separate libraryBenjamin Herrenschmidt1-0/+53
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>