[U-Boot] [PATCH 21/27] virtio: Add virtio over pci transport driver

Bin Meng bmeng.cn at gmail.com
Thu Oct 11 13:39:59 UTC 2018


Hi Simon,

On Thu, Sep 27, 2018 at 9:43 PM Simon Glass <sjg at chromium.org> wrote:
>
> Hi Bin,
>
> On 23 September 2018 at 06:42, Bin Meng <bmeng.cn at gmail.com> wrote:
> > This adds a transport driver that implements UCLASS_VIRTIO for
> > virtio over pci, which is commonly used on x86.
> >
> > It only supports the legacy interface of the pci transport, which
> > is the default device that QEMU emulates.
> >
> > Signed-off-by: Bin Meng <bmeng.cn at gmail.com>
> > ---
> >
> >  drivers/virtio/Kconfig      |   8 +
> >  drivers/virtio/Makefile     |   1 +
> >  drivers/virtio/virtio_pci.c | 420 ++++++++++++++++++++++++++++++++++++++++++++
> >  drivers/virtio/virtio_pci.h | 173 ++++++++++++++++++
> >  4 files changed, 602 insertions(+)
> >  create mode 100644 drivers/virtio/virtio_pci.c
> >  create mode 100644 drivers/virtio/virtio_pci.h
>
> Reviewed-by: Simon Glass <sjg at chromium.org>
>
> vring_create_virtqueue() should return an error I think - you assume -ENOMEM
>

It returns a NULL pointer and the error is -ENOMEM, which will be
checked by the caller via IS_ERR()

> That is a huge table of PCI devices. Can you use a class instead?

Unfortunately we can't. The virtio spec does not define a dedicated class.

Regards,
Bin


More information about the U-Boot mailing list