Skip to contentSkip to conversation

hv_netvsc: support a new host capability AllowRscDisabledStatus

PATCH In review Shradha Gupta 2 participants 5 messages Jun 29, 2023 – Jul 18, 2023

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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

---
 drivers/net/hyperv/hyperv_net.h | 3 +++
 drivers/net/hyperv/netvsc.c     | 8 ++++++++
 2 files changed, 11 insertions(+)
drivers/net/hyperv/hyperv_net.h +3 -0
index dd5919ec408b..218e0f31dd66 100644
@@ -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;
drivers/net/hyperv/netvsc.c +8 -0
index da737d959e81..2eb1e85ba940 100644
@@ -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");
Signature · 1 line
2.34.1
maintainer
#1 lore raw
Quoted 54 lines

-----Original Message-----
From: Shradha Gupta <[email protected]>
Sent: Thursday, June 29, 2023 5:59 AM
To: [email protected]; [email protected]; [email protected]
Cc: Shradha Gupta <[email protected]>; Eric Dumazet <[email protected]>; Jakub Kicinski <[email protected]>; Paolo Abeni <[email protected]>; KY Srinivasan <[email protected]>; Haiyang Zhang <[email protected]>; Wei Liu <[email protected]>; Dexuan Cui <[email protected]>; Long Li <[email protected]>; Michael Kelley (LINUX) <[email protected]>; David S. Miller <[email protected]>
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

---
 drivers/net/hyperv/hyperv_net.h | 3 +++
 drivers/net/hyperv/netvsc.c     | 8 ++++++++
 2 files changed, 11 insertions(+)
drivers/net/hyperv/hyperv_net.h +3 -0
index dd5919ec408b..218e0f31dd66 100644
@@ -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;
drivers/net/hyperv/netvsc.c +0 -0
index da737d959e81..2eb1e85ba940 100644
@@ -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;

drivers/net/hyperv/netvsc.c static int negotiate_nvsp_ver(struct hv_device · line 631

Quoted 10 lines
drivers/net/hyperv/netvsc.c +7 -0
 	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

#2 lore raw
Quoted 63 lines · Haiyang Zhang
Quoted 63 lines

-----Original Message-----
From: Shradha Gupta <[email protected]>
Sent: Thursday, June 29, 2023 5:59 AM
To: [email protected]; [email protected]; [email protected]
Cc: Shradha Gupta <[email protected]>; Eric Dumazet <[email protected]>; Jakub Kicinski <[email protected]>; Paolo Abeni <[email protected]>; KY Srinivasan <[email protected]>; Haiyang Zhang <[email protected]>; Wei Liu <[email protected]>; Dexuan Cui <[email protected]>; Long Li <[email protected]>; Michael Kelley (LINUX) <[email protected]>; David S. Miller <[email protected]>
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

---
 drivers/net/hyperv/hyperv_net.h | 3 +++
 drivers/net/hyperv/netvsc.c     | 8 ++++++++
 2 files changed, 11 insertions(+)
drivers/net/hyperv/hyperv_net.h +3 -0
index dd5919ec408b..218e0f31dd66 100644
@@ -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;
drivers/net/hyperv/netvsc.c +7 -0
index da737d959e81..2eb1e85ba940 100644
@@ -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-
Quoted 4 lines

drivers/net/hyperv/netvsc.c static int negotiate_nvsp_ver(struct hv_device · line 631

Quoted 1 line
drivers/net/hyperv/netvsc.c +0 -0
 >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.

Quoted 3 lines

Thanks,
- Haiyang

#3 lore raw
Quoted 64 lines · Shradha Gupta
Quoted 63 lines · Haiyang Zhang
Quoted 63 lines

-----Original Message-----
From: Shradha Gupta <[email protected]>
Sent: Thursday, June 29, 2023 5:59 AM
To: [email protected]; [email protected]; [email protected]
Cc: Shradha Gupta <[email protected]>; Eric Dumazet <[email protected]>; Jakub Kicinski <[email protected]>; Paolo Abeni <[email protected]>; KY Srinivasan <[email protected]>; Haiyang Zhang <[email protected]>; Wei Liu <[email protected]>; Dexuan Cui <[email protected]>; Long Li <[email protected]>; Michael Kelley (LINUX) <[email protected]>; David S. Miller <[email protected]>
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

---
 drivers/net/hyperv/hyperv_net.h | 3 +++
 drivers/net/hyperv/netvsc.c     | 8 ++++++++
 2 files changed, 11 insertions(+)
drivers/net/hyperv/hyperv_net.h +3 -0
index dd5919ec408b..218e0f31dd66 100644
@@ -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;
drivers/net/hyperv/netvsc.c +7 -0
index da737d959e81..2eb1e85ba940 100644
@@ -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-
Quoted 9 lines
Quoted 4 lines

drivers/net/hyperv/netvsc.c static int negotiate_nvsp_ver(struct hv_device · line 631

Quoted 1 line
drivers/net/hyperv/netvsc.c +0 -0
 >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.

Quoted 3 lines

Thanks,
- Haiyang

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

maintainer Reviewed-by
#4 lore raw
Quoted 87 lines

-----Original Message-----
From: Shradha Gupta <[email protected]>
Sent: Tuesday, July 18, 2023 6:19 AM
To: Haiyang Zhang <[email protected]>
Cc: [email protected]; [email protected]; [email protected]; Eric Dumazet <[email protected]>; Jakub Kicinski <[email protected]>; Paolo Abeni <[email protected]>; KY Srinivasan <[email protected]>; Wei Liu <[email protected]>; Dexuan Cui <[email protected]>; Long Li <[email protected]>; Michael Kelley (LINUX) <[email protected]>; David S. Miller <[email protected]>
Subject: Re: [PATCH] hv_netvsc: support a new host capability AllowRscDisabledStatus

Quoted 11 lines · Shradha Gupta
Quoted 10 lines · Haiyang Zhang
Quoted 10 lines

-----Original Message-----
From: Shradha Gupta <[email protected]>
Sent: Thursday, June 29, 2023 5:59 AM
To: [email protected]; [email protected]; [email protected]
Cc: Shradha Gupta <[email protected]>; Eric Dumazet <[email protected]>; Jakub Kicinski <[email protected]>; Paolo Abeni <[email protected]>; KY Srinivasan <[email protected]>; Haiyang

Zhang

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

<[email protected]>; Wei Liu <[email protected]>; Dexuan Cui <[email protected]>; Long Li <[email protected]>; Michael Kelley (LINUX) <[email protected]>; David S. Miller

<[email protected]>

Quoted 13 lines
Quoted 13 lines
Quoted 13 lines

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

Quoted 7 lines
Quoted 7 lines

Review

Quoted 7 lines
---
 drivers/net/hyperv/hyperv_net.h | 3 +++
 drivers/net/hyperv/netvsc.c     | 8 ++++++++
 2 files changed, 11 insertions(+)
(quoted diff) +0 -0

b/drivers/net/hyperv/hyperv_net.h

Quoted 34 lines
Quoted 34 lines
Quoted 21 lines

index dd5919ec408b..218e0f31dd66 100644

drivers/net/hyperv/hyperv_net.h +3 -0
@@ -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;
drivers/net/hyperv/netvsc.c +0 -0
index da737d959e81..2eb1e85ba940 100644
@@ -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;

drivers/net/hyperv/netvsc.c static int negotiate_nvsp_ver(struct hv_device · line 631

Quoted 10 lines
drivers/net/hyperv/netvsc.c +7 -0
 	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?

Quoted 8 lines
Quoted 1 line

I have completed the patch sanilty tests. We are working on an upgraded host

setup

Quoted 4 lines

to test the rsc specific changes, will update with results soon.

Quoted 3 lines

Thanks,
- Haiyang

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

Thanks for the update.