diff --git a/drivers/bus/vmbus/linux/vmbus_bus.c b/drivers/bus/vmbus/linux/vmbus_bus.c index 52d6a3c053..527a6a39f2 100644 --- a/drivers/bus/vmbus/linux/vmbus_bus.c +++ b/drivers/bus/vmbus/linux/vmbus_bus.c @@ -276,6 +276,8 @@ vmbus_scan_one(const char *name) dev->device.numa_node = SOCKET_ID_ANY; } + dev->device.devargs = vmbus_devargs_lookup(dev); + /* device is valid, add in list (sorted) */ VMBUS_LOG(DEBUG, "Adding vmbus device %s", name); diff --git a/drivers/bus/vmbus/private.h b/drivers/bus/vmbus/private.h index 9964fc42a7..f2022a68cb 100644 --- a/drivers/bus/vmbus/private.h +++ b/drivers/bus/vmbus/private.h @@ -66,6 +66,9 @@ struct vmbus_channel { #define VMBUS_MAX_CHANNELS 64 +struct rte_devargs * +vmbus_devargs_lookup(struct rte_vmbus_device *dev); + int vmbus_chan_create(const struct rte_vmbus_device *device, uint16_t relid, uint16_t subid, uint8_t monitor_id, struct vmbus_channel **new_chan); diff --git a/drivers/bus/vmbus/vmbus_common.c b/drivers/bus/vmbus/vmbus_common.c index c7165ad54f..e3ceb6906a 100644 --- a/drivers/bus/vmbus/vmbus_common.c +++ b/drivers/bus/vmbus/vmbus_common.c @@ -85,7 +85,6 @@ vmbus_match(const struct rte_vmbus_driver *dr, return false; } - /* * If device ID match, call the devinit() function of the driver. */ @@ -204,6 +203,27 @@ vmbus_parse(const char *name, void *addr) return ret; } +/* + * scan for matching device args on command line + * example: + * -w 'vmbus:635a7ae3-091e-4410-ad59-667c4f8c04c3,latency=20' + */ +struct rte_devargs * +vmbus_devargs_lookup(struct rte_vmbus_device *dev) +{ + struct rte_devargs *devargs; + rte_uuid_t addr; + + RTE_EAL_DEVARGS_FOREACH("vmbus", devargs) { + vmbus_parse(devargs->name, &addr); + + if (rte_uuid_compare(dev->device_id, addr) == 0) + return devargs; + } + return NULL; + +} + /* register vmbus driver */ void rte_vmbus_register(struct rte_vmbus_driver *driver)