public inbox for linux-rdma@vger.kernel.org
 help / color / mirror / Atom feed
From: Doug Miller <doug.miller@cornelisnetworks.com>
To: Mathieu Poirier <mathieu.poirier@linaro.org>,
	Dennis Dalessandro <dennis.dalessandro@cornelisnetworks.com>
Cc: linux-remoteproc@vger.kernel.org,
	Bjorn Andersson <andersson@kernel.org>,
	OFED mailing list <linux-rdma@vger.kernel.org>
Subject: Re: Using RPMSG to communicate between host and guest drivers
Date: Mon, 26 Aug 2024 12:22:01 -0500	[thread overview]
Message-ID: <59cd0c1c-b5a0-471a-810d-65d42b021760@cornelisnetworks.com> (raw)
In-Reply-To: <CANLsYkx2OThcBjs1Qn_Bgd0LE1+EN7c0Dh7NE=1dEBB4xqS9cQ@mail.gmail.com>

On 8/26/2024 11:50 AM, Mathieu Poirier wrote:
> Apologies for the late reply - this got lost in the vacation email backlog.
>
> On Mon, 26 Aug 2024 at 10:27, Dennis Dalessandro
> <dennis.dalessandro@cornelisnetworks.com> wrote:
>> On 7/31/24 4:02 PM, Doug Miller wrote:
>>> I am working on SR-IOV support for a new adapter which has shared
>>> resources between the PF and VFs and requires an out-of-band (outside
> It would have been a good idea to let people know what "PF" and "VF"
> means to avoid confusion.
"PF" refers to the Physical Function of the PCI adapter - that which
exists always, regardless of whether SR-IOV is active. The "VF" refers
to the virtual function(s) that are created when SR-IOV is enabled and
configured. Typically, the VFs and the PF are assigned to different OS
instances running in different VMs. So, the OS that owns the PF needs to
be able to handle resource requests from the OSes that own the VFs (and
also send notifications).
>
>>> the adapter) communication mechanism to manage those resources. I have
>>> been looking at RPMSG as a mechanism to communicate between the driver
>>> on a guest (VM) and the driver on the host OS (which "owns" the
>>> resources). It appears to me that virtio is intended for communication
>>> between guests and host, and RPMSG over virtio is what I want to use.
>>>
> Virtio is definitely the standard way to convey information between a
> host and a guest.  You can specify as many virtqueues as needed
> (in-band and out-of-band) and it is widely supported.  What
> information is conveyed by the virtqueues and how it gets conveyed is
> entirely up to the use case.  Have a look at the specification of
> existing virtio drivers to get a better idea [1].  If the driver you
> are working with hasn't been standardised, I highly encourage you to
> submit a draft for it.  If it has then add to the current
> specification.
>
> All that said, you could use RPMSG as the protocol that runs on top of
> the virtqueues - that should be fairly easy to do.
I had initially started looking at using virtio directly, but it looked
like I was going to have to get a new device ID defined upstream and it
would be a significant effort compared to using an existing facility. I
then saw device ID VIRTIO_ID_RPMSG, which appears to be exactly what
we'd have to create if we were defining a new virtio device for what we
need. However, the problem has been understanding how to write code to
provide the rpmsg "device" side. There does not appear to be any
documentation and there is no example code to follow. It seems that the
device side is typically contained in a GPU or accelerator, which was
not written for a Linux kernel. So I have many questions on how (and
when) to use the interfaces (rpmsg_register_device,
rpmsg_create_channel, rpmsg_create_ept, rpmsg_find_device, ...).
>
> Thanks,
> Mathieu
>
> [1]. https://docs.oasis-open.org/virtio/virtio/v1.2/csd01/virtio-v1.2-csd01.html
>
>>> Can anyone confirm that RPMSG is capable of doing what we need? If so,
>>> I'll need some help figuring out how to use that from kernel device
>>> drivers (I've not been able to find any examples of doing the
>>> service/device side). If not, is there some other facility that is
>>> better suited?
>> Hi Bjorn and Mathieu, any advice here for Doug? Adding linux-rdma folks as that
>> is where this will eventually target.
>>
>> -Denny
>>

External recipient

  reply	other threads:[~2024-08-26 17:22 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <133c1301-dd19-4cce-82dc-3e8ee145c594@cornelisnetworks.com>
2024-08-26 16:27 ` Using RPMSG to communicate between host and guest drivers Dennis Dalessandro
2024-08-26 16:50   ` Mathieu Poirier
2024-08-26 17:22     ` Doug Miller [this message]
2024-08-28 14:44       ` Mathieu Poirier
2024-08-28 15:34         ` Doug Miller
2024-08-26 23:45   ` Jason Gunthorpe
2024-08-28 11:49     ` Doug Miller
2024-08-28 14:17       ` Jason Gunthorpe

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=59cd0c1c-b5a0-471a-810d-65d42b021760@cornelisnetworks.com \
    --to=doug.miller@cornelisnetworks.com \
    --cc=andersson@kernel.org \
    --cc=dennis.dalessandro@cornelisnetworks.com \
    --cc=linux-rdma@vger.kernel.org \
    --cc=linux-remoteproc@vger.kernel.org \
    --cc=mathieu.poirier@linaro.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