Hi Viresh,
Sorry for the delay but i am off sick this week.
It was my understanding that polling would be done at the virtqueue level and would not require anything specific in the transport itself. For notifications from the frontend to the backend, direct messages can be used (just ignore the answer) but for backend to frontend you will have to poll the virtqueues in the different drivers.
Cheers Bertrand
On 18 Feb 2025, at 11:10, Viresh Kumar viresh.kumar@linaro.org wrote:
Hi Ayrton / Armelle,
I tried to investigate about how to make VIRTIO_MSG_EVENT_USED work without indirect FFA messages.
- Firstly, I am still not sure if I fully understand why indirect messages can't
be implemented on Trustee side ? I know it was discussed a bit in the call, but I don't remember any of it :(
- If we want to do polling of the virtqueues, then it needs to be done on the
driver side (vsock), I don't see how I can generalize it and do it from virtio-msg-ffa layer. The driver needs to do something like this for the virtqueue:
while (1) { /* Try to get a buffer from the virtqueue */ buf = virtqueue_get_buf(vq, &len); if (buf) { // Handle the received buffer break; } /* Avoid busy looping with a small delay */ cpu_relax(); }
- The other idea discussed on the call was about always queuing a direct message
for a FFA device (not virtio device) for EVENT_USED message. Once the trustee side has an event to send, it can respond to this request.
I was thinking if this may block the CPU for ever with the SMC call, but I don't think that is the case. The FFA layer makes the SMC call, checks its return value and sleeps for a ms, and tries again. With this the CPU will schedule other work as soon as it can. And looks like we support sending multiple direct messages concurrently too, so while a thread is waiting for a response to EVENT_USED message, we can keep sending other messages.
If we want to support this, will this be part of the spec ? Bertrand ?
- Any other ideas on how to get this solved ?
-- viresh
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.