|
From: | Philippe Mathieu-Daudé |
Subject: | Re: [PATCH v8 03/12] virtio-sound: handle control messages and streams |
Date: | Mon, 4 Sep 2023 12:42:50 +0200 |
User-agent: | Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.15.0 |
On 4/9/23 12:18, Manos Pitsidianakis wrote:
Good morning Philippe,On Mon, 04 Sep 2023 13:08, Philippe Mathieu-Daudé <philmd@linaro.org> wrote:+ iov_from_buf(cmd->elem->in_sg, + cmd->elem->in_num, + 0, + &cmd->resp, + sizeof(cmd->resp)); + virtqueue_push(cmd->vq, cmd->elem, sizeof(cmd->elem)); + virtio_notify(VIRTIO_DEVICE(s), cmd->vq);I have very few understanding of virtio, but I'm wondering here, since this function is called under cmdq_mutex(), could it be useful to batch the queue by calling virtio_notify() only once in the caller once the whole cmdq is processed ...In the linux driver (sound/virtio/virtio_ctl_msg.c), the guest has a timeout for receiving the message. I found that if I did not notify as fast as possible, I got timeout errors on the guest.
Ah, I see, 1ms per default: sound/virtio/virtio_card.c:14:u32 virtsnd_msg_timeout_ms = MSEC_PER_SEC;
[Prev in Thread] | Current Thread | [Next in Thread] |