From: Rusty Russell <rusty@rustcorp.com.au>
To: "Sjur Brændeland" <sjurbren@gmail.com>
Cc: mst@redhat.com, Erwan YVIN <Erwan.Yvin@stericsson.com>,
virtualization@lists.linux-foundation.org
Subject: Re: Opposite return values in vringh_notify_enable_kern() and virtqueue_enable_cb().
Date: Tue, 12 Mar 2013 15:02:51 +1030 [thread overview]
Message-ID: <87sj41utjg.fsf@rustcorp.com.au> (raw)
In-Reply-To: <CAJK669Zkn0HL0AQVO3=C=ChsFHy5xD0hDNKPSrKOFLivu3AODA@mail.gmail.com>
Sjur Brændeland <sjurbren@gmail.com> 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@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/virtualization
prev parent reply other threads:[~2013-03-12 4:32 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-03-11 8:55 Opposite return values in vringh_notify_enable_kern() and virtqueue_enable_cb() Sjur Brændeland
2013-03-12 4:32 ` Rusty Russell [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87sj41utjg.fsf@rustcorp.com.au \
--to=rusty@rustcorp.com.au \
--cc=Erwan.Yvin@stericsson.com \
--cc=mst@redhat.com \
--cc=sjurbren@gmail.com \
--cc=virtualization@lists.linux-foundation.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.