Skip to contentSkip to conversation

net/ifc: invoke ifcvf HW init function in probe

PATCH Applied Xiaolong Ye 3 participants 3 messages Oct 10, 2018 – Oct 11, 2018 Network drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 net/ifc: invoke ifcvf HW init function in probe

As ifcvf_init_hw is independent with ifcvf_vfio_setup, it's better to invoke it directly in probe func.

---
 drivers/net/ifc/ifcvf_vdpa.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)
drivers/net/ifc/ifcvf_vdpa.c +4 -3
index 9d5594678..adc8f4166 100644
@@ -112,7 +112,6 @@ ifcvf_vfio_setup(struct ifcvf_internal *internal)
 	struct rte_pci_device *dev = internal->pdev;
 	char devname[RTE_DEV_NAME_MAX_LEN] = {0};
 	int iommu_group_num;
-	int ret = 0;
 	int i;
 
 	internal->vfio_dev_fd = -1;
@@ -146,9 +145,8 @@ ifcvf_vfio_setup(struct ifcvf_internal *internal)
 		internal->hw.mem_resource[i].len =
 			internal->pdev->mem_resource[i].len;
 	}
-	ret = ifcvf_init_hw(&internal->hw, internal->pdev);
 
-	return ret;
+	return 0;
 
 err:
 	rte_vfio_container_destroy(internal->vfio_container_fd);
@@ -758,6 +756,9 @@ ifcvf_pci_probe(struct rte_pci_driver *pci_drv __rte_unused,
 	if (ifcvf_vfio_setup(internal) < 0)
 		return -1;
 
+	if (ifcvf_init_hw(&internal->hw, internal->pdev) < 0)
+		return -1;
+
 	internal->max_queues = IFCVF_MAX_QUEUES;
 	features = ifcvf_get_features(&internal->hw);
 	internal->features = (features &
Signature · 1 line
2.17.1
Acked-by on v1 1/1
#1 lore raw

Hi,

Quoted 49 lines

-----Original Message-----
From: Ye, Xiaolong
Sent: Wednesday, October 10, 2018 9:23 PM
To: [email protected]; Zhang, Qi Z <[email protected]>
Cc: Wang, Xiao W <[email protected]>; Ye, Xiaolong <[email protected]>
Subject: [PATCH] net/ifc: invoke ifcvf HW init function in probe

As ifcvf_init_hw is independent with ifcvf_vfio_setup, it's better to invoke it directly in probe func.

---
 drivers/net/ifc/ifcvf_vdpa.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)
drivers/net/ifc/ifcvf_vdpa.c +4 -3
index 9d5594678..adc8f4166 100644
@@ -112,7 +112,6 @@ ifcvf_vfio_setup(struct ifcvf_internal *internal)
 	struct rte_pci_device *dev = internal->pdev;
 	char devname[RTE_DEV_NAME_MAX_LEN] = {0};
 	int iommu_group_num;
-	int ret = 0;
 	int i;
 
 	internal->vfio_dev_fd = -1;
@@ -146,9 +145,8 @@ ifcvf_vfio_setup(struct ifcvf_internal *internal)
 		internal->hw.mem_resource[i].len =
 			internal->pdev->mem_resource[i].len;
 	}
-	ret = ifcvf_init_hw(&internal->hw, internal->pdev);
 
-	return ret;
+	return 0;
 
 err:
 	rte_vfio_container_destroy(internal->vfio_container_fd);
@@ -758,6 +756,9 @@ ifcvf_pci_probe(struct rte_pci_driver *pci_drv
 __rte_unused,
 	if (ifcvf_vfio_setup(internal) < 0)
 		return -1;
 
+	if (ifcvf_init_hw(&internal->hw, internal->pdev) < 0)
+		return -1;
+
 	internal->max_queues = IFCVF_MAX_QUEUES;
 	features = ifcvf_get_features(&internal->hw);
Quoted 3 lines

internal->features = (features &
--
2.17.1

BRs,
Xiao

Applied
#2 lore raw
Quoted 55 lines

-----Original Message-----
From: Wang, Xiao W
Sent: Wednesday, October 10, 2018 9:40 PM
To: Ye, Xiaolong <[email protected]>; [email protected]; Zhang, Qi Z <[email protected]>
Subject: RE: [PATCH] net/ifc: invoke ifcvf HW init function in probe

Hi,

Quoted 44 lines

-----Original Message-----
From: Ye, Xiaolong
Sent: Wednesday, October 10, 2018 9:23 PM
To: [email protected]; Zhang, Qi Z <[email protected]>
Cc: Wang, Xiao W <[email protected]>; Ye, Xiaolong <[email protected]>
Subject: [PATCH] net/ifc: invoke ifcvf HW init function in probe

As ifcvf_init_hw is independent with ifcvf_vfio_setup, it's better to invoke it directly in probe func.

---
 drivers/net/ifc/ifcvf_vdpa.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)
(quoted diff) +0 -0

b/drivers/net/ifc/ifcvf_vdpa.c index 9d5594678..adc8f4166 100644

drivers/net/ifc/ifcvf_vdpa.c +1 -3
@@ -112,7 +112,6 @@ ifcvf_vfio_setup(struct ifcvf_internal *internal)
 	struct rte_pci_device *dev = internal->pdev;
 	char devname[RTE_DEV_NAME_MAX_LEN] = {0};
 	int iommu_group_num;
-	int ret = 0;
 	int i;
 
 	internal->vfio_dev_fd = -1;
@@ -146,9 +145,8 @@ ifcvf_vfio_setup(struct ifcvf_internal *internal)
 		internal->hw.mem_resource[i].len =
 			internal->pdev->mem_resource[i].len;
 	}
-	ret = ifcvf_init_hw(&internal->hw, internal->pdev);
 
-	return ret;
+	return 0;
 
 err:
 	rte_vfio_container_destroy(internal->vfio_container_fd);
@@ -758,6 +756,9 @@ ifcvf_pci_probe(struct rte_pci_driver *pci_drv
 __rte_unused,
 	if (ifcvf_vfio_setup(internal) < 0)
 		return -1;
 
Quoted 10 lines
Quoted 8 lines
drivers/net/ifc/ifcvf_vdpa.c +3 -0
+	if (ifcvf_init_hw(&internal->hw, internal->pdev) < 0)
+		return -1;
+
 	internal->max_queues = IFCVF_MAX_QUEUES;
 	features = ifcvf_get_features(&internal->hw);

internal->features = (features &
--
2.17.1

Applied to dpdk-next-net-intel.

Thanks
Qi

Quoted 3 lines

BRs,
Xiao