public inbox for virtualization@lists.linux-foundation.org
 help / color / mirror / Atom feed
From: Shunsuke Mie <mie@igel.co.jp>
To: Lorenzo Pieralisi <lpieralisi@kernel.org>
Cc: "Kishon Vijay Abraham I" <kishon@kernel.org>,
	"Krzysztof Wilczyński" <kw@linux.com>,
	"Randy Dunlap" <rdunlap@infradead.org>,
	"Michael S. Tsirkin" <mst@redhat.com>,
	linux-pci@vger.kernel.org,
	"Manivannan Sadhasivam" <mani@kernel.org>,
	"Frank Li" <Frank.Li@nxp.com>,
	linux-kernel@vger.kernel.org,
	virtualization@lists.linux-foundation.org,
	"Ren Zhijie" <renzhijie2@huawei.com>,
	"Shunsuke Mie" <mie@igel.co.jp>, "Jon Mason" <jdmason@kudzu.us>,
	"Bjorn Helgaas" <bhelgaas@google.com>
Subject: [RFC PATCH v2 0/3] Introduce a PCIe endpoint virtio console
Date: Thu, 27 Apr 2023 19:44:25 +0900	[thread overview]
Message-ID: <20230427104428.862643-1-mie@igel.co.jp> (raw)

PCIe endpoint framework provides APIs to implement PCIe endpoint function.
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

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
link: https://lore.kernel.org/linux-pci/20230113090350.1103494-1-mie@igel.co.jp/
- [PATCH v3] vringh: IOMEM support
link: https://lore.kernel.org/virtualization/CACGkMEumt4p7jU+H+T-b9My0buhdS8a-1GCSnWjnCwMAM=wo1Q@mail.gmail.com/T/#t

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 next-20230416 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
    functionality

 drivers/pci/endpoint/functions/Kconfig        |  19 +
 drivers/pci/endpoint/functions/Makefile       |   2 +
 drivers/pci/endpoint/functions/pci-epf-vcon.c | 596 ++++++++++++++++++
 .../pci/endpoint/functions/pci-epf-virtio.c   | 458 ++++++++++++++
 .../pci/endpoint/functions/pci-epf-virtio.h   | 126 ++++
 include/uapi/linux/virtio_pci.h               |   3 +
 6 files changed, 1204 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

-- 
2.25.1

_______________________________________________
Virtualization mailing list
Virtualization@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/virtualization

             reply	other threads:[~2023-04-27 10:44 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-27 10:44 Shunsuke Mie [this message]
2023-04-27 10:44 ` [RFC PATCH v2 1/3] PCI: endpoint: introduce a helper to implement pci ep virtio function Shunsuke Mie
2023-04-27 18:28   ` Bjorn Helgaas
2023-05-10  3:49     ` Shunsuke Mie
2023-05-08  3:57   ` Jason Wang
2023-04-27 10:44 ` [RFC PATCH v2 2/3] virtio_pci: add a definition of queue flag in ISR Shunsuke Mie
2023-05-08  3:59   ` Jason Wang
2023-05-10  3:18     ` Shunsuke Mie
2023-04-27 10:44 ` [RFC PATCH v2 3/3] PCI: endpoint: Add EP function driver to provide virtio-console functionality Shunsuke Mie
2023-04-27 18:09   ` Bjorn Helgaas
2023-05-10  1:25     ` Shunsuke Mie
2023-05-08  4:03   ` Jason Wang
2023-05-10  3:17     ` Shunsuke Mie
2023-05-18  9:54       ` Shunsuke Mie
2023-05-19  2:01         ` Jason Wang
2023-05-31 10:51           ` Shunsuke Mie
2023-04-27 17:52 ` [RFC PATCH v2 0/3] Introduce a PCIe endpoint virtio console Bjorn Helgaas

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230427104428.862643-1-mie@igel.co.jp \
    --to=mie@igel.co.jp \
    --cc=Frank.Li@nxp.com \
    --cc=bhelgaas@google.com \
    --cc=jdmason@kudzu.us \
    --cc=kishon@kernel.org \
    --cc=kw@linux.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=lpieralisi@kernel.org \
    --cc=mani@kernel.org \
    --cc=mst@redhat.com \
    --cc=rdunlap@infradead.org \
    --cc=renzhijie2@huawei.com \
    --cc=virtualization@lists.linux-foundation.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox