Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 20138d6c authored by K. Y. Srinivasan's avatar K. Y. Srinivasan Committed by Greg Kroah-Hartman
Browse files

Drivers: hv: balloon: Initialize the transaction ID just before sending the packet



Each message sent from the guest carries with it a transaction ID.
Assign the transaction ID just before putting the message on the VMBUS.
This would help in debugging on the host side.

Signed-off-by: default avatarK. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 6741335b
Loading
Loading
Loading
Loading
+2 −2
Original line number Original line Diff line number Diff line
@@ -828,7 +828,6 @@ static void hot_add_req(struct work_struct *dummy)
	memset(&resp, 0, sizeof(struct dm_hot_add_response));
	memset(&resp, 0, sizeof(struct dm_hot_add_response));
	resp.hdr.type = DM_MEM_HOT_ADD_RESPONSE;
	resp.hdr.type = DM_MEM_HOT_ADD_RESPONSE;
	resp.hdr.size = sizeof(struct dm_hot_add_response);
	resp.hdr.size = sizeof(struct dm_hot_add_response);
	resp.hdr.trans_id = atomic_inc_return(&trans_id);


#ifdef CONFIG_MEMORY_HOTPLUG
#ifdef CONFIG_MEMORY_HOTPLUG
	pg_start = dm->ha_wrk.ha_page_range.finfo.start_page;
	pg_start = dm->ha_wrk.ha_page_range.finfo.start_page;
@@ -890,6 +889,7 @@ static void hot_add_req(struct work_struct *dummy)
		pr_info("Memory hot add failed\n");
		pr_info("Memory hot add failed\n");


	dm->state = DM_INITIALIZED;
	dm->state = DM_INITIALIZED;
	resp.hdr.trans_id = atomic_inc_return(&trans_id);
	vmbus_sendpacket(dm->dev->channel, &resp,
	vmbus_sendpacket(dm->dev->channel, &resp,
			sizeof(struct dm_hot_add_response),
			sizeof(struct dm_hot_add_response),
			(unsigned long)NULL,
			(unsigned long)NULL,
@@ -1076,7 +1076,6 @@ static void balloon_up(struct work_struct *dummy)
		bl_resp = (struct dm_balloon_response *)send_buffer;
		bl_resp = (struct dm_balloon_response *)send_buffer;
		memset(send_buffer, 0, PAGE_SIZE);
		memset(send_buffer, 0, PAGE_SIZE);
		bl_resp->hdr.type = DM_BALLOON_RESPONSE;
		bl_resp->hdr.type = DM_BALLOON_RESPONSE;
		bl_resp->hdr.trans_id = atomic_inc_return(&trans_id);
		bl_resp->hdr.size = sizeof(struct dm_balloon_response);
		bl_resp->hdr.size = sizeof(struct dm_balloon_response);
		bl_resp->more_pages = 1;
		bl_resp->more_pages = 1;


@@ -1104,6 +1103,7 @@ static void balloon_up(struct work_struct *dummy)
		 */
		 */


		do {
		do {
			bl_resp->hdr.trans_id = atomic_inc_return(&trans_id);
			ret = vmbus_sendpacket(dm_device.dev->channel,
			ret = vmbus_sendpacket(dm_device.dev->channel,
						bl_resp,
						bl_resp,
						bl_resp->hdr.size,
						bl_resp->hdr.size,