lguest: update commentry

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>

+16
+8
Documentation/lguest/lguest.c
··· 895 895 } 896 896 } 897 897 898 + /* This is called when we no longer want to hear about Guest changes to a 899 + * virtqueue. This is more efficient in high-traffic cases, but it means we 900 + * have to set a timer to check if any more changes have occurred. */ 898 901 static void block_vq(struct virtqueue *vq) 899 902 { 900 903 struct itimerval itm; ··· 942 939 if (!timeout && num) 943 940 block_vq(vq); 944 941 942 + /* We never quite know how long should we wait before we check the 943 + * queue again for more packets. We start at 500 microseconds, and if 944 + * we get fewer packets than last time, we assume we made the timeout 945 + * too small and increase it by 10 microseconds. Otherwise, we drop it 946 + * by one microsecond every time. It seems to work well enough. */ 945 947 if (timeout) { 946 948 if (num < last_timeout_num) 947 949 timeout_usec += 10;
+8
drivers/lguest/lguest_device.c
··· 98 98 return features; 99 99 } 100 100 101 + /* The virtio core takes the features the Host offers, and copies the 102 + * ones supported by the driver into the vdev->features array. Once 103 + * that's all sorted out, this routine is called so we can tell the 104 + * Host which features we understand and accept. */ 101 105 static void lg_finalize_features(struct virtio_device *vdev) 102 106 { 103 107 unsigned int i, bits; ··· 112 108 /* Give virtio_ring a chance to accept features. */ 113 109 vring_transport_features(vdev); 114 110 111 + /* The vdev->feature array is a Linux bitmask: this isn't the 112 + * same as a the simple array of bits used by lguest devices 113 + * for features. So we do this slow, manual conversion which is 114 + * completely general. */ 115 115 memset(out_features, 0, desc->feature_len); 116 116 bits = min_t(unsigned, desc->feature_len, sizeof(vdev->features)) * 8; 117 117 for (i = 0; i < bits; i++) {