diff options
Diffstat (limited to 'include/linux/hyperv.h')
| -rw-r--r-- | include/linux/hyperv.h | 33 |
1 files changed, 25 insertions, 8 deletions
diff --git a/include/linux/hyperv.h b/include/linux/hyperv.h index 3a3012f57be4..efda23cf32c7 100644 --- a/include/linux/hyperv.h +++ b/include/linux/hyperv.h | |||
| @@ -89,18 +89,33 @@ struct hv_ring_buffer { | |||
| 89 | u32 interrupt_mask; | 89 | u32 interrupt_mask; |
| 90 | 90 | ||
| 91 | /* | 91 | /* |
| 92 | * Win8 uses some of the reserved bits to implement | 92 | * WS2012/Win8 and later versions of Hyper-V implement interrupt |
| 93 | * interrupt driven flow management. On the send side | 93 | * driven flow management. The feature bit feat_pending_send_sz |
| 94 | * we can request that the receiver interrupt the sender | 94 | * is set by the host on the host->guest ring buffer, and by the |
| 95 | * when the ring transitions from being full to being able | 95 | * guest on the guest->host ring buffer. |
| 96 | * to handle a message of size "pending_send_sz". | ||
| 97 | * | 96 | * |
| 98 | * Add necessary state for this enhancement. | 97 | * The meaning of the feature bit is a bit complex in that it has |
| 98 | * semantics that apply to both ring buffers. If the guest sets | ||
| 99 | * the feature bit in the guest->host ring buffer, the guest is | ||
| 100 | * telling the host that: | ||
| 101 | * 1) It will set the pending_send_sz field in the guest->host ring | ||
| 102 | * buffer when it is waiting for space to become available, and | ||
| 103 | * 2) It will read the pending_send_sz field in the host->guest | ||
| 104 | * ring buffer and interrupt the host when it frees enough space | ||
| 105 | * | ||
| 106 | * Similarly, if the host sets the feature bit in the host->guest | ||
| 107 | * ring buffer, the host is telling the guest that: | ||
| 108 | * 1) It will set the pending_send_sz field in the host->guest ring | ||
| 109 | * buffer when it is waiting for space to become available, and | ||
| 110 | * 2) It will read the pending_send_sz field in the guest->host | ||
| 111 | * ring buffer and interrupt the guest when it frees enough space | ||
| 112 | * | ||
| 113 | * If either the guest or host does not set the feature bit that it | ||
| 114 | * owns, that guest or host must do polling if it encounters a full | ||
| 115 | * ring buffer, and not signal the other end with an interrupt. | ||
| 99 | */ | 116 | */ |
| 100 | u32 pending_send_sz; | 117 | u32 pending_send_sz; |
| 101 | |||
| 102 | u32 reserved1[12]; | 118 | u32 reserved1[12]; |
| 103 | |||
| 104 | union { | 119 | union { |
| 105 | struct { | 120 | struct { |
| 106 | u32 feat_pending_send_sz:1; | 121 | u32 feat_pending_send_sz:1; |
| @@ -1046,6 +1061,8 @@ extern int vmbus_establish_gpadl(struct vmbus_channel *channel, | |||
| 1046 | extern int vmbus_teardown_gpadl(struct vmbus_channel *channel, | 1061 | extern int vmbus_teardown_gpadl(struct vmbus_channel *channel, |
| 1047 | u32 gpadl_handle); | 1062 | u32 gpadl_handle); |
| 1048 | 1063 | ||
| 1064 | void vmbus_reset_channel_cb(struct vmbus_channel *channel); | ||
| 1065 | |||
| 1049 | extern int vmbus_recvpacket(struct vmbus_channel *channel, | 1066 | extern int vmbus_recvpacket(struct vmbus_channel *channel, |
| 1050 | void *buffer, | 1067 | void *buffer, |
| 1051 | u32 bufferlen, | 1068 | u32 bufferlen, |
