Skip to content

Commit 09247a0

Browse files
bertrand-marquiswmamills
authored andcommitted
virtio-msg: introduce a message correlation protocol
Add a sub-section to do a first explanation draft of how the message correlation is to be done using a combination of a message device number and the message unique identifier value. Signed-off-by: Bertrand Marquis <bertrand.marquis@arm.com>
1 parent f8b2164 commit 09247a0

1 file changed

Lines changed: 23 additions & 0 deletions

File tree

transport-msg.tex

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -332,6 +332,29 @@ \subsubsection{Common Message Format}
332332
sent as zero and \textbf{MUST} be ignored on receive to preserve forward
333333
compatibility.
334334

335+
\subsubsection{Message Correlation}
336+
\label{sec:Virtio Transport Options / Virtio Over Messages / Basic Concepts / Correlation}
337+
338+
Correlation associates a response with its request:
339+
\begin{itemize}
340+
\item Bus Message key: \field{msg_uid}.
341+
\item Transport Message key: (\field{dev_num}, \field{msg_uid}).
342+
\end{itemize}
343+
344+
Rules:
345+
\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.
354+
\item Implementations \textbf{MAY} deliver responses out of order unless a
355+
specific message definition mandates ordering.
356+
\end{itemize}
357+
335358
\subsection{Bus Operation}
336359
\label{sec:Virtio Transport Options / Virtio Over Messages / Bus Operation}
337360

0 commit comments

Comments
 (0)