aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLong Li <longli@microsoft.com>2016-10-05 19:57:46 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2016-10-25 02:52:10 -0400
commit407a3aee6ee2d2cb46d9ba3fc380bc29f35d020c (patch)
treecd95581671b4f52b0e27724ff20ce6d3da136c19
parent43605e293eb13c07acb546c14f407a271837af17 (diff)
hv: do not lose pending heartbeat vmbus packets
The host keeps sending heartbeat packets independent of the guest responding to them. Even though we respond to the heartbeat messages at interrupt level, we can have situations where there maybe multiple heartbeat messages pending that have not been responded to. For instance this occurs when the VM is paused and the host continues to send the heartbeat messages. Address this issue by draining and responding to all the heartbeat messages that maybe pending. Signed-off-by: Long Li <longli@microsoft.com> Signed-off-by: K. Y. Srinivasan <kys@microsoft.com> CC: Stable <stable@vger.kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--drivers/hv/hv_util.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/drivers/hv/hv_util.c b/drivers/hv/hv_util.c
index 4aa3cb63fd41..bcd06306f3e8 100644
--- a/drivers/hv/hv_util.c
+++ b/drivers/hv/hv_util.c
@@ -314,10 +314,14 @@ static void heartbeat_onchannelcallback(void *context)
314 u8 *hbeat_txf_buf = util_heartbeat.recv_buffer; 314 u8 *hbeat_txf_buf = util_heartbeat.recv_buffer;
315 struct icmsg_negotiate *negop = NULL; 315 struct icmsg_negotiate *negop = NULL;
316 316
317 vmbus_recvpacket(channel, hbeat_txf_buf, 317 while (1) {
318 PAGE_SIZE, &recvlen, &requestid); 318
319 vmbus_recvpacket(channel, hbeat_txf_buf,
320 PAGE_SIZE, &recvlen, &requestid);
321
322 if (!recvlen)
323 break;
319 324
320 if (recvlen > 0) {
321 icmsghdrp = (struct icmsg_hdr *)&hbeat_txf_buf[ 325 icmsghdrp = (struct icmsg_hdr *)&hbeat_txf_buf[
322 sizeof(struct vmbuspipe_hdr)]; 326 sizeof(struct vmbuspipe_hdr)];
323 327