[PATCH v3 02/15] bus/vmbus: handle mapping of device resources
Srikanth Kaka
srikanth.k at oneconvergence.com
Thu Feb 17 17:06:00 CET 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 c8583aba37..fa0f4883f7 100644
--- a/drivers/bus/vmbus/freebsd/vmbus_bus.c
+++ b/drivers/bus/vmbus/freebsd/vmbus_bus.c
@@ -41,6 +41,24 @@ parse_sysfs_uuid(const char *filename, rte_uuid_t uu)
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)
--
2.30.2
More information about the dev
mailing list