git.droids-corp.org
/
dpdk.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
net/bnxt: add SRAM manager model
[dpdk.git]
/
drivers
/
bus
/
vmbus
/
vmbus_common.c
diff --git
a/drivers/bus/vmbus/vmbus_common.c
b/drivers/bus/vmbus/vmbus_common.c
index
e3ceb69
..
519ca9c
100644
(file)
--- a/
drivers/bus/vmbus/vmbus_common.c
+++ b/
drivers/bus/vmbus/vmbus_common.c
@@
-15,6
+15,7
@@
#include <rte_eal.h>
#include <rte_tailq.h>
#include <rte_devargs.h>
#include <rte_eal.h>
#include <rte_tailq.h>
#include <rte_devargs.h>
+#include <rte_lcore.h>
#include <rte_malloc.h>
#include <rte_errno.h>
#include <rte_memory.h>
#include <rte_malloc.h>
#include <rte_errno.h>
#include <rte_memory.h>
@@
-22,7
+23,6
@@
#include "private.h"
#include "private.h"
-int vmbus_logtype_bus;
extern struct rte_vmbus_bus rte_vmbus_bus;
/* map a particular resource from a file */
extern struct rte_vmbus_bus rte_vmbus_bus;
/* map a particular resource from a file */
@@
-102,7
+102,7
@@
vmbus_probe_one_driver(struct rte_vmbus_driver *dr,
VMBUS_LOG(INFO, "VMBUS device %s on NUMA socket %i",
guid, dev->device.numa_node);
VMBUS_LOG(INFO, "VMBUS device %s on NUMA socket %i",
guid, dev->device.numa_node);
- /* TODO add bl
acklisted
*/
+ /* TODO add bl
ock/allow logic
*/
/* map resources for device */
ret = rte_vmbus_map_device(dev);
/* map resources for device */
ret = rte_vmbus_map_device(dev);
@@
-111,10
+111,11
@@
vmbus_probe_one_driver(struct rte_vmbus_driver *dr,
/* reference driver structure */
dev->driver = dr;
/* reference driver structure */
dev->driver = dr;
- dev->device.driver = &dr->driver;
if (dev->device.numa_node < 0) {
if (dev->device.numa_node < 0) {
- VMBUS_LOG(WARNING, " Invalid NUMA socket, default to 0");
+ if (rte_socket_count() > 1)
+ VMBUS_LOG(INFO, "Device %s is not NUMA-aware, defaulting socket to 0",
+ guid);
dev->device.numa_node = 0;
}
dev->device.numa_node = 0;
}
@@
-124,13
+125,15
@@
vmbus_probe_one_driver(struct rte_vmbus_driver *dr,
if (ret) {
dev->driver = NULL;
rte_vmbus_unmap_device(dev);
if (ret) {
dev->driver = NULL;
rte_vmbus_unmap_device(dev);
+ } else {
+ dev->device.driver = &dr->driver;
}
return ret;
}
/*
}
return ret;
}
/*
- * I
F device class GUID mathc
es, call the probe function of
+ * I
f device class GUID match
es, call the probe function of
* registere drivers for the vmbus device.
* Return -1 if initialization failed,
* and 1 if no driver found for this device.
* registere drivers for the vmbus device.
* Return -1 if initialization failed,
* and 1 if no driver found for this device.
@@
-142,7
+145,7
@@
vmbus_probe_all_drivers(struct rte_vmbus_device *dev)
int rc;
/* Check if a driver is already loaded */
int rc;
/* Check if a driver is already loaded */
- if (
dev->driver != NULL
) {
+ if (
rte_dev_is_probed(&dev->device)
) {
VMBUS_LOG(DEBUG, "VMBUS driver already loaded");
return 0;
}
VMBUS_LOG(DEBUG, "VMBUS driver already loaded");
return 0;
}
@@
-177,7
+180,7
@@
rte_vmbus_probe(void)
rte_uuid_unparse(dev->device_id, ubuf, sizeof(ubuf));
rte_uuid_unparse(dev->device_id, ubuf, sizeof(ubuf));
- /* TODO: add
whitelist/bla
cklist */
+ /* TODO: add
allowlist/blo
cklist */
if (vmbus_probe_all_drivers(dev) < 0) {
VMBUS_LOG(NOTICE,
if (vmbus_probe_all_drivers(dev) < 0) {
VMBUS_LOG(NOTICE,
@@
-206,7
+209,7
@@
vmbus_parse(const char *name, void *addr)
/*
* scan for matching device args on command line
* example:
/*
* scan for matching device args on command line
* example:
- * -
w
'vmbus:635a7ae3-091e-4410-ad59-667c4f8c04c3,latency=20'
+ * -
a
'vmbus:635a7ae3-091e-4410-ad59-667c4f8c04c3,latency=20'
*/
struct rte_devargs *
vmbus_devargs_lookup(struct rte_vmbus_device *dev)
*/
struct rte_devargs *
vmbus_devargs_lookup(struct rte_vmbus_device *dev)
@@
-297,10
+300,4
@@
struct rte_vmbus_bus rte_vmbus_bus = {
};
RTE_REGISTER_BUS(vmbus, rte_vmbus_bus.bus);
};
RTE_REGISTER_BUS(vmbus, rte_vmbus_bus.bus);
-
-RTE_INIT(vmbus_init_log)
-{
- vmbus_logtype_bus = rte_log_register("bus.vmbus");
- if (vmbus_logtype_bus >= 0)
- rte_log_set_level(vmbus_logtype_bus, RTE_LOG_NOTICE);
-}
+RTE_LOG_REGISTER_DEFAULT(vmbus_logtype_bus, NOTICE);