Reading this again today, I realized I was mistaken.
prepare() does not *fail*; a false return means "not needed" (e.g. the
device has set no-notify). The notify() is therefore skipped, but the
kick() as a whole is considered successful.
Sorry about the noise. Carry on.
//Snild
On 2024-11-22 14:55, Snild Dolkow wrote:
> If virtqueue_prepare() fails, virtqueue_kick() falls back to returning true:
>
> /**
> * virtqueue_kick - update after add_buf
> * @vq: the struct virtqueue
> *
> * After one or more virtqueue_add_* calls, invoke this to kick
> * the other side.
> *
> * Caller must ensure we don't call this with other virtqueue
> * operations at the same time (except where noted).
> *
> * Returns false if kick failed, otherwise true.
> */
> bool virtqueue_kick(struct virtqueue *vq)
> {
> if (virtqueue_kick_prepare(vq))
> return virtqueue_notify(vq);
> return true;
> }
>
>>From the comment (and the return values of virtqueue_notify()), I
> would've expected that last line to return false.
>
> It probably doesn't matter much; I could only find a few files that care
> about the return value, and I assume failures from prepare are *very* rare.
>
> //Snild
>