Re: [PATCH 1/2] Drivers: hv: vmbus: Introduce table of VMBus protocol versions

2019-10-09 Thread Andrea Parri
On Tue, Oct 08, 2019 at 10:41:42PM +, Dexuan Cui wrote: > > From: Vitaly Kuznetsov > > Sent: Tuesday, October 8, 2019 6:00 AM > > ... > > > Looking at the uses of VERSION_INVAL, I find one remaining occurrence > > > of this macro in vmbus_bus_resume(), which does: > > > > > > if

RE: [PATCH 1/2] Drivers: hv: vmbus: Introduce table of VMBus protocol versions

2019-10-08 Thread Dexuan Cui
> From: Vitaly Kuznetsov > Sent: Tuesday, October 8, 2019 6:00 AM > ... > > Looking at the uses of VERSION_INVAL, I find one remaining occurrence > > of this macro in vmbus_bus_resume(), which does: > > > > if (vmbus_proto_version == VERSION_INVAL || > > vmbus_proto_version == 0) { >

Re: [PATCH 1/2] Drivers: hv: vmbus: Introduce table of VMBus protocol versions

2019-10-08 Thread Vitaly Kuznetsov
Andrea Parri writes: >> > @@ -244,21 +234,18 @@ int vmbus_connect(void) >> > * version. >> > */ >> > >> > - version = VERSION_CURRENT; >> > + for (i = 0; ; i++) { >> > + version = vmbus_versions[i]; >> > + if (version == VERSION_INVAL) >> > + goto

Re: [PATCH 1/2] Drivers: hv: vmbus: Introduce table of VMBus protocol versions

2019-10-08 Thread Andrea Parri
> IIUC, you're suggesting that I do: > > for (i = 0; i < ARRAY_SIZE(vmbus_versions); i++) { > version = vmbus_versions[i]; > > ret = vmbus_negotiate_version(msginfo, version); > if (ret == -ETIMEDOUT) > goto cleanup; > >

Re: [PATCH 1/2] Drivers: hv: vmbus: Introduce table of VMBus protocol versions

2019-10-08 Thread Andrea Parri
On Mon, Oct 07, 2019 at 05:25:18PM +, Dexuan Cui wrote: > > From: linux-hyperv-ow...@vger.kernel.org > > On Behalf Of Andrea Parri > > Sent: Monday, October 7, 2019 9:31 AM > > > > +/* > > + * Table of VMBus versions listed from newest to oldest; the table > > + * must terminate with

Re: [PATCH 1/2] Drivers: hv: vmbus: Introduce table of VMBus protocol versions

2019-10-08 Thread Andrea Parri
> > @@ -244,21 +234,18 @@ int vmbus_connect(void) > > * version. > > */ > > > > - version = VERSION_CURRENT; > > + for (i = 0; ; i++) { > > + version = vmbus_versions[i]; > > + if (version == VERSION_INVAL) > > + goto cleanup; > > If you use

RE: [PATCH 1/2] Drivers: hv: vmbus: Introduce table of VMBus protocol versions

2019-10-07 Thread Dexuan Cui
> From: linux-hyperv-ow...@vger.kernel.org > On Behalf Of Andrea Parri > Sent: Monday, October 7, 2019 9:31 AM > > +/* > + * Table of VMBus versions listed from newest to oldest; the table > + * must terminate with VERSION_INVAL. > + */ > +__u32 vmbus_versions[] = { > + VERSION_WIN10_V5,

Re: [PATCH 1/2] Drivers: hv: vmbus: Introduce table of VMBus protocol versions

2019-10-07 Thread Vitaly Kuznetsov
Andrea Parri writes: > The technique used to get the next VMBus version seems increasisly > clumsy as the number of VMBus versions increases. Performance is > not a concern since this is only done once during system boot; it's > just that we'll end up with more lines of code than is really