Skip to content

Commit c802cf2

Browse files
virtio-msg: convert correlation to normative
Signed-off-by: Bertrand Marquis <bertrand.marquis@arm.com>
1 parent d1b3d60 commit c802cf2

1 file changed

Lines changed: 16 additions & 19 deletions

File tree

transport-msg.tex

Lines changed: 16 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -447,30 +447,27 @@ \subsubsection{Common Message Format}
447447
\subsubsection{Message Correlation}
448448
\label{sec:Virtio Transport Options / Virtio Over Messages / Basic Concepts / Correlation}
449449

450-
Messages are either requests or events. Requests require a response. Events are
451-
one way and do not have a response. Most requests defined today originate at the
452-
driver side but bus message requests such as \busref{PING} MAY originate at
453-
either driver side or device side.
450+
Requests expect responses, whereas events are one-way and do not. Correlation is
451+
based on the tuple (\field{dev_num}, \field{token}) from the message header.
454452

455-
This section defines how responses are correlated to requests. An implementation
456-
does not need to support sending multiple requests in parallel but these rules
457-
allow for that possibility.
458-
459-
The token field in the message header is part of a tuple that is unique during
460-
a request to response interval.
453+
\drivernormative{\paragraph}{Message Correlation (Driver)}{Virtio Transport Options / Virtio Over Messages / Basic Concepts / Correlation / Driver}
461454
\begin{itemize}
462-
\item Message tuple: ( \field{dev_num}, \field{token} ).
455+
\item A driver MUST assign a non-zero \field{token} for each outstanding request so that the
456+
(\field{dev_num}, \field{token}) tuple remains unique among inflight requests.
457+
\item A driver MUST set \field{token}=0 when sending event (one-way) messages and MUST ignore any
458+
error responses purportedly referencing such events.
459+
\item When processing responses, a driver SHOULD discard any response whose correlation tuple does
460+
not match an outstanding request.
463461
\end{itemize}
464462

465-
Rules:
463+
\devicenormative{\paragraph}{Message Correlation (Device)}{Virtio Transport Options / Virtio Over Messages / Basic Concepts / Correlation / Device}
466464
\begin{itemize}
467-
\item The request originator assigns a non-zero \field{token} for every
468-
request such that the tuple is unique for all inflight requests.
469-
\item Event (one-way) messages MUST set \field{token}=0
470-
\item A response MUST echo \field{token} and \field{dev_num}.
471-
\item Reception of unknown or already completed correlation tuples
472-
SHOULD result in discarding the response without further protocol
473-
action.
465+
\item A device MUST echo the \field{token} and \field{dev_num} from the corresponding request when
466+
generating a response.
467+
\item A device MUST set \field{token}=0 when generating event (one-way) messages and MUST NOT send
468+
error responses referencing those events.
469+
\item A device SHOULD discard responses from the other side that reference a correlation tuple that
470+
is unknown or already completed.
474471
\end{itemize}
475472

476473
\subsection{Device Discovery}\label{sec:Virtio Transport Options / Virtio Over Messages / Device Discovery}

0 commit comments

Comments
 (0)