On 2026-10-17T18:46:22, Hung-Chun Tseng <[email protected]> wrote:
> virtio: sandbox: Let tests emulate the device side of a virtqueue
>
> The sandbox virtio transport ignores notifications, so a driver that
> waits for the device to answer a request cannot be tested beyond its
> probe. The virtio-rng test works around this by writing to the used
> ring of the driver's virtqueue before reading.
>
> Add sandbox_virtio_set_notify() so that a test can install a handler
> which is called when the driver kicks a virtqueue. The handler can then
> process the available ring and fill in the used ring, as a real device
> would. Without a handler, notifications are still ignored.
>
> Signed-off-by: Hung-Chun Tseng <[email protected]>
>
>  arch/sandbox/include/asm/test.h | 25 +++++++++++++++++++++++++
>  drivers/virtio/virtio_sandbox.c | 15 +++++++++++++++
>  2 files changed, 40 insertions(+)

Reviewed-by: Simon Glass <[email protected]>

Reply via email to