[SLOF] [PATCH] virtio-net: rework the driver to support multiple open

Thomas Huth thuth at redhat.com
Fri Aug 4 17:19:23 AEST 2017


On 03.08.2017 12:14, Nikunj A Dadhania wrote:
> 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 at linux.vnet.ibm.com>
> Signed-off-by: Nikunj A Dadhania <nikunj at linux.vnet.ibm.com>
> ---
>  board-qemu/slof/virtio-net.fs |   4 +-
>  lib/libvirtio/virtio-net.c    | 172 +++++++++++++++++++++++-------------------
>  lib/libvirtio/virtio-net.h    |  16 +++-
>  lib/libvirtio/virtio.c        |   7 ++
>  lib/libvirtio/virtio.code     |  24 +++---
>  lib/libvirtio/virtio.h        |   1 +
>  6 files changed, 130 insertions(+), 94 deletions(-)

Looks fine to me!

Reviewed-by: Thomas Huth <thuth at redhat.com>


More information about the SLOF mailing list