Patchwork [dpdk-dev,v2,4/4] bus/vmbus: debug subchannel setup

login
register
mail settings
Submitter Stephen Hemminger
Date Dec. 5, 2018, 10:11 p.m.
Message ID <20181205221159.6336-4-stephen@networkplumber.org>
Download mbox | patch
Permalink /patch/673539/
State New
Headers show

Comments

Stephen Hemminger - Dec. 5, 2018, 10:11 p.m.
Add more instrumentation to subchannel setup to help diagnose
startup issues.

Signed-off-by: Stephen Hemminger <sthemmin@microsoft.com>
---
 drivers/bus/vmbus/linux/vmbus_uio.c | 24 +++++++++++++++---------
 1 file changed, 15 insertions(+), 9 deletions(-)

Patch

diff --git a/drivers/bus/vmbus/linux/vmbus_uio.c b/drivers/bus/vmbus/linux/vmbus_uio.c
index 38df4d724ed5..09f7efdca286 100644
--- a/drivers/bus/vmbus/linux/vmbus_uio.c
+++ b/drivers/bus/vmbus/linux/vmbus_uio.c
@@ -357,19 +357,25 @@  int vmbus_uio_get_subchan(struct vmbus_channel *primary,
 			continue;
 		}
 
-		if (!vmbus_isnew_subchannel(primary, relid))
-			continue;	/* Already know about you */
+		if (!vmbus_isnew_subchannel(primary, relid)) {
+			VMBUS_LOG(DEBUG, "skip already found channel: %lu",
+				  relid);
+			continue;
+		}
 
-		if (!vmbus_uio_ring_present(dev, relid))
-			continue;	/* Ring may not be ready yet */
+		if (!vmbus_uio_ring_present(dev, relid)) {
+			VMBUS_LOG(DEBUG, "ring mmap not found (yet) for: %lu",
+				  relid);
+			continue;
+		}
 
 		snprintf(subchan_path, sizeof(subchan_path), "%s/%lu",
 			 chan_path, relid);
 		err = vmbus_uio_sysfs_read(subchan_path, "subchannel_id",
 					   &subid, UINT16_MAX);
 		if (err) {
-			VMBUS_LOG(NOTICE, "invalid subchannel id %lu",
-				  subid);
+			VMBUS_LOG(NOTICE, "no subchannel_id in %s:%s",
+				  subchan_path, strerror(-err));
 			goto fail;
 		}
 
@@ -379,14 +385,14 @@  int vmbus_uio_get_subchan(struct vmbus_channel *primary,
 		err = vmbus_uio_sysfs_read(subchan_path, "monitor_id",
 					   &monid, UINT8_MAX);
 		if (err) {
-			VMBUS_LOG(NOTICE, "invalid monitor id %lu",
-				  monid);
+			VMBUS_LOG(NOTICE, "no monitor_id in %s:%s",
+				  subchan_path, strerror(-err));
 			goto fail;
 		}
 
 		err = vmbus_chan_create(dev, relid, subid, monid, subchan);
 		if (err) {
-			VMBUS_LOG(NOTICE, "subchannel setup failed");
+			VMBUS_LOG(ERR, "subchannel setup failed");
 			goto fail;
 		}
 		break;