lkml.org 
[lkml]   [2018]   [May]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 1/1] Drivers: hv: vmbus: enable VMBus protocol version 5.0
On Sat, 12 May 2018 02:30:33 -0700
kys@linuxonhyperv.com wrote:

> int vmbus_post_msg(void *buffer, size_t buflen, bool can_sleep)
> {
> + struct vmbus_channel_message_header *hdr;
> union hv_connection_id conn_id;
> int ret = 0;
> int retries = 0;
> u32 usec = 1;
>
> conn_id.asu32 = 0;
> - conn_id.u.id = VMBUS_MESSAGE_CONNECTION_ID;
> + conn_id.u.id = vmbus_connection.msg_conn_id;
>
> /*
> * hv_post_message() can have transient failures because of
> @@ -372,6 +400,18 @@ int vmbus_post_msg(void *buffer, size_t buflen, bool can_sleep)
>
> switch (ret) {
> case HV_STATUS_INVALID_CONNECTION_ID:
> + /*
> + * See vmbus_negotiate_version(): VMBus protocol 5.0
> + * requires that we must use
> + * VMBUS_MESSAGE_CONNECTION_ID_4 for the Initiate
> + * Contact message, but on old hosts that only
> + * support VMBus protocol 4.0 or lower, here we get
> + * HV_STATUS_INVALID_CONNECTION_ID and we should
> + * return an error immediately without retrying.
> + */
> + hdr = (struct vmbus_channel_message_header *)buffer;

Hate to pick o the details, but buffer is void * so cast is not necessary here.

\
 
 \ /
  Last update: 2018-05-13 19:25    [W:0.079 / U:1.168 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site