aboutsummaryrefslogtreecommitdiffstats
path: root/Documentation/lguest/lguest.c
diff options
context:
space:
mode:
authorRusty Russell <rusty@rustcorp.com.au>2008-02-04 23:49:59 -0500
committerRusty Russell <rusty@rustcorp.com.au>2008-02-04 07:50:00 -0500
commit426e3e0af5d2473e67d4256fc1340b7faebd1cc7 (patch)
tree29912e63889e45307f41ef08116ecd895b17e21c /Documentation/lguest/lguest.c
parent3309daaad724dd08eb598bf9c12b7bb9daddd706 (diff)
virtio: clarify NO_NOTIFY flag usage
The other side (host) can set the NO_NOTIFY flag as an optimization, to say "no need to kick me when you add things". Make it clear that this is advisory only; especially that we should always notify when the ring is full. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Diffstat (limited to 'Documentation/lguest/lguest.c')
-rw-r--r--Documentation/lguest/lguest.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/Documentation/lguest/lguest.c b/Documentation/lguest/lguest.c
index 4df1804169dc..8ff2d8bc690a 100644
--- a/Documentation/lguest/lguest.c
+++ b/Documentation/lguest/lguest.c
@@ -923,10 +923,10 @@ static void handle_output(int fd, unsigned long addr)
923 /* Check each virtqueue. */ 923 /* Check each virtqueue. */
924 for (i = devices.dev; i; i = i->next) { 924 for (i = devices.dev; i; i = i->next) {
925 for (vq = i->vq; vq; vq = vq->next) { 925 for (vq = i->vq; vq; vq = vq->next) {
926 if (vq->config.pfn == addr/getpagesize() 926 if (vq->config.pfn == addr/getpagesize()) {
927 && vq->handle_output) {
928 verbose("Output to %s\n", vq->dev->name); 927 verbose("Output to %s\n", vq->dev->name);
929 vq->handle_output(fd, vq); 928 if (vq->handle_output)
929 vq->handle_output(fd, vq);
930 return; 930 return;
931 } 931 }
932 } 932 }
@@ -1068,7 +1068,8 @@ static void add_virtqueue(struct device *dev, unsigned int num_descs,
1068 * virtqueue. */ 1068 * virtqueue. */
1069 vq->handle_output = handle_output; 1069 vq->handle_output = handle_output;
1070 1070
1071 /* Set the "Don't Notify Me" flag if we don't have a handler */ 1071 /* As an optimization, set the advisory "Don't Notify Me" flag if we
1072 * don't have a handler */
1072 if (!handle_output) 1073 if (!handle_output)
1073 vq->vring.used->flags = VRING_USED_F_NO_NOTIFY; 1074 vq->vring.used->flags = VRING_USED_F_NO_NOTIFY;
1074} 1075}