[PATCH v5 05/14] bus/vmbus: handle mapping of device resources
Srikanth Kaka
srikanth.k at oneconvergence.com
Sat Apr 23 06:28:40 CEST 2022
All resource values are published by HV_UIO driver as sysctl key
value pairs and they are read at a later point of the code flow
Signed-off-by: Srikanth Kaka <srikanth.k at oneconvergence.com>
Signed-off-by: Vag Singh <vag.singh at oneconvergence.com>
Signed-off-by: Anand Thulasiram <avelu at juniper.net>
---
drivers/bus/vmbus/freebsd/vmbus_bus.c | 18 ++++++++++++++++++
1 file changed, 18 insertions(+)
diff --git a/drivers/bus/vmbus/freebsd/vmbus_bus.c b/drivers/bus/vmbus/freebsd/vmbus_bus.c
index c1a3a5f..28f5ff4 100644
--- a/drivers/bus/vmbus/freebsd/vmbus_bus.c
+++ b/drivers/bus/vmbus/freebsd/vmbus_bus.c
@@ -28,6 +28,24 @@
return 0;
}
+/* map the resources of a vmbus device in virtual memory */
+int
+rte_vmbus_map_device(struct rte_vmbus_device *dev)
+{
+ if (dev->uio_num < 0) {
+ VMBUS_LOG(DEBUG, "Not managed by UIO driver, skipped");
+ return 1;
+ }
+
+ return vmbus_uio_map_resource(dev);
+}
+
+void
+rte_vmbus_unmap_device(struct rte_vmbus_device *dev)
+{
+ vmbus_uio_unmap_resource(dev);
+}
+
/* Scan one vmbus entry, and fill the devices list from it. */
static int
vmbus_scan_one(const char *name, unsigned int unit_num)
--
1.8.3.1
More information about the dev
mailing list