diff options
author | Nikunj A Dadhania <nikunj@linux.vnet.ibm.com> | 2017-08-03 15:44:59 +0530 |
---|---|---|
committer | Alexey Kardashevskiy <aik@ozlabs.ru> | 2017-08-07 18:24:58 +1000 |
commit | 685af54d8a47a42d9d06c51be45870f6f210a0dc (patch) | |
tree | dc2c0088436e627e85bbdc48e755f68fe5737d26 /lib/libvirtio/virtio.h | |
parent | 604d28cc3f791657414f8b21103921fa0147fc63 (diff) | |
download | SLOF-685af54d8a47a42d9d06c51be45870f6f210a0dc.zip SLOF-685af54d8a47a42d9d06c51be45870f6f210a0dc.tar.gz SLOF-685af54d8a47a42d9d06c51be45870f6f210a0dc.tar.bz2 |
virtio-net: rework the driver to support multiple open
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>
Diffstat (limited to 'lib/libvirtio/virtio.h')
-rw-r--r-- | lib/libvirtio/virtio.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/lib/libvirtio/virtio.h b/lib/libvirtio/virtio.h index 0fee4ba..389355c 100644 --- a/lib/libvirtio/virtio.h +++ b/lib/libvirtio/virtio.h @@ -110,6 +110,7 @@ extern void virtio_fill_desc(struct vring_desc *desc, bool is_modern, uint64_t addr, uint32_t len, uint16_t flags, uint16_t next); extern int virtio_queue_init_vq(struct virtio_device *dev, struct vqs *vq, unsigned int id); +extern void virtio_queue_term_vq(struct virtio_device *dev, struct vqs *vq, unsigned int id); extern struct virtio_device *virtio_setup_vd(void); extern void virtio_reset_device(struct virtio_device *dev); |