Re: Opposite return values in vringh_notify_enable_kern() and virtqueue_enable_cb().

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Sjur Brændeland <sjurbren@xxxxxxxxx> writes:

> Hi Rusty,
>
> The two similar functions in vringh and virtqueue for turning on
> interrupts has opposite return values if there are buffers available
> in the ring. I think it would be better if these two functions aligned
> the use of return values. Maybe it's just me, but I got the logic
> for re-scheduling NAPI wrong due to this.

Wow.  Firstly, the author of the original was an idiot for getting the
API wrong.  Secondly, the author of the second was an idiot for making
it different.

So I'm doubly an idiot.  If I'd hit that I would have been far less
polite :)

Hmm, wait, vhost has them inverted, so maybe I can blame MST... anyway,
I fixed that too.

Thanks!
Rusty.

> /**
>  * vringh_notify_enable_kern - we want to know if something changes.
>  * @vrh: the vring.
>  *
>  * This always enables notifications, but returns true if there are
>  * now more buffers available in the vring.
>  */
> bool vringh_notify_enable_kern(struct vringh *vrh)
>
> /**
>  * virtqueue_enable_cb - restart callbacks after disable_cb.
>  * @vq: the struct virtqueue we're talking about.
>  *
>  * This re-enables callbacks; it returns "false" if there are pending
>  * buffers in the queue, ....
>  */
> bool virtqueue_enable_cb(struct virtqueue *_vq)
>
> Regards.
> Sjur
_______________________________________________
Virtualization mailing list
Virtualization@xxxxxxxxxxxxxxxxxxxxxxxxxx
https://lists.linuxfoundation.org/mailman/listinfo/virtualization



[Index of Archives]     [KVM Development]     [Libvirt Development]     [Libvirt Users]     [CentOS Virtualization]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite Forum]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux