[SLOF] [PATCH v2 08/19] virtio-net: simplify and cleanup driver

Thomas Huth thuth at redhat.com
Thu Jan 21 06:18:36 AEDT 2016


On 20.01.2016 13:10, Nikunj A Dadhania wrote:
> * Get rid of PCI virtio defines

What do you mean with "PCI virtio defines"? I did not see anything
related to PCI in this patch?

> * Replace array of vq with two different vq_{tx,rx}
> * Use virtio_fill_desc

Not urgent, but in case you rework this anyway: You could also do these
two steps in two patches to increase readability.

> Signed-off-by: Nikunj A Dadhania <nikunj at linux.vnet.ibm.com>
> ---
>  lib/libvirtio/virtio-net.c | 82 ++++++++++++++++++++--------------------------
>  1 file changed, 35 insertions(+), 47 deletions(-)
> 
> diff --git a/lib/libvirtio/virtio-net.c b/lib/libvirtio/virtio-net.c
> index cafaa4b..672e631 100644
> --- a/lib/libvirtio/virtio-net.c
> +++ b/lib/libvirtio/virtio-net.c
> @@ -38,7 +38,8 @@
>  #define sync()  asm volatile (" sync \n" ::: "memory")
>  
>  struct virtio_device virtiodev;
> -struct vqs vq[2];     /* Information about virtqueues */
> +struct vqs vq_rx;     /* Information about virtqueues */
> +struct vqs vq_tx;

I know, I know, I originally wrote that code (mea culpa!) ... but
anyway, could you please make these variables at least "static"
nowadays? Or even better, move them to a struct virtio_device
dev->private field or so?

 Thomas



More information about the SLOF mailing list