diff mbox series

[v4,04/10] net/ifc: dump debug message for error

Message ID 20181214211612.167681-5-xiao.w.wang@intel.com (mailing list archive)
State Superseded, archived
Delegated to: Maxime Coquelin
Headers show
Series support SW assisted VDPA live migration | expand

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation success Compilation OK

Commit Message

Wang, Xiao W Dec. 14, 2018, 9:16 p.m. UTC
Driver probe may fail for different causes, debug message is helpful for
debugging issue.

Signed-off-by: Xiao Wang <xiao.w.wang@intel.com>
---
 drivers/net/ifc/ifcvf_vdpa.c | 19 +++++++++++++------
 1 file changed, 13 insertions(+), 6 deletions(-)

Comments

Maxime Coquelin Dec. 16, 2018, 9:11 a.m. UTC | #1
On 12/14/18 10:16 PM, Xiao Wang wrote:
> Driver probe may fail for different causes, debug message is helpful for
> debugging issue.
> 
> Signed-off-by: Xiao Wang <xiao.w.wang@intel.com>
> ---
>   drivers/net/ifc/ifcvf_vdpa.c | 19 +++++++++++++------
>   1 file changed, 13 insertions(+), 6 deletions(-)
> 

Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>

Thanks,
Maxime
diff mbox series

Patch

diff --git a/drivers/net/ifc/ifcvf_vdpa.c b/drivers/net/ifc/ifcvf_vdpa.c
index e844109f3..aacd5f9bf 100644
--- a/drivers/net/ifc/ifcvf_vdpa.c
+++ b/drivers/net/ifc/ifcvf_vdpa.c
@@ -22,7 +22,7 @@ 
 
 #define DRV_LOG(level, fmt, args...) \
 	rte_log(RTE_LOG_ ## level, ifcvf_vdpa_logtype, \
-		"%s(): " fmt "\n", __func__, ##args)
+		"IFCVF %s(): " fmt "\n", __func__, ##args)
 
 #ifndef PAGE_SIZE
 #define PAGE_SIZE 4096
@@ -756,11 +756,16 @@  ifcvf_pci_probe(struct rte_pci_driver *pci_drv __rte_unused,
 
 	internal->pdev = pci_dev;
 	rte_spinlock_init(&internal->lock);
-	if (ifcvf_vfio_setup(internal) < 0)
-		return -1;
 
-	if (ifcvf_init_hw(&internal->hw, internal->pdev) < 0)
-		return -1;
+	if (ifcvf_vfio_setup(internal) < 0) {
+		DRV_LOG(ERR, "failed to setup device %s", pci_dev->name);
+		goto error;
+	}
+
+	if (ifcvf_init_hw(&internal->hw, internal->pdev) < 0) {
+		DRV_LOG(ERR, "failed to init device %s", pci_dev->name);
+		goto error;
+	}
 
 	internal->max_queues = IFCVF_MAX_QUEUES;
 	features = ifcvf_get_features(&internal->hw);
@@ -782,8 +787,10 @@  ifcvf_pci_probe(struct rte_pci_driver *pci_drv __rte_unused,
 
 	internal->did = rte_vdpa_register_device(&internal->dev_addr,
 				&ifcvf_ops);
-	if (internal->did < 0)
+	if (internal->did < 0) {
+		DRV_LOG(ERR, "failed to register device %s", pci_dev->name);
 		goto error;
+	}
 
 	rte_atomic32_set(&internal->started, 1);
 	update_datapath(internal);