summaryrefslogtreecommitdiffstats
path: root/include/linux/hyperv.h
diff options
context:
space:
mode:
authorK. Y. Srinivasan <kys@microsoft.com>2015-12-14 19:01:54 -0500
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2015-12-14 22:15:05 -0500
commit8599846d73997cdbccf63f23394d871cfad1e5e6 (patch)
tree71b9d87febd70d4f439c29ac0b88a3a749f1c4f4 /include/linux/hyperv.h
parent40f26f3168bf7a4da490db308dc0bd9f9923f41f (diff)
Drivers: hv: vmbus: Fix a Host signaling bug
Currently we have two policies for deciding when to signal the host: One based on the ring buffer state and the other based on what the VMBUS client driver wants to do. Consider the case when the client wants to explicitly control when to signal the host. In this case, if the client were to defer signaling, we will not be able to signal the host subsequently when the client does want to signal since the ring buffer state will prevent the signaling. Implement logic to have only one signaling policy in force for a given channel. Signed-off-by: K. Y. Srinivasan <kys@microsoft.com> Reviewed-by: Haiyang Zhang <haiyangz@microsoft.com> Tested-by: Haiyang Zhang <haiyangz@microsoft.com> Cc: <stable@vger.kernel.org> # v4.2+ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'include/linux/hyperv.h')
-rw-r--r--include/linux/hyperv.h18
1 files changed, 18 insertions, 0 deletions
diff --git a/include/linux/hyperv.h b/include/linux/hyperv.h
index f773a6871f4c..acd995b81c6b 100644
--- a/include/linux/hyperv.h
+++ b/include/linux/hyperv.h
@@ -630,6 +630,11 @@ struct hv_input_signal_event_buffer {
630 struct hv_input_signal_event event; 630 struct hv_input_signal_event event;
631}; 631};
632 632
633enum hv_signal_policy {
634 HV_SIGNAL_POLICY_DEFAULT = 0,
635 HV_SIGNAL_POLICY_EXPLICIT,
636};
637
633struct vmbus_channel { 638struct vmbus_channel {
634 /* Unique channel id */ 639 /* Unique channel id */
635 int id; 640 int id;
@@ -757,8 +762,21 @@ struct vmbus_channel {
757 * link up channels based on their CPU affinity. 762 * link up channels based on their CPU affinity.
758 */ 763 */
759 struct list_head percpu_list; 764 struct list_head percpu_list;
765 /*
766 * Host signaling policy: The default policy will be
767 * based on the ring buffer state. We will also support
768 * a policy where the client driver can have explicit
769 * signaling control.
770 */
771 enum hv_signal_policy signal_policy;
760}; 772};
761 773
774static inline void set_channel_signal_state(struct vmbus_channel *c,
775 enum hv_signal_policy policy)
776{
777 c->signal_policy = policy;
778}
779
762static inline void set_channel_read_state(struct vmbus_channel *c, bool state) 780static inline void set_channel_read_state(struct vmbus_channel *c, bool state)
763{ 781{
764 c->batched_reading = state; 782 c->batched_reading = state;