src/dpdk/drivers/bus/vmbus/vmbus_common.c
static int
vmbus_probe_one_driver(struct rte_vmbus_driver *dr,
		       struct rte_vmbus_device *dev)
{
	char guid[RTE_UUID_STRLEN];
	int ret;

	if (!vmbus_match(dr, dev))
		return 1;	 /* not supported */

	rte_uuid_unparse(dev->device_id, guid, sizeof(guid));
	VMBUS_LOG(INFO, "VMBUS device %s on NUMA socket %i",
		  guid, dev->device.numa_node);

	/* TODO add block/allow logic */

	/* map resources for device */
	ret = rte_vmbus_map_device(dev);
	if (ret != 0)
		return ret;

	/* reference driver structure */
	dev->driver = dr;

	if (dev->device.numa_node < 0) {
		VMBUS_LOG(WARNING, "  Invalid NUMA socket, default to 0");
		dev->device.numa_node = 0;
	}

	/* call the driver probe() function */
	VMBUS_LOG(INFO, "  probe driver: %s", dr->driver.name);
	ret = dr->probe(dr, dev);
	if (ret) {
		dev->driver = NULL;
		rte_vmbus_unmap_device(dev);
	} else {
		dev->device.driver = &dr->driver;
	}

	return ret;
}
/*
 * If device ID match, call the devinit() function of the driver.
 */
If device ID match, call the devinit() function of the driver.
If device ID match call the devinit () function of the driver .
static int
vmbus_probe_one_driver(struct rte_vmbus_driver *dr,
		       struct rte_vmbus_device *dev)
{
	char guid[RTE_UUID_STRLEN];
	int ret;
	if (!vmbus_match(dr, dev))
		return 1;	 
	rte_uuid_unparse(dev->device_id, guid, sizeof(guid));
	VMBUS_LOG(INFO, "VMBUS device %s on NUMA socket %i",
		  guid, dev->device.numa_node);
	ret = rte_vmbus_map_device(dev);
	if (ret != 0)
		return ret;
	dev->driver = dr;
	if (dev->device.numa_node < 0) {
		VMBUS_LOG(WARNING, "  Invalid NUMA socket, default to 0");
		dev->device.numa_node = 0;
	}
	VMBUS_LOG(INFO, "  probe driver: %s", dr->driver.name);
	ret = dr->probe(dr, dev);
	if (ret) {
		dev->driver = NULL;
		rte_vmbus_unmap_device(dev);
	} else {
		dev->device.driver = &dr->driver;
	}
	return ret;
}
static int vmbus_probe_one_driver ( struct rte_vmbus_driver * dr , struct rte_vmbus_device * dev ) { char guid [ RTE_UUID_STRLEN ] ; int ret ; if ( ! vmbus_match ( dr , dev ) ) return 1 ; rte_uuid_unparse ( dev -> device_id , guid , sizeof ( guid ) ) ; VMBUS_LOG ( INFO , " " , guid , dev -> device . numa_node ) ; ret = rte_vmbus_map_device ( dev ) ; if ( ret != 0 ) return ret ; dev -> driver = dr ; if ( dev -> device . numa_node < 0 ) { VMBUS_LOG ( WARNING , " " ) ; dev -> device . numa_node = 0 ; } VMBUS_LOG ( INFO , " " , dr -> driver . name ) ; ret = dr -> probe ( dr , dev ) ; if ( ret ) { dev -> driver = NULL ; rte_vmbus_unmap_device ( dev ) ; } else { dev -> device . driver = & dr -> driver ; } return ret ; }
If device ID match, call the devinit() function of the driver.
If device ID match call the devinit () function of the driver .
/* not supported */ /* TODO add block/allow logic */ /* map resources for device */ /* reference driver structure */ /* call the driver probe() function */