Re: [PATCH RFC v2 1/1] virtio-msg: Add virtio-msg, a message based virtio transport layer
Bill Mills <[email protected]>
| Newsgroups | dev.linux.lists.virtio-comment |
|---|---|
| Message-ID | <[email protected]> |
Hello Matias,
On 9/10/25 9:39 AM, Matias Ezequiel Vara Larsen wrote:
> Hello,
>
> Thanks for submission. I am still reading this RFC. I left some minor
> comments below though.
>
I will incorpertate all your editorial comments you made. Thanks for looking.
I will respond to your questions below ...
> On Fri, Jun 20, 2025 at 06:44:26PM -0400, Bill Mills wrote:
>> Add a new transport layer that is based on messages.
>>
>> This transport layer still uses virtqueues as the other transport layers do
>> but implements transport layer operations by sending and receiving messages
>> instead of the "MMR" reads and writes used in virtio-mmio and virtio-pci.
>
> I guess virtqueues are still on a region of memory shared between the
> device and the driver and a msgs mechanism is not required to access it.
>
Yes, the memory used for virtqueues and for buffers in those virtqueues is
shared between driver and device somehow.
In my OSS NA presentation I disucss various memory models as I think about
them anyway.
See slide 11 here:
https://static.sched.com/hosted_files/ossna2025/a6/Virtio-msg-OSS-NA-2025-v1.1.pdf
[snip]
>> +The fields in this header have the following usage:
>> +\begin{itemize}
>> + \item \field{type}:
>> + \begin{itemize}
>> + \item Bit[0]: Identifies if a message is a request (0) or a response
>> + to a request (1).
>> + \item Bit[1]: Identifies if a message is a Transport Message (0) or a
>> + Bus Message (1).
>> + \item Bit[2-7] Are reserved for future use and must be zero.
>> + \end{itemize}
>> + \item \field{msg_id}:
>> + Uniquely identifies which message definition applies (e.g., GET_DEVICES,
>> + GET_DEVICE_FEATURES, SET_CONFIG). The specific range or enumeration of types is
>> + defined in sections \ref{sec:Virtio Transport Options / Virtio Over Messages / Transport Messages}
>> + and \ref{sec:Virtio Transport Options / Virtio Over Messages / Bus Messages}.
>> + \item \field{dev_num}:
>> + Identifies the Device Number the message is targeting or is coming from for
>> + Transport Message and must be zero of Bus messages.
>
> I imagine that the `dev_num` is the mechanism that the bus uses to find
> the correct destination for a msg both when the driver or the device
> sends it, right?.
>
That is correct. A bus can have multiple devices and dev_num (a simple
ordinal index) defines which one. The ordinal space may be sparse.
Thanks again,
Bill