Re: [EXT] [RFC PATCH 0/3] Introduce a PCIe endpoint virtio console

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]


On 2023/04/14 23:39, Frank Li wrote:

-----Original Message-----
From: Shunsuke Mie <mie@xxxxxxxxxx>
Sent: Friday, April 14, 2023 7:39 AM
To: Lorenzo Pieralisi <lpieralisi@xxxxxxxxxx>
Cc: Krzysztof Wilczyński <kw@xxxxxxxxx>; Manivannan Sadhasivam
<mani@xxxxxxxxxx>; Kishon Vijay Abraham I <kishon@xxxxxxxxxx>; Bjorn
Helgaas <bhelgaas@xxxxxxxxxx>; Michael S. Tsirkin <mst@xxxxxxxxxx>;
Jason Wang <jasowang@xxxxxxxxxx>; Shunsuke Mie <mie@xxxxxxxxxx>;
Frank Li <>; Jon Mason <jdmason@xxxxxxxx>; Randy
Dunlap <rdunlap@xxxxxxxxxxxxx>; Ren Zhijie <renzhijie2@xxxxxxxxxx>;
linux-kernel@xxxxxxxxxxxxxxx; linux-pci@xxxxxxxxxxxxxxx;
Subject: [EXT] [RFC PATCH 0/3] Introduce a PCIe endpoint virtio console

Caution: EXT Email

PCIe endpoint framework provides APIs to implement PCIe endpoint
This framework allows defining various PCIe endpoint function behaviors in
software. This patch extend the framework for virtio pci device. The
virtio is defined to communicate guest on virtual machine and host side.
Advantage of the virtio is the efficiency of data transfer and the conciseness
of implementation device using software. It also be applied to PCIe
endpoint function.

We designed and implemented a PCIe EP virtio console function driver using
the extended PCIe endpoint framework for virtio. It can be communicate
host and endpoint over virtio as console.

An architecture of the function driver is following:

  ┌────────────┐         ┌──────────────
  │virtio      │         │                      │virtio      │
  │console drv │         ├───────────────┐      │console
drv │
  ├────────────┤         │(virtio console│      ├─────
  │ virtio bus │         │ device)       │◄────►│ virtio bus │
  ├────────────┤         ├---------------┤      └──────
  │            │         │ pci ep virtio │                   │
  │  pci bus   │         │  console drv  │                   │
  │            │  pcie   ├───────────────┤                   │
  │            │ ◄─────► │  pci ep Bus   │                   │
  └────────────┘         └──────────────
    PCIe Root              PCIe Endpoint

[Frank Li] Some basic question,
I see you call register_virtio_device at epf_vcon_setup_vdev,
Why call it as virtio console?  I suppose it should be virtiobus directly?

I'm sorry I didn't understand your question. What do you mean the virtiobus directly?

Previous you use virtio-net, why change to virtio-console here?  Does it matter?

No, it doesn't. Just I'd like to break down the changes into smaller steps to make it easier to review and merge the changes.

As a first step, I propose adding a simplest virtio function driver with the extension defined in pci-epf-virtio.{h,c}.

All virtio-XXX should work?
Yes, the extension is designed to use any type of virtio device.

You removed EDMA support this version?
I planed the support will be added with epf virtio-net patches.

Introduced driver is `pci ep virtio console drv` in the figure. It works
as ep function for PCIe root and virtual virtio console device for PCIe
endpoint. Each side of virtio console driver has virtqueue, and
introduced driver transfers data on the virtqueue to each other. A data
on root tx queue is transfered to endpoint rx queue and vice versa.

This patchset is depend follwing patches which are under discussion.

- [RFC PATCH 0/3] Deal with alignment restriction on EP side
- [RFC PATCH v2 0/7] Introduce a vringh accessor for IO memory

First of this patchset is introduce a helper function to realize pci
virtio function using PCIe endpoint framework. The second one is adding
a missing definition for virtio pci header. The last one is for PCIe
endpoint virtio console driver.

This is tested on linux-20230406 and RCar S4 board as PCIe endpoint.

Shunsuke Mie (3):
   PCI: endpoint: introduce a helper to implement pci ep virtio function
   virtio_pci: add a definition of queue flag in ISR
   PCI: endpoint: Add EP function driver to provide virtio-console

  drivers/pci/endpoint/functions/Kconfig        |  19 +
  drivers/pci/endpoint/functions/Makefile       |   2 +
  drivers/pci/endpoint/functions/pci-epf-vcon.c | 554 ++++++++++++++++++
  .../pci/endpoint/functions/pci-epf-virtio.c   | 469 +++++++++++++++
  .../pci/endpoint/functions/pci-epf-virtio.h   | 123 ++++
  include/uapi/linux/virtio_pci.h               |   3 +
  6 files changed, 1170 insertions(+)
  create mode 100644 drivers/pci/endpoint/functions/pci-epf-vcon.c
  create mode 100644 drivers/pci/endpoint/functions/pci-epf-virtio.c
  create mode 100644 drivers/pci/endpoint/functions/pci-epf-virtio.h

Virtualization mailing list

[Index of Archives]     [KVM Development]     [Libvirt Development]     [Libvirt Users]     [CentOS Virtualization]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite Forum]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux