linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] hv_netvsc: support a new host capability AllowRscDisabledStatus
@ 2023-06-29  9:58 Shradha Gupta
  2023-06-29 12:44 ` Haiyang Zhang
  0 siblings, 1 reply; 5+ messages in thread
From: Shradha Gupta @ 2023-06-29  9:58 UTC (permalink / raw)
  To: linux-kernel, linux-hyperv, netdev
  Cc: Shradha Gupta, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
	K. Y. Srinivasan, Haiyang Zhang, Wei Liu, Dexuan Cui, Long Li,
	Michael Kelley, David S. Miller

A future Azure host update has the potential to change RSC behavior
in the VMs. To avoid this invisble change, Vswitch will check the
netvsc version of a VM before sending its RSC capabilities, and will
always indicate that the host performs RSC if the VM doesn't have an
updated netvsc driver regardless of the actual host RSC capabilities.
Netvsc now advertises a new capability: AllowRscDisabledStatus
The host will check for this capability before sending RSC status,
and if a VM does not have this capability it will send RSC enabled
status regardless of host RSC settings

Signed-off-by: Shradha Gupta <shradhagupta@linux.microsoft.com>
---
 drivers/net/hyperv/hyperv_net.h | 3 +++
 drivers/net/hyperv/netvsc.c     | 8 ++++++++
 2 files changed, 11 insertions(+)

diff --git a/drivers/net/hyperv/hyperv_net.h b/drivers/net/hyperv/hyperv_net.h
index dd5919ec408b..218e0f31dd66 100644
--- a/drivers/net/hyperv/hyperv_net.h
+++ b/drivers/net/hyperv/hyperv_net.h
@@ -572,6 +572,9 @@ struct nvsp_2_vsc_capability {
 			u64 teaming:1;
 			u64 vsubnetid:1;
 			u64 rsc:1;
+			u64 timestamp:1;
+			u64 reliablecorrelationid:1;
+			u64 allowrscdisabledstatus:1;
 		};
 	};
 } __packed;
diff --git a/drivers/net/hyperv/netvsc.c b/drivers/net/hyperv/netvsc.c
index da737d959e81..2eb1e85ba940 100644
--- a/drivers/net/hyperv/netvsc.c
+++ b/drivers/net/hyperv/netvsc.c
@@ -619,6 +619,14 @@ static int negotiate_nvsp_ver(struct hv_device *device,
 	init_packet->msg.v2_msg.send_ndis_config.mtu = ndev->mtu + ETH_HLEN;
 	init_packet->msg.v2_msg.send_ndis_config.capability.ieee8021q = 1;
 
+	/* Don't need a version check while setting this bit because if we
+	 * have a New VM on an old host, the VM will set the bit but the host
+	 * won't check it. If we have an old VM on a new host, the host will
+	 * check the bit, see its zero, and it'll know the VM has an
+	 * older NetVsc
+	 */
+	init_packet->msg.v2_msg.send_ndis_config.capability.allowrscdisabledstatus = 1;
+
 	if (nvsp_ver >= NVSP_PROTOCOL_VERSION_5) {
 		if (hv_is_isolation_supported())
 			netdev_info(ndev, "SR-IOV not advertised by guests on the host supporting isolation\n");
-- 
2.34.1


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

* RE: [PATCH] hv_netvsc: support a new host capability AllowRscDisabledStatus
  2023-06-29  9:58 [PATCH] hv_netvsc: support a new host capability AllowRscDisabledStatus Shradha Gupta
@ 2023-06-29 12:44 ` Haiyang Zhang
  2023-07-03  4:37   ` Shradha Gupta
  0 siblings, 1 reply; 5+ messages in thread
From: Haiyang Zhang @ 2023-06-29 12:44 UTC (permalink / raw)
  To: Shradha Gupta, linux-kernel, linux-hyperv, netdev
  Cc: Eric Dumazet, Jakub Kicinski, Paolo Abeni, KY Srinivasan,
	Wei Liu, Dexuan Cui, Long Li, Michael Kelley (LINUX),
	David S. Miller



> -----Original Message-----
> From: Shradha Gupta <shradhagupta@linux.microsoft.com>
> Sent: Thursday, June 29, 2023 5:59 AM
> To: linux-kernel@vger.kernel.org; linux-hyperv@vger.kernel.org;
> netdev@vger.kernel.org
> Cc: Shradha Gupta <shradhagupta@linux.microsoft.com>; Eric Dumazet
> <edumazet@google.com>; Jakub Kicinski <kuba@kernel.org>; Paolo Abeni
> <pabeni@redhat.com>; KY Srinivasan <kys@microsoft.com>; Haiyang Zhang
> <haiyangz@microsoft.com>; Wei Liu <wei.liu@kernel.org>; Dexuan Cui
> <decui@microsoft.com>; Long Li <longli@microsoft.com>; Michael Kelley
> (LINUX) <mikelley@microsoft.com>; David S. Miller <davem@davemloft.net>
> Subject: [PATCH] hv_netvsc: support a new host capability
> AllowRscDisabledStatus
> 
> A future Azure host update has the potential to change RSC behavior
> in the VMs. To avoid this invisble change, Vswitch will check the
> netvsc version of a VM before sending its RSC capabilities, and will
> always indicate that the host performs RSC if the VM doesn't have an
> updated netvsc driver regardless of the actual host RSC capabilities.
> Netvsc now advertises a new capability: AllowRscDisabledStatus
> The host will check for this capability before sending RSC status,
> and if a VM does not have this capability it will send RSC enabled
> status regardless of host RSC settings
> 
> Signed-off-by: Shradha Gupta <shradhagupta@linux.microsoft.com>
> ---
>  drivers/net/hyperv/hyperv_net.h | 3 +++
>  drivers/net/hyperv/netvsc.c     | 8 ++++++++
>  2 files changed, 11 insertions(+)
> 
> diff --git a/drivers/net/hyperv/hyperv_net.h b/drivers/net/hyperv/hyperv_net.h
> index dd5919ec408b..218e0f31dd66 100644
> --- a/drivers/net/hyperv/hyperv_net.h
> +++ b/drivers/net/hyperv/hyperv_net.h
> @@ -572,6 +572,9 @@ struct nvsp_2_vsc_capability {
>  			u64 teaming:1;
>  			u64 vsubnetid:1;
>  			u64 rsc:1;
> +			u64 timestamp:1;
> +			u64 reliablecorrelationid:1;
> +			u64 allowrscdisabledstatus:1;
>  		};
>  	};
>  } __packed;
> diff --git a/drivers/net/hyperv/netvsc.c b/drivers/net/hyperv/netvsc.c
> index da737d959e81..2eb1e85ba940 100644
> --- a/drivers/net/hyperv/netvsc.c
> +++ b/drivers/net/hyperv/netvsc.c
> @@ -619,6 +619,14 @@ static int negotiate_nvsp_ver(struct hv_device
> *device,
>  	init_packet->msg.v2_msg.send_ndis_config.mtu = ndev->mtu +
> ETH_HLEN;
>  	init_packet->msg.v2_msg.send_ndis_config.capability.ieee8021q = 1;
> 
> +	/* Don't need a version check while setting this bit because if we
> +	 * have a New VM on an old host, the VM will set the bit but the host
> +	 * won't check it. If we have an old VM on a new host, the host will
> +	 * check the bit, see its zero, and it'll know the VM has an
> +	 * older NetVsc
> +	 */
> +	init_packet-
> >msg.v2_msg.send_ndis_config.capability.allowrscdisabledstatus = 1;

Have you tested on the new host to verify: Before this patch, the host shows
RSC status on, and after this patch the host shows it's off?

Thanks,
- Haiyang

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

* Re: [PATCH] hv_netvsc: support a new host capability AllowRscDisabledStatus
  2023-06-29 12:44 ` Haiyang Zhang
@ 2023-07-03  4:37   ` Shradha Gupta
  2023-07-18 10:18     ` Shradha Gupta
  0 siblings, 1 reply; 5+ messages in thread
From: Shradha Gupta @ 2023-07-03  4:37 UTC (permalink / raw)
  To: Haiyang Zhang
  Cc: linux-kernel, linux-hyperv, netdev, Eric Dumazet, Jakub Kicinski,
	Paolo Abeni, KY Srinivasan, Wei Liu, Dexuan Cui, Long Li,
	Michael Kelley (LINUX),
	David S. Miller

On Thu, Jun 29, 2023 at 12:44:26PM +0000, Haiyang Zhang wrote:
> 
> 
> > -----Original Message-----
> > From: Shradha Gupta <shradhagupta@linux.microsoft.com>
> > Sent: Thursday, June 29, 2023 5:59 AM
> > To: linux-kernel@vger.kernel.org; linux-hyperv@vger.kernel.org;
> > netdev@vger.kernel.org
> > Cc: Shradha Gupta <shradhagupta@linux.microsoft.com>; Eric Dumazet
> > <edumazet@google.com>; Jakub Kicinski <kuba@kernel.org>; Paolo Abeni
> > <pabeni@redhat.com>; KY Srinivasan <kys@microsoft.com>; Haiyang Zhang
> > <haiyangz@microsoft.com>; Wei Liu <wei.liu@kernel.org>; Dexuan Cui
> > <decui@microsoft.com>; Long Li <longli@microsoft.com>; Michael Kelley
> > (LINUX) <mikelley@microsoft.com>; David S. Miller <davem@davemloft.net>
> > Subject: [PATCH] hv_netvsc: support a new host capability
> > AllowRscDisabledStatus
> > 
> > A future Azure host update has the potential to change RSC behavior
> > in the VMs. To avoid this invisble change, Vswitch will check the
> > netvsc version of a VM before sending its RSC capabilities, and will
> > always indicate that the host performs RSC if the VM doesn't have an
> > updated netvsc driver regardless of the actual host RSC capabilities.
> > Netvsc now advertises a new capability: AllowRscDisabledStatus
> > The host will check for this capability before sending RSC status,
> > and if a VM does not have this capability it will send RSC enabled
> > status regardless of host RSC settings
> > 
> > Signed-off-by: Shradha Gupta <shradhagupta@linux.microsoft.com>
> > ---
> >  drivers/net/hyperv/hyperv_net.h | 3 +++
> >  drivers/net/hyperv/netvsc.c     | 8 ++++++++
> >  2 files changed, 11 insertions(+)
> > 
> > diff --git a/drivers/net/hyperv/hyperv_net.h b/drivers/net/hyperv/hyperv_net.h
> > index dd5919ec408b..218e0f31dd66 100644
> > --- a/drivers/net/hyperv/hyperv_net.h
> > +++ b/drivers/net/hyperv/hyperv_net.h
> > @@ -572,6 +572,9 @@ struct nvsp_2_vsc_capability {
> >  			u64 teaming:1;
> >  			u64 vsubnetid:1;
> >  			u64 rsc:1;
> > +			u64 timestamp:1;
> > +			u64 reliablecorrelationid:1;
> > +			u64 allowrscdisabledstatus:1;
> >  		};
> >  	};
> >  } __packed;
> > diff --git a/drivers/net/hyperv/netvsc.c b/drivers/net/hyperv/netvsc.c
> > index da737d959e81..2eb1e85ba940 100644
> > --- a/drivers/net/hyperv/netvsc.c
> > +++ b/drivers/net/hyperv/netvsc.c
> > @@ -619,6 +619,14 @@ static int negotiate_nvsp_ver(struct hv_device
> > *device,
> >  	init_packet->msg.v2_msg.send_ndis_config.mtu = ndev->mtu +
> > ETH_HLEN;
> >  	init_packet->msg.v2_msg.send_ndis_config.capability.ieee8021q = 1;
> > 
> > +	/* Don't need a version check while setting this bit because if we
> > +	 * have a New VM on an old host, the VM will set the bit but the host
> > +	 * won't check it. If we have an old VM on a new host, the host will
> > +	 * check the bit, see its zero, and it'll know the VM has an
> > +	 * older NetVsc
> > +	 */
> > +	init_packet-
> > >msg.v2_msg.send_ndis_config.capability.allowrscdisabledstatus = 1;
> 
> Have you tested on the new host to verify: Before this patch, the host shows
> RSC status on, and after this patch the host shows it's off?
I have completed the patch sanilty tests. We are working on an upgraded host setup
to test the rsc specific changes, will update with results soon.
> 
> Thanks,
> - Haiyang

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

* Re: [PATCH] hv_netvsc: support a new host capability AllowRscDisabledStatus
  2023-07-03  4:37   ` Shradha Gupta
@ 2023-07-18 10:18     ` Shradha Gupta
  2023-07-18 13:52       ` Haiyang Zhang
  0 siblings, 1 reply; 5+ messages in thread
From: Shradha Gupta @ 2023-07-18 10:18 UTC (permalink / raw)
  To: Haiyang Zhang
  Cc: linux-kernel, linux-hyperv, netdev, Eric Dumazet, Jakub Kicinski,
	Paolo Abeni, KY Srinivasan, Wei Liu, Dexuan Cui, Long Li,
	Michael Kelley (LINUX),
	David S. Miller

On Sun, Jul 02, 2023 at 09:37:42PM -0700, Shradha Gupta wrote:
> On Thu, Jun 29, 2023 at 12:44:26PM +0000, Haiyang Zhang wrote:
> > 
> > 
> > > -----Original Message-----
> > > From: Shradha Gupta <shradhagupta@linux.microsoft.com>
> > > Sent: Thursday, June 29, 2023 5:59 AM
> > > To: linux-kernel@vger.kernel.org; linux-hyperv@vger.kernel.org;
> > > netdev@vger.kernel.org
> > > Cc: Shradha Gupta <shradhagupta@linux.microsoft.com>; Eric Dumazet
> > > <edumazet@google.com>; Jakub Kicinski <kuba@kernel.org>; Paolo Abeni
> > > <pabeni@redhat.com>; KY Srinivasan <kys@microsoft.com>; Haiyang Zhang
> > > <haiyangz@microsoft.com>; Wei Liu <wei.liu@kernel.org>; Dexuan Cui
> > > <decui@microsoft.com>; Long Li <longli@microsoft.com>; Michael Kelley
> > > (LINUX) <mikelley@microsoft.com>; David S. Miller <davem@davemloft.net>
> > > Subject: [PATCH] hv_netvsc: support a new host capability
> > > AllowRscDisabledStatus
> > > 
> > > A future Azure host update has the potential to change RSC behavior
> > > in the VMs. To avoid this invisble change, Vswitch will check the
> > > netvsc version of a VM before sending its RSC capabilities, and will
> > > always indicate that the host performs RSC if the VM doesn't have an
> > > updated netvsc driver regardless of the actual host RSC capabilities.
> > > Netvsc now advertises a new capability: AllowRscDisabledStatus
> > > The host will check for this capability before sending RSC status,
> > > and if a VM does not have this capability it will send RSC enabled
> > > status regardless of host RSC settings
> > > 
> > > Signed-off-by: Shradha Gupta <shradhagupta@linux.microsoft.com>
> > > ---
> > >  drivers/net/hyperv/hyperv_net.h | 3 +++
> > >  drivers/net/hyperv/netvsc.c     | 8 ++++++++
> > >  2 files changed, 11 insertions(+)
> > > 
> > > diff --git a/drivers/net/hyperv/hyperv_net.h b/drivers/net/hyperv/hyperv_net.h
> > > index dd5919ec408b..218e0f31dd66 100644
> > > --- a/drivers/net/hyperv/hyperv_net.h
> > > +++ b/drivers/net/hyperv/hyperv_net.h
> > > @@ -572,6 +572,9 @@ struct nvsp_2_vsc_capability {
> > >  			u64 teaming:1;
> > >  			u64 vsubnetid:1;
> > >  			u64 rsc:1;
> > > +			u64 timestamp:1;
> > > +			u64 reliablecorrelationid:1;
> > > +			u64 allowrscdisabledstatus:1;
> > >  		};
> > >  	};
> > >  } __packed;
> > > diff --git a/drivers/net/hyperv/netvsc.c b/drivers/net/hyperv/netvsc.c
> > > index da737d959e81..2eb1e85ba940 100644
> > > --- a/drivers/net/hyperv/netvsc.c
> > > +++ b/drivers/net/hyperv/netvsc.c
> > > @@ -619,6 +619,14 @@ static int negotiate_nvsp_ver(struct hv_device
> > > *device,
> > >  	init_packet->msg.v2_msg.send_ndis_config.mtu = ndev->mtu +
> > > ETH_HLEN;
> > >  	init_packet->msg.v2_msg.send_ndis_config.capability.ieee8021q = 1;
> > > 
> > > +	/* Don't need a version check while setting this bit because if we
> > > +	 * have a New VM on an old host, the VM will set the bit but the host
> > > +	 * won't check it. If we have an old VM on a new host, the host will
> > > +	 * check the bit, see its zero, and it'll know the VM has an
> > > +	 * older NetVsc
> > > +	 */
> > > +	init_packet-
> > > >msg.v2_msg.send_ndis_config.capability.allowrscdisabledstatus = 1;
> > 
> > Have you tested on the new host to verify: Before this patch, the host shows
> > RSC status on, and after this patch the host shows it's off?
> I have completed the patch sanilty tests. We are working on an upgraded host setup
> to test the rsc specific changes, will update with results soon.
> > 
> > Thanks,
> > - Haiyang

Completed this testing, rsc status reflects properly with the patch.

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

* RE: [PATCH] hv_netvsc: support a new host capability AllowRscDisabledStatus
  2023-07-18 10:18     ` Shradha Gupta
@ 2023-07-18 13:52       ` Haiyang Zhang
  0 siblings, 0 replies; 5+ messages in thread
From: Haiyang Zhang @ 2023-07-18 13:52 UTC (permalink / raw)
  To: Shradha Gupta
  Cc: linux-kernel, linux-hyperv, netdev, Eric Dumazet, Jakub Kicinski,
	Paolo Abeni, KY Srinivasan, Wei Liu, Dexuan Cui, Long Li,
	Michael Kelley (LINUX),
	David S. Miller



> -----Original Message-----
> From: Shradha Gupta <shradhagupta@linux.microsoft.com>
> Sent: Tuesday, July 18, 2023 6:19 AM
> To: Haiyang Zhang <haiyangz@microsoft.com>
> Cc: linux-kernel@vger.kernel.org; linux-hyperv@vger.kernel.org;
> netdev@vger.kernel.org; Eric Dumazet <edumazet@google.com>; Jakub Kicinski
> <kuba@kernel.org>; Paolo Abeni <pabeni@redhat.com>; KY Srinivasan
> <kys@microsoft.com>; Wei Liu <wei.liu@kernel.org>; Dexuan Cui
> <decui@microsoft.com>; Long Li <longli@microsoft.com>; Michael Kelley
> (LINUX) <mikelley@microsoft.com>; David S. Miller <davem@davemloft.net>
> Subject: Re: [PATCH] hv_netvsc: support a new host capability
> AllowRscDisabledStatus
> 
> On Sun, Jul 02, 2023 at 09:37:42PM -0700, Shradha Gupta wrote:
> > On Thu, Jun 29, 2023 at 12:44:26PM +0000, Haiyang Zhang wrote:
> > >
> > >
> > > > -----Original Message-----
> > > > From: Shradha Gupta <shradhagupta@linux.microsoft.com>
> > > > Sent: Thursday, June 29, 2023 5:59 AM
> > > > To: linux-kernel@vger.kernel.org; linux-hyperv@vger.kernel.org;
> > > > netdev@vger.kernel.org
> > > > Cc: Shradha Gupta <shradhagupta@linux.microsoft.com>; Eric Dumazet
> > > > <edumazet@google.com>; Jakub Kicinski <kuba@kernel.org>; Paolo Abeni
> > > > <pabeni@redhat.com>; KY Srinivasan <kys@microsoft.com>; Haiyang
> Zhang
> > > > <haiyangz@microsoft.com>; Wei Liu <wei.liu@kernel.org>; Dexuan Cui
> > > > <decui@microsoft.com>; Long Li <longli@microsoft.com>; Michael Kelley
> > > > (LINUX) <mikelley@microsoft.com>; David S. Miller
> <davem@davemloft.net>
> > > > Subject: [PATCH] hv_netvsc: support a new host capability
> > > > AllowRscDisabledStatus
> > > >
> > > > A future Azure host update has the potential to change RSC behavior
> > > > in the VMs. To avoid this invisble change, Vswitch will check the
> > > > netvsc version of a VM before sending its RSC capabilities, and will
> > > > always indicate that the host performs RSC if the VM doesn't have an
> > > > updated netvsc driver regardless of the actual host RSC capabilities.
> > > > Netvsc now advertises a new capability: AllowRscDisabledStatus
> > > > The host will check for this capability before sending RSC status,
> > > > and if a VM does not have this capability it will send RSC enabled
> > > > status regardless of host RSC settings
> > > >
> > > > Signed-off-by: Shradha Gupta <shradhagupta@linux.microsoft.com>
> > > > ---
> > > >  drivers/net/hyperv/hyperv_net.h | 3 +++
> > > >  drivers/net/hyperv/netvsc.c     | 8 ++++++++
> > > >  2 files changed, 11 insertions(+)
> > > >
> > > > diff --git a/drivers/net/hyperv/hyperv_net.h
> b/drivers/net/hyperv/hyperv_net.h
> > > > index dd5919ec408b..218e0f31dd66 100644
> > > > --- a/drivers/net/hyperv/hyperv_net.h
> > > > +++ b/drivers/net/hyperv/hyperv_net.h
> > > > @@ -572,6 +572,9 @@ struct nvsp_2_vsc_capability {
> > > >  			u64 teaming:1;
> > > >  			u64 vsubnetid:1;
> > > >  			u64 rsc:1;
> > > > +			u64 timestamp:1;
> > > > +			u64 reliablecorrelationid:1;
> > > > +			u64 allowrscdisabledstatus:1;
> > > >  		};
> > > >  	};
> > > >  } __packed;
> > > > diff --git a/drivers/net/hyperv/netvsc.c b/drivers/net/hyperv/netvsc.c
> > > > index da737d959e81..2eb1e85ba940 100644
> > > > --- a/drivers/net/hyperv/netvsc.c
> > > > +++ b/drivers/net/hyperv/netvsc.c
> > > > @@ -619,6 +619,14 @@ static int negotiate_nvsp_ver(struct hv_device
> > > > *device,
> > > >  	init_packet->msg.v2_msg.send_ndis_config.mtu = ndev->mtu +
> > > > ETH_HLEN;
> > > >  	init_packet->msg.v2_msg.send_ndis_config.capability.ieee8021q = 1;
> > > >
> > > > +	/* Don't need a version check while setting this bit because if we
> > > > +	 * have a New VM on an old host, the VM will set the bit but the host
> > > > +	 * won't check it. If we have an old VM on a new host, the host will
> > > > +	 * check the bit, see its zero, and it'll know the VM has an
> > > > +	 * older NetVsc
> > > > +	 */
> > > > +	init_packet-
> > > > >msg.v2_msg.send_ndis_config.capability.allowrscdisabledstatus = 1;
> > >
> > > Have you tested on the new host to verify: Before this patch, the host shows
> > > RSC status on, and after this patch the host shows it's off?
> > I have completed the patch sanilty tests. We are working on an upgraded host
> setup
> > to test the rsc specific changes, will update with results soon.
> > >
> > > Thanks,
> > > - Haiyang
> 
> Completed this testing, rsc status reflects properly with the patch.

Thanks for the update.

Reviewed-by: Haiyang Zhang <haiyangz@microsoft.com>


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

end of thread, other threads:[~2023-07-18 13:52 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-06-29  9:58 [PATCH] hv_netvsc: support a new host capability AllowRscDisabledStatus Shradha Gupta
2023-06-29 12:44 ` Haiyang Zhang
2023-07-03  4:37   ` Shradha Gupta
2023-07-18 10:18     ` Shradha Gupta
2023-07-18 13:52       ` Haiyang Zhang

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).