summaryrefslogtreecommitdiff
path: root/include/linux/hyperv.h
diff options
context:
space:
mode:
authorK. Y. Srinivasan <kys@microsoft.com>2012-12-01 06:46:33 -0800
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-01-17 10:46:39 -0800
commit132368bd0b286457f83f56d0bbdecd85999562dc (patch)
treee16a4f6130d475d1f44270c088e446306b3e8355 /include/linux/hyperv.h
parent6fdf3b21433e901dcba0ac186f00d604ce944f56 (diff)
downloadlwn-132368bd0b286457f83f56d0bbdecd85999562dc.tar.gz
lwn-132368bd0b286457f83f56d0bbdecd85999562dc.zip
Drivers: hv: Add state to manage batched reading
For the "read" side signaling optimization, the reader has to completely drain the queue before exiting. Add state to manage this "batched" reading. Signed-off-by: K. Y. Srinivasan <kys@microsoft.com> Reviewed-by: Haiyang Zhang <haiyangz@microsoft.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'include/linux/hyperv.h')
-rw-r--r--include/linux/hyperv.h20
1 files changed, 20 insertions, 0 deletions
diff --git a/include/linux/hyperv.h b/include/linux/hyperv.h
index e73b852156b1..1ffe84de6c55 100644
--- a/include/linux/hyperv.h
+++ b/include/linux/hyperv.h
@@ -882,8 +882,28 @@ struct vmbus_channel {
void (*onchannel_callback)(void *context);
void *channel_callback_context;
+
+ /*
+ * A channel can be marked for efficient (batched)
+ * reading:
+ * If batched_reading is set to "true", we read until the
+ * channel is empty and hold off interrupts from the host
+ * during the entire read process.
+ * If batched_reading is set to "false", the client is not
+ * going to perform batched reading.
+ *
+ * By default we will enable batched reading; specific
+ * drivers that don't want this behavior can turn it off.
+ */
+
+ bool batched_reading;
};
+static inline void set_channel_read_state(struct vmbus_channel *c, bool state)
+{
+ c->batched_reading = state;
+}
+
void vmbus_onmessage(void *context);
int vmbus_request_offers(void);