Skip to content

Commit c7848cb

Browse files
committed
virtio-msg: fix up message correlation protocol
* change msg_uid to token and msg_op back to msg_id * More explicitly define tuple * Use "request originator" not "driver" * Restate that Requests have responses and Events don't in intro then drop those qualifications from the rules. Otherwise it sounds like some requests might not have responses and some events might have them * Specify that an implementation does not need to support sending multiple requests in parallel * Use the word "assign" not "allocate" as it is less suggestive of implementation choice Signed-off-by: Bill Mills <bill.mills@linaro.org>
1 parent 09247a0 commit c7848cb

1 file changed

Lines changed: 21 additions & 11 deletions

File tree

transport-msg.tex

Lines changed: 21 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -335,22 +335,32 @@ \subsubsection{Common Message Format}
335335
\subsubsection{Message Correlation}
336336
\label{sec:Virtio Transport Options / Virtio Over Messages / Basic Concepts / Correlation}
337337

338-
Correlation associates a response with its request:
338+
Messages are either requests or events. Requests require a response. Events are
339+
one way and do not have a response. Most requests defined today originate at the
340+
driver side but bus message requests such as \busref{PING} may originate at
341+
either driver side or device side.
342+
343+
This section defines how responses are correlated to requests. An implementation
344+
does not need to support sending multiple requests in parallel but these rules
345+
allow for that possibility.
346+
347+
The token field in the message header is part of a tuple that is unique during
348+
a request to response interval.
339349
\begin{itemize}
340-
\item Bus Message key: \field{msg_uid}.
341-
\item Transport Message key: (\field{dev_num}, \field{msg_uid}).
350+
\item Bus Message tuple: ( 1, 0, \field{token} ).
351+
\item Transport Message tuple: ( 0, \field{dev_num}, \field{token} ).
342352
\end{itemize}
343353

344354
Rules:
345355
\begin{itemize}
346-
\item The driver allocates a non-zero \field{msg_uid} for every request that
347-
expects a response and \textbf{MUST NOT} reuse it while in flight.
348-
\item Event (one-way) messages \textbf{MUST} set \field{msg_uid}=0 and MUST
349-
NOT yield a response.
350-
\item A response \textbf{MUST} echo \field{msg_uid}, \field{dev_num} (for
351-
transport), and \field{msg_op}.
352-
\item Unknown or already completed correlation tuples \textbf{SHOULD} result
353-
in discarding the response without further protocol action.
356+
\item The request originator assigns a non-zero \field{token} for every
357+
request such that the tuple is unique for all inflight requests.
358+
\item Event (one-way) messages \textbf{MUST} set \field{token}=0
359+
\item A response \textbf{MUST} echo \field{token}, \field{dev_num} (for
360+
transport), and \field{msg_id}.
361+
\item Reception of unknown or already completed correlation tuples
362+
\textbf{SHOULD} result in discarding the response without further protocol
363+
action.
354364
\item Implementations \textbf{MAY} deliver responses out of order unless a
355365
specific message definition mandates ordering.
356366
\end{itemize}

0 commit comments

Comments
 (0)