-
Notifications
You must be signed in to change notification settings - Fork 2
Proposed changes Oct 16: token and response matching, error handling, redundant messages sizes and editorial input from Matias and Peter #25
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Move the header to be 8 bytes and include a unique identifier that can be use to correlate request to responses. Rename the msg_id field to msg_op as having a msg_id and msg_uid field and using identifiers in 2 contexts would have been unclear. Rework ID to OP and change wording message identifer to message operation to be coherent in the rest of the specification. Signed-off-by: Bertrand Marquis <bertrand.marquis@arm.com>
This reverts commit 4c2274c. Signed-off-by: Bill Mills <bill.mills@linaro.org>
Rename these as agreed in the meeting on Oct 17. Signed-off-by: Bill Mills <bill.mills@linaro.org>
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>
* 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>
Relax error handling in the virtio-msg bus and introduce wording to allow the virtio-msg bus to report error to the virtio-msg transport if a request could not be transmited or a malformed response was received. This prevents the need to generate dummy responses in the bus and make the specification coherent with the current Linux PoC implementation. Signed-off-by: Bertrand Marquis <bertrand.marquis@arm.com>
9a04b02 to
bf96f3c
Compare
* change msg_op back to msg_id Signed-off-by: Bill Mills <bill.mills@linaro.org>
bf96f3c to
0454e72
Compare
bertrand-marquis
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some minor comments.
I am also not really a fan of removing the size fields in specific messages as it makes the computation and text a bit more complex.
transport-msg.tex
Outdated
| \item The request originator assigns a non-zero \field{token} for every | ||
| request such that the tuple is unique for all inflight requests. | ||
| \item Event (one-way) messages \textbf{MUST} set \field{token}=0 | ||
| \item A response \textbf{MUST} echo \field{token}, \field{dev_num} (for |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
even for bus messages, dev_num (which should be 0) should be echoed. SO i suggest remove "(for transport)"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@bertrand-marquis This should be updated in this PR with a new commit.
If you agree please close this part of the convo; if not add comments to that commit
transport-msg.tex
Outdated
| request such that the tuple is unique for all inflight requests. | ||
| \item Event (one-way) messages \textbf{MUST} set \field{token}=0 | ||
| \item A response \textbf{MUST} echo \field{token}, \field{dev_num} (for | ||
| transport), and \field{msg_id}. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we might want to remove msg_id here. Correlation should only be based on dev_num and token.
In some cases, the bus might use a different message id for responses.
I have 2 examples in ffa bus:
- event poll which returns an event as response to a poll
- bus error messages which are returned in case of error to a request
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK, can we then also say that dev_num should match even in the case of bus messages? After all 0 == 0.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@bertrand-marquis same for this one and others
transport-msg.tex
Outdated
| \textbf{SHOULD} result in discarding the response without further protocol | ||
| action. | ||
| \item Implementations \textbf{MAY} deliver responses out of order unless a | ||
| specific message definition mandates ordering. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we have this case ?
I am wondering if we should not completely remove the "unless ..." here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are cases where order has to be enforced but I don't think it is mandated by the "message definition" and I think it is up to the sender to wait for responses before sending new messages.
So, yes, I think we can drop the last sentence
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
transport-msg.tex
Outdated
| \msgref{SET_CONFIG}, providing: | ||
| \begin{itemize} | ||
| \item \textbf{Offset} and \textbf{Number of bytes}, | ||
| \item \textbf{Offset}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the paragraph just before we say that the driver supplies "offset and number of bytes". We might want to update that part or specify here that the number of bytes is deducted from the payload size in the header
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
dropped this commit
transport-msg.tex
Outdated
| A feature block is a group of 32 bits. The feature data \emph{MUST} be a | ||
| multiple of 4 bytes in length. | ||
| multiple of 4 bytes in length. The number of feature blocks is calculated from | ||
| the message length in the common message header. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe we would make all that simpler by no enforcing feature blocks of 32bits.
But i am really not a fan of removing those size fields after reading the result
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
dropped this commit
edgarigl
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure if itwas intentional but you may have forgotten to remove the number of blocks from the get_features response (I understand it must be there in the get_features request).
Looking at get_config, the number of bytes is in the request but not in the response.
|
@edgarigl said "Not sure if itwas intentional but you may have forgotten to remove the number of blocks from the get_features response" OK if we keep the commit, I will fix that |
* drop 'underlying'
* add MUST to Optional Bus Messages
* s/tables/table/
(Matias suggested s/defines/define/ but there is only one table ATM)
(Also change table defines to table lists to avoid double "define")
* If the bus adds s/it/its/
* Fix feature {itemize} list
* drop verb from {Block Index}
* Also fix s/32 bits values/32 bit values/
* drop \emph{chooses} in two places
* s/defines/defined/ in Endianness section
* add "and the buffer has been added to the used ring of the virtqueue"
* s/in band/in-band and s/out of band event/out-of-band event
* (Did not add "on", the sentience reads ok without it)
* Replace sentence with "it should prevent this feature ..."
* s/standardizes/standardized/
* Fix sentence about PING being optional
Signed-off-by: Bill Mills <bill.mills@linaro.org>
* add missing ')' * clarify that bus properties are advertised from the bus to the transport layer and change "driver" to bus or transport layer to more clearly show whom is targeted by the requirements * Avoid passive voice and clearly specify which element must conform * s/All encoding of values and fields/All values and fields/ * Use u8 and le16 types for virtio_msg_message * s/must be zero of Bus messages/must be zero for Bus messages/ * use ':' at end of item in list, not ';' * Add missing verb and s/posted/available in Runtime Notifications Signed-off-by: Bill Mills <bill.mills@linaro.org>
Align 8 byte fields to offsets that are multiples of 8. Messages are byte streams not directly addressable C structures. Custom messages may use any field alignment they wish. However, for the current standard messages there is no harm in aligning them. This only effects GET_VQUEUE and SET_VQUEUE. Signed-off-by: Bill Mills <bill.mills@linaro.org>
Simplify the response matching as discussed in the PR and in the Oct 23 meeting. * Bus messages have a dev_num and it is normally 0 so we don't need to say that matching dev_num if only for transport messages. * Drop msg_id from matching. Altough the msg_id would normally match there may be some cases where it would not. The token field should be unique for a given dev_num. * This simplifys the description of the matching tuple as well Signed-off-by: Bill Mills <bill.mills@linaro.org>
0454e72 to
6bad617
Compare
bertrand-marquis
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need to discuss the point on correlation responsibility but this is definitely not a reason to block this. Just something to remember.
|
|
||
| Rules: | ||
| \begin{itemize} | ||
| \item The request originator assigns a non-zero \field{token} for every |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we have something unclear here that we should define: who is generating the token and handling the correlation ? All models are possible:
- transport generating the token and doing correlation
- bus generating token and doing correlation
- transport generating token and bus doing correlation
- bus generating token and transport doing correlation
In my view solutions 3 and 4 do not make sense as the one doing correlation must be in charge of generating the token.
I see some arguments to consider:
- a bus that only handles one message a time does not need the token -> in favor of 2
- a bus doing the correlation would want to generate itself the token, same for transport -> against 3 and 4
- having the token and correlation handled at transport level would allow to reuse some code and simplify the bus work -> in favor of 1
- in case of 1, the bus would still have to handle its own correlation for bus messages -> in favor of 2
- OS blocking semantics for drivers might be easier to handle in the transport to prevent busses to potentially block where they should not -> in favor of 1
I am in favor of 1, even if the bus would have to handle correlation for its own messages because of the OS blocking semantics arguments but definitely something open for discussion.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Today AMP does the thread resumption in the bus. Resuming the right thread means matching the token. So this is number 2 above. This is required from the nature of the interface between transport and bus: one call with pointer to tx data and (optional) pointer to rx buffer.
If we change to number 1 we would need to change the interface between transport and bus.
Of course this choice can be made per implementation. Linux could do it one way and BSD or RTOS a different way. So I would prefer to keep it out of the virtio spec.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Moved this discussion to Issue #26 so we can find it easily after this PR is closed
|
I agree but would be a good idea to mention that this implementation defined and maybe list the 2 models.
Bertrand Marquis
________________________________
De : Bill Mills ***@***.***>
Envoyé : Friday, October 24, 2025 3:56:47 PM
À : Linaro/virtio-msg-spec ***@***.***>
Cc : Bertrand Marquis ***@***.***>; Mention ***@***.***>
Objet : Re: [Linaro/virtio-msg-spec] Proposed changes Oct 16: token and response matching, error handling, redundant messages sizes and editorial input from Matias and Peter (PR #25)
@wmamills commented on this pull request.
________________________________
In transport-msg.tex<#25 (comment)>:
+driver side but bus message requests such as \busref{PING} may originate at
+either driver side or device side.
+
+This section defines how responses are correlated to requests. An implementation
+does not need to support sending multiple requests in parallel but these rules
+allow for that possibility.
+
+The token field in the message header is part of a tuple that is unique during
+a request to response interval.
+\begin{itemize}
+ \item Message tuple: ( \field{dev_num}, \field{token} ).
+\end{itemize}
+
+Rules:
+\begin{itemize}
+ \item The request originator assigns a non-zero \field{token} for every
Today AMP does the thread resumption in the bus. Resuming the right thread means matching the token. So this is number 2 above. This is required from the nature of the interface between transport and bus: one call with pointer to tx data and (optional) pointer to rx buffer.
If we change to number 1 we would need to change the interface between transport and bus.
Of course this choice can be made per implementation. Linux could do it one way and BSD or RTOS a different way. So I would prefer to keep it out of the virtio spec.
—
Reply to this email directly, view it on GitHub<#25 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AMZC6T72GBQE7QOHB6XAMDT3ZIVZ7AVCNFSM6AAAAACJL6X3EGVHI2DSMVQWIX3LMV43YUDVNRWFEZLROVSXG5CSMV3GSZLXHMZTGNZWHE2TCNRYHE>.
You are receiving this because you were mentioned.Message ID: ***@***.***>
IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Thank you.
|
Redone after discussion at Oct 23 meeting
PDF version here
---- Older
Redone after discussion at Oct 16 meeting
PDF version here
Included @bertrand-marquis patches as-is and then made my changes as new commits. I was going to keep that branch for transparency but squash them for the PR. I decided instead to not squash in the PR for better local project transparency. When we do PATCHv1 or RFCv3 all local commits will be squashed anyway.
DROPPED
ADDED:
As before: