Skip to contentSkip to conversation

scsi: storvsc: Don't call the packet status the hypercall status

PATCH In review Roman Kisel 3 participants 6 messages Feb 27, 2025 – Feb 28, 2025

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

PATCH 1/1 scsi: storvsc: Don't call the packet status the hypercall status

The log statement reports the packet status code as the hypercall status code which causes confusion when debugging.

Fix the name of the datum being logged.

---
 drivers/scsi/storvsc_drv.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/scsi/storvsc_drv.c +1 -1
index a8614e54544e..d7ec79536d9a 100644
@@ -1183,7 +1183,7 @@ static void storvsc_on_io_completion(struct storvsc_device *stor_device,
 			STORVSC_LOGGING_WARN : STORVSC_LOGGING_ERROR;
 
 		storvsc_log_ratelimited(device, loglevel,
-			"tag#%d cmd 0x%x status: scsi 0x%x srb 0x%x hv 0x%x\n",
+			"tag#%d cmd 0x%x status: scsi 0x%x srb 0x%x sts 0x%x\n",
 			scsi_cmd_to_rq(request->cmd)->tag,
 			stor_pkt->vm_srb.cdb[0],
 			vstor_packet->vm_srb.scsi_status,
Signature · 1 line
2.43.0
#1 lore raw
Quoted 15 lines · Roman Kisel

The log statement reports the packet status code as the hypercall status code which causes confusion when debugging.

Fix the name of the datum being logged.

---
 drivers/scsi/storvsc_drv.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/scsi/storvsc_drv.c +0 -0
index a8614e54544e..d7ec79536d9a 100644

drivers/scsi/storvsc_drv.c static void storvsc_on_io_completion(struct storvsc_device *stor_device, · line 1186

Quoted 5 lines
drivers/scsi/storvsc_drv.c +1 -1
@@ -1183,7 +1183,7 @@ static void storvsc_on_io_completion(struct storvsc_device *stor_device,
 			STORVSC_LOGGING_WARN : STORVSC_LOGGING_ERROR;
 
 		storvsc_log_ratelimited(device, loglevel,
-			"tag#%d cmd 0x%x status: scsi 0x%x srb 0x%x hv 0x%x\n",
+			"tag#%d cmd 0x%x status: scsi 0x%x srb 0x%x sts 0x%x\n",

I'd suggest using "host" than the opaque "sts", since this is already part of the different levels of status (scsi, srb...) being printed out. With "host", for e.g. the print would be seen as the following and clearly point out the offending part of the stack.

hv_storvsc fd1d2cbd-ce7c-535c-966b-eb5f811c95f0: tag#599 cmd 0x28 status: scsi 0x2 srb 0x4 host 0xc0000001

Thanks,
Easwar (he/him)

#2 lore raw
Quoted 26 lines · Easwar Hariharan
Quoted 15 lines · Roman Kisel

The log statement reports the packet status code as the hypercall status code which causes confusion when debugging.

Fix the name of the datum being logged.

---
  drivers/scsi/storvsc_drv.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
drivers/scsi/storvsc_drv.c +0 -0
index a8614e54544e..d7ec79536d9a 100644

drivers/scsi/storvsc_drv.c static void storvsc_on_io_completion(struct storvsc_device *stor_device, · line 1186

Quoted 5 lines
drivers/scsi/storvsc_drv.c +1 -1
@@ -1183,7 +1183,7 @@ static void storvsc_on_io_completion(struct storvsc_device *stor_device,
  			STORVSC_LOGGING_WARN : STORVSC_LOGGING_ERROR;
 
  		storvsc_log_ratelimited(device, loglevel,
-			"tag#%d cmd 0x%x status: scsi 0x%x srb 0x%x hv 0x%x\n",
+			"tag#%d cmd 0x%x status: scsi 0x%x srb 0x%x sts 0x%x\n",

I'd suggest using "host" than the opaque "sts", since this is already part of the different levels of status (scsi, srb...) being printed out. With "host", for e.g. the print would be seen as the following and clearly point out the offending part of the stack.

Quoted 1 line

hv_storvsc fd1d2cbd-ce7c-535c-966b-eb5f811c95f0: tag#599 cmd 0x28 status: scsi 0x2 srb 0x4 host 0xc0000001

I went with the flow calling this "sts": the rest of the file does that. Your suggestion is better than that, will implement in the next version.

Appreciate your help very much!

Quoted 3 lines

Thanks,
Easwar (he/him)

Signature · 2 lines
Thank you,
Roman
Reviewed-by on v1 1/1
#3 lore raw
In reply to Roman Kisel

From: Roman Kisel <[email protected]> Sent: Thursday, February 27, 2025 3:31 PM

Quoted 16 lines

The log statement reports the packet status code as the hypercall status code which causes confusion when debugging.

Fix the name of the datum being logged.

---
 drivers/scsi/storvsc_drv.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/scsi/storvsc_drv.c +0 -0
index a8614e54544e..d7ec79536d9a 100644

drivers/scsi/storvsc_drv.c static void storvsc_on_io_completion(struct storvsc_device *stor_device, · line 1189

Quoted 8 lines
drivers/scsi/storvsc_drv.c +1 -1
@@ -1183,7 +1183,7 @@ static void storvsc_on_io_completion(struct storvsc_device *stor_device,
 			STORVSC_LOGGING_WARN : STORVSC_LOGGING_ERROR;
 
 		storvsc_log_ratelimited(device, loglevel,
-			"tag#%d cmd 0x%x status: scsi 0x%x srb 0x%x hv 0x%x\n",
+			"tag#%d cmd 0x%x status: scsi 0x%x srb 0x%x sts 0x%x\n",
 			scsi_cmd_to_rq(request->cmd)->tag,
 			stor_pkt->vm_srb.cdb[0],
 			vstor_packet->vm_srb.scsi_status,

FWIW, I added that last status value labelled "hv" in commit 08f76547f08d. And to confirm the discussion on the other thread, it's not a hypercall status -- it's a standard Windows NT status returned by the host-side VMBus or storvsp code. The "hv" is shorthand for Hyper-V, not hypercall. Perhaps that status is interpretable in a Windows guest, but it's not really interpretable in a Linux guest. The hex value would be useful only in the context of a support case where someone on the host side could be engaged to help with the interpretation.

I have no strong opinions on the label. Changing it from "hv" to "sts" or to "host" works for me.

#4 lore raw
Quoted 35 lines · Michael Kelley

From: Roman Kisel <[email protected]> Sent: Thursday, February 27, 2025 3:31 PM

Quoted 16 lines

The log statement reports the packet status code as the hypercall status code which causes confusion when debugging.

Fix the name of the datum being logged.

---
  drivers/scsi/storvsc_drv.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
drivers/scsi/storvsc_drv.c +0 -0
index a8614e54544e..d7ec79536d9a 100644

drivers/scsi/storvsc_drv.c static void storvsc_on_io_completion(struct storvsc_device *stor_device, · line 1189

Quoted 8 lines
drivers/scsi/storvsc_drv.c +1 -1
@@ -1183,7 +1183,7 @@ static void storvsc_on_io_completion(struct storvsc_device *stor_device,
  			STORVSC_LOGGING_WARN : STORVSC_LOGGING_ERROR;
 
  		storvsc_log_ratelimited(device, loglevel,
-			"tag#%d cmd 0x%x status: scsi 0x%x srb 0x%x hv 0x%x\n",
+			"tag#%d cmd 0x%x status: scsi 0x%x srb 0x%x sts 0x%x\n",
  			scsi_cmd_to_rq(request->cmd)->tag,
  			stor_pkt->vm_srb.cdb[0],
  			vstor_packet->vm_srb.scsi_status,

FWIW, I added that last status value labelled "hv" in commit 08f76547f08d. And to confirm the discussion on the other thread, it's not a hypercall status -- it's a standard Windows NT status returned by the host-side VMBus or storvsp code. The "hv" is shorthand for Hyper-V, not hypercall. Perhaps that status is interpretable in a Windows guest, but it's not really interpretable in a Linux guest. The hex value would be useful only in the context of a support case where someone on the host side could be engaged to help with the interpretation.

Quoted 2 lines

I have no strong opinions on the label. Changing it from "hv" to "sts" or to "host" works for me.

Thank you, Michael, for helping us out with that! I'm leaning towards "host" after Easwar's suggestion. As I understand from your reply, it's fair to keep the tag as you're fine with the "host" option.

Quoted 2 lines
Signature · 2 lines
Thank you,
Roman
#5 lore raw

From: Roman Kisel <[email protected]> Sent: Friday, February 28, 2025 2:55 PM

Quoted 38 lines · Michael Kelley
Quoted 1 line

From: Roman Kisel <[email protected]> Sent: Thursday, February 27, 2025

3:31 PM

Quoted 34 lines
Quoted 16 lines

The log statement reports the packet status code as the hypercall status code which causes confusion when debugging.

Fix the name of the datum being logged.

---
  drivers/scsi/storvsc_drv.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
drivers/scsi/storvsc_drv.c +0 -0
index a8614e54544e..d7ec79536d9a 100644

drivers/scsi/storvsc_drv.c static void storvsc_on_io_completion(struct storvsc_device *stor_device, · line 1189

Quoted 8 lines
drivers/scsi/storvsc_drv.c +1 -1
@@ -1183,7 +1183,7 @@ static void storvsc_on_io_completion(struct storvsc_device *stor_device,
  			STORVSC_LOGGING_WARN : STORVSC_LOGGING_ERROR;
 
  		storvsc_log_ratelimited(device, loglevel,
-			"tag#%d cmd 0x%x status: scsi 0x%x srb 0x%x hv 0x%x\n",
+			"tag#%d cmd 0x%x status: scsi 0x%x srb 0x%x sts 0x%x\n",
  			scsi_cmd_to_rq(request->cmd)->tag,
  			stor_pkt->vm_srb.cdb[0],
  			vstor_packet->vm_srb.scsi_status,

FWIW, I added that last status value labelled "hv" in commit 08f76547f08d. And to confirm the discussion on the other thread, it's not a hypercall status -- it's a standard Windows NT status returned by the host-side VMBus or storvsp code. The "hv" is shorthand for Hyper-V, not hypercall. Perhaps that status is interpretable in a Windows guest, but it's not really interpretable in a Linux guest. The hex value would be useful only in the context of a support case where someone on the host side could be engaged to help with the interpretation.

Quoted 6 lines
Quoted 2 lines

I have no strong opinions on the label. Changing it from "hv" to "sts" or to "host" works for me.

Thank you, Michael, for helping us out with that! I'm leaning towards "host" after Easwar's suggestion. As I understand from your reply, it's fair to keep the tag as you're fine with the "host" option.

Yes, my Reviewed-by: is good using "host". Also remember to fix the commit message to not call it a "hypercall status code" since it isn't from a hypercall.

Michael

Quoted 7 lines
Quoted 3 lines

--
Thank you,
Roman