Skip to content

Commit f38e7dd

Browse files
vittyvkgregkh
authored andcommitted
Drivers: hv: vmbus: move init_vp_index() call to vmbus_process_offer()
We need to call init_vp_index() after we added the channel to the appropriate list (global or subchannel) to be able to use this information when assigning the channel to the particular vcpu. To do so we need to move a couple of functions around. The only real change is the init_vp_index() call. This is a small refactoring without a functional change. Signed-off-by: Vitaly Kuznetsov <vkuznets@redhat.com> Signed-off-by: K. Y. Srinivasan <kys@microsoft.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 357e836 commit f38e7dd

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

‎drivers/hv/channel_mgmt.c‎

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,9 @@
3232

3333
#include "hyperv_vmbus.h"
3434

35+
static void init_vp_index(struct vmbus_channel *channel,
36+
const uuid_le *type_guid);
37+
3538
/**
3639
* vmbus_prep_negotiate_resp() - Create default response for Hyper-V Negotiate message
3740
* @icmsghdrp: Pointer to msg header structure
@@ -272,6 +275,8 @@ static void vmbus_process_offer(struct vmbus_channel *newchannel)
272275
goto err_free_chan;
273276
}
274277

278+
init_vp_index(newchannel, &newchannel->offermsg.offer.if_type);
279+
275280
if (newchannel->target_cpu != get_cpu()) {
276281
put_cpu();
277282
smp_call_function_single(newchannel->target_cpu,
@@ -476,8 +481,6 @@ static void vmbus_onoffer(struct vmbus_channel_message_header *hdr)
476481
offer->connection_id;
477482
}
478483

479-
init_vp_index(newchannel, &offer->offer.if_type);
480-
481484
memcpy(&newchannel->offermsg, offer,
482485
sizeof(struct vmbus_channel_offer_channel));
483486
newchannel->monitor_grp = (u8)offer->monitorid / 32;

0 commit comments

Comments
 (0)