Skip to contentSkip to conversation

storvsc, netvsc: Improve logging

PATCH New Andrea Parri (Microsoft) 2 participants 4 messages Apr 7, 2022 – Apr 8, 2022

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

cover storvsc, netvsc: Improve logging

Two small (and independent) patches to augment and "standardize" the error messages.

Thanks,
Andrea

Andrea Parri (Microsoft) (2):
scsi: storvsc: Print value of invalid ID in
storvsc_on_channel_callback()
hv_netvsc: Print value of invalid ID in
netvsc_send_{completion,tx_complete}()

 drivers/net/hyperv/netvsc.c | 8 ++++----
 drivers/scsi/storvsc_drv.c  | 3 ++-
 2 files changed, 6 insertions(+), 5 deletions(-)
Signature · 1 line
2.25.1
#1 lore raw

PATCH 1/2 scsi: storvsc: Print value of invalid ID in storvsc_on_channel_callback()

That being useful for debugging purposes.

---
 drivers/scsi/storvsc_drv.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/scsi/storvsc_drv.c +2 -1
index 9a0bba5a51a71..67ae2b5b1d5bb 100644
@@ -1334,7 +1334,8 @@ static void storvsc_on_channel_callback(void *context)
 				/* Transaction 'rqst_id' corresponds to tag 'rqst_id - 1' */
 				scmnd = scsi_host_find_tag(shost, rqst_id - 1);
 				if (scmnd == NULL) {
-					dev_err(&device->device, "Incorrect transaction ID\n");
+					dev_err(&device->device, "Invalid transaction ID %llx\n",
+						rqst_id);
 					continue;
 				}
 				request = (struct storvsc_cmd_request *)scsi_cmd_priv(scmnd);
Signature · 1 line
2.25.1
#2 lore raw

PATCH 2/2 hv_netvsc: Print value of invalid ID in netvsc_send_{completion,tx_complete}()

In reply to Andrea Parri (Microsoft)

That being useful for debugging purposes.

Notice that the packet descriptor is in "private" guest memory, so that Hyper-V can not tamper with it.

While at it, remove two unnecessary u64-casts.

---
 drivers/net/hyperv/netvsc.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/net/hyperv/netvsc.c +4 -4
index 9442f751ad3aa..4061af5baaea3 100644
@@ -792,9 +792,9 @@ static void netvsc_send_tx_complete(struct net_device *ndev,
 	int queue_sends;
 	u64 cmd_rqst;
 
-	cmd_rqst = channel->request_addr_callback(channel, (u64)desc->trans_id);
+	cmd_rqst = channel->request_addr_callback(channel, desc->trans_id);
 	if (cmd_rqst == VMBUS_RQST_ERROR) {
-		netdev_err(ndev, "Incorrect transaction id\n");
+		netdev_err(ndev, "Invalid transaction ID %llx\n", desc->trans_id);
 		return;
 	}
 
@@ -854,9 +854,9 @@ static void netvsc_send_completion(struct net_device *ndev,
 	/* First check if this is a VMBUS completion without data payload */
 	if (!msglen) {
 		cmd_rqst = incoming_channel->request_addr_callback(incoming_channel,
-								   (u64)desc->trans_id);
+								   desc->trans_id);
 		if (cmd_rqst == VMBUS_RQST_ERROR) {
-			netdev_err(ndev, "Invalid transaction id\n");
+			netdev_err(ndev, "Invalid transaction ID %llx\n", desc->trans_id);
 			return;
 		}
 
Signature · 1 line
2.25.1
#3 lore raw
In reply to Andrea Parri (Microsoft)
This series was applied to netdev/net-next.git (master) by Jakub Kicinski <[email protected]>:

Hello:

This series was applied to netdev/net-next.git (master) by Jakub Kicinski <[email protected]>:

Quoted 6 lines · On Thu, 7 Apr 2022 06:40:32 +0200 you wrote:

Two small (and independent) patches to augment and "standardize" the error messages.

Thanks,
Andrea

Quoted 7 lines

Andrea Parri (Microsoft) (2):
scsi: storvsc: Print value of invalid ID in
storvsc_on_channel_callback()
hv_netvsc: Print value of invalid ID in
netvsc_send_{completion,tx_complete}()

[...]

Here is the summary with links:
- [1/2] scsi: storvsc: Print value of invalid ID in storvsc_on_channel_callback() (no matching commit)
- [2/2] hv_netvsc: Print value of invalid ID in netvsc_send_{completion,tx_complete}()

    https://git.kernel.org/netdev/net-next/c/26894cd97116

You are awesome, thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html