linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] hv: utils: properly pick TS protocol version for future hosts
@ 2016-11-28 16:30 Vitaly Kuznetsov
  2016-11-28 18:16 ` Alex Ng (LIS)
  0 siblings, 1 reply; 3+ messages in thread
From: Vitaly Kuznetsov @ 2016-11-28 16:30 UTC (permalink / raw)
  To: devel; +Cc: linux-kernel, K. Y. Srinivasan, Haiyang Zhang, Alex Ng

It is reasonable to expect that future Hyper-V versions will continue
supporting TimeSync v4 protocol, we, however, only pick it for
VERSION_WIN10. Currently this is not an issue as VERSION_WIN10 is the
maximum protocol version we can negotiate but this may change in future.
Instead of hoping that we won't forget to update it when time comes I
suggest we change the default now.

Signed-off-by: Vitaly Kuznetsov <vkuznets@redhat.com>
---
 drivers/hv/hv_util.c | 13 +++++--------
 1 file changed, 5 insertions(+), 8 deletions(-)

diff --git a/drivers/hv/hv_util.c b/drivers/hv/hv_util.c
index bcd0630..a13003f 100644
--- a/drivers/hv/hv_util.c
+++ b/drivers/hv/hv_util.c
@@ -382,23 +382,20 @@ static int util_probe(struct hv_device *dev,
 	 * Based on the host; initialize the framework and
 	 * service version numbers we will negotiate.
 	 */
-	switch (vmbus_proto_version) {
-	case (VERSION_WS2008):
+	if (vmbus_proto_version <= VERSION_WS2008) {
 		util_fw_version = UTIL_WS2K8_FW_VERSION;
 		sd_srv_version = SD_VERSION_1;
 		ts_srv_version = TS_VERSION_1;
 		hb_srv_version = HB_VERSION_1;
-		break;
-	case(VERSION_WIN10):
+	} else if (vmbus_proto_version < VERSION_WIN10) {
 		util_fw_version = UTIL_FW_VERSION;
 		sd_srv_version = SD_VERSION;
-		ts_srv_version = TS_VERSION;
+		ts_srv_version = TS_VERSION_3;
 		hb_srv_version = HB_VERSION;
-		break;
-	default:
+	} else {
 		util_fw_version = UTIL_FW_VERSION;
 		sd_srv_version = SD_VERSION;
-		ts_srv_version = TS_VERSION_3;
+		ts_srv_version = TS_VERSION;
 		hb_srv_version = HB_VERSION;
 	}
 
-- 
2.9.3

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* RE: [PATCH] hv: utils: properly pick TS protocol version for future hosts
  2016-11-28 16:30 [PATCH] hv: utils: properly pick TS protocol version for future hosts Vitaly Kuznetsov
@ 2016-11-28 18:16 ` Alex Ng (LIS)
  2016-11-29  8:38   ` Vitaly Kuznetsov
  0 siblings, 1 reply; 3+ messages in thread
From: Alex Ng (LIS) @ 2016-11-28 18:16 UTC (permalink / raw)
  To: Vitaly Kuznetsov, devel; +Cc: linux-kernel, KY Srinivasan, Haiyang Zhang

> -----Original Message-----
> From: Vitaly Kuznetsov [mailto:vkuznets@redhat.com]
> Sent: Monday, November 28, 2016 8:30 AM
> To: devel@linuxdriverproject.org
> Cc: linux-kernel@vger.kernel.org; KY Srinivasan <kys@microsoft.com>;
> Haiyang Zhang <haiyangz@microsoft.com>; Alex Ng (LIS)
> <alexng@microsoft.com>
> Subject: [PATCH] hv: utils: properly pick TS protocol version for future hosts
> 
> It is reasonable to expect that future Hyper-V versions will continue
> supporting TimeSync v4 protocol, we, however, only pick it for
> VERSION_WIN10. Currently this is not an issue as VERSION_WIN10 is the
> maximum protocol version we can negotiate but this may change in future.
> Instead of hoping that we won't forget to update it when time comes I
> suggest we change the default now.
> 

Vitaly, can you see if this upstream commit already fixes the issue you described?

https://git.kernel.org/cgit/linux/kernel/git/next/linux-next.git/commit/drivers/hv?id=3da0401b4d0e17aea7526db0235d98fa535d903e

> Signed-off-by: Vitaly Kuznetsov <vkuznets@redhat.com>
> ---
>  drivers/hv/hv_util.c | 13 +++++--------
>  1 file changed, 5 insertions(+), 8 deletions(-)
> 
> diff --git a/drivers/hv/hv_util.c b/drivers/hv/hv_util.c
> index bcd0630..a13003f 100644
> --- a/drivers/hv/hv_util.c
> +++ b/drivers/hv/hv_util.c
> @@ -382,23 +382,20 @@ static int util_probe(struct hv_device *dev,
>  	 * Based on the host; initialize the framework and
>  	 * service version numbers we will negotiate.
>  	 */
> -	switch (vmbus_proto_version) {
> -	case (VERSION_WS2008):
> +	if (vmbus_proto_version <= VERSION_WS2008) {
>  		util_fw_version = UTIL_WS2K8_FW_VERSION;
>  		sd_srv_version = SD_VERSION_1;
>  		ts_srv_version = TS_VERSION_1;
>  		hb_srv_version = HB_VERSION_1;
> -		break;
> -	case(VERSION_WIN10):
> +	} else if (vmbus_proto_version < VERSION_WIN10) {
>  		util_fw_version = UTIL_FW_VERSION;
>  		sd_srv_version = SD_VERSION;
> -		ts_srv_version = TS_VERSION;
> +		ts_srv_version = TS_VERSION_3;
>  		hb_srv_version = HB_VERSION;
> -		break;
> -	default:
> +	} else {
>  		util_fw_version = UTIL_FW_VERSION;
>  		sd_srv_version = SD_VERSION;
> -		ts_srv_version = TS_VERSION_3;
> +		ts_srv_version = TS_VERSION;
>  		hb_srv_version = HB_VERSION;
>  	}
> 
> --
> 2.9.3

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] hv: utils: properly pick TS protocol version for future hosts
  2016-11-28 18:16 ` Alex Ng (LIS)
@ 2016-11-29  8:38   ` Vitaly Kuznetsov
  0 siblings, 0 replies; 3+ messages in thread
From: Vitaly Kuznetsov @ 2016-11-29  8:38 UTC (permalink / raw)
  To: Alex Ng (LIS); +Cc: devel, linux-kernel, KY Srinivasan, Haiyang Zhang

"Alex Ng (LIS)" <alexng@microsoft.com> writes:

>> -----Original Message-----
>> From: Vitaly Kuznetsov [mailto:vkuznets@redhat.com]
>> Sent: Monday, November 28, 2016 8:30 AM
>> To: devel@linuxdriverproject.org
>> Cc: linux-kernel@vger.kernel.org; KY Srinivasan <kys@microsoft.com>;
>> Haiyang Zhang <haiyangz@microsoft.com>; Alex Ng (LIS)
>> <alexng@microsoft.com>
>> Subject: [PATCH] hv: utils: properly pick TS protocol version for future hosts
>> 
>> It is reasonable to expect that future Hyper-V versions will continue
>> supporting TimeSync v4 protocol, we, however, only pick it for
>> VERSION_WIN10. Currently this is not an issue as VERSION_WIN10 is the
>> maximum protocol version we can negotiate but this may change in future.
>> Instead of hoping that we won't forget to update it when time comes I
>> suggest we change the default now.
>> 
>
> Vitaly, can you see if this upstream commit already fixes the issue you described?
>
> https://git.kernel.org/cgit/linux/kernel/git/next/linux-next.git/commit/drivers/hv?id=3da0401b4d0e17aea7526db0235d98fa535d903e
>

Yes, thanks, missied it!

>> Signed-off-by: Vitaly Kuznetsov <vkuznets@redhat.com>
>> ---
>>  drivers/hv/hv_util.c | 13 +++++--------
>>  1 file changed, 5 insertions(+), 8 deletions(-)
>> 
>> diff --git a/drivers/hv/hv_util.c b/drivers/hv/hv_util.c
>> index bcd0630..a13003f 100644
>> --- a/drivers/hv/hv_util.c
>> +++ b/drivers/hv/hv_util.c
>> @@ -382,23 +382,20 @@ static int util_probe(struct hv_device *dev,
>>  	 * Based on the host; initialize the framework and
>>  	 * service version numbers we will negotiate.
>>  	 */
>> -	switch (vmbus_proto_version) {
>> -	case (VERSION_WS2008):
>> +	if (vmbus_proto_version <= VERSION_WS2008) {
>>  		util_fw_version = UTIL_WS2K8_FW_VERSION;
>>  		sd_srv_version = SD_VERSION_1;
>>  		ts_srv_version = TS_VERSION_1;
>>  		hb_srv_version = HB_VERSION_1;
>> -		break;
>> -	case(VERSION_WIN10):
>> +	} else if (vmbus_proto_version < VERSION_WIN10) {
>>  		util_fw_version = UTIL_FW_VERSION;
>>  		sd_srv_version = SD_VERSION;
>> -		ts_srv_version = TS_VERSION;
>> +		ts_srv_version = TS_VERSION_3;
>>  		hb_srv_version = HB_VERSION;
>> -		break;
>> -	default:
>> +	} else {
>>  		util_fw_version = UTIL_FW_VERSION;
>>  		sd_srv_version = SD_VERSION;
>> -		ts_srv_version = TS_VERSION_3;
>> +		ts_srv_version = TS_VERSION;
>>  		hb_srv_version = HB_VERSION;
>>  	}
>> 
>> --
>> 2.9.3

-- 
  Vitaly

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2016-11-29  8:38 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-11-28 16:30 [PATCH] hv: utils: properly pick TS protocol version for future hosts Vitaly Kuznetsov
2016-11-28 18:16 ` Alex Ng (LIS)
2016-11-29  8:38   ` Vitaly Kuznetsov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).