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
eal/ppc: fix mmap for memory initialization
[dpdk.git]
/
lib
/
librte_eal
/
linuxapp
/
eal
/
eal.c
diff --git
a/lib/librte_eal/linuxapp/eal/eal.c
b/lib/librte_eal/linuxapp/eal/eal.c
index
564cac3
..
7c78f2d
100644
(file)
--- a/
lib/librte_eal/linuxapp/eal/eal.c
+++ b/
lib/librte_eal/linuxapp/eal/eal.c
@@
-212,7
+212,7
@@
rte_eal_config_create(void)
rte_panic("Cannot mmap memory for rte_config\n");
}
memcpy(rte_mem_cfg_addr, &early_mem_config, sizeof(early_mem_config));
rte_panic("Cannot mmap memory for rte_config\n");
}
memcpy(rte_mem_cfg_addr, &early_mem_config, sizeof(early_mem_config));
- rte_config.mem_config =
(struct rte_mem_config *)
rte_mem_cfg_addr;
+ rte_config.mem_config = rte_mem_cfg_addr;
/* store address of the config in the config itself so that secondary
* processes could later map the config into this exact location */
/* store address of the config in the config itself so that secondary
* processes could later map the config into this exact location */
@@
-492,8
+492,6
@@
eal_log_level_parse(int argc, char **argv)
argvopt = argv;
optind = 1;
argvopt = argv;
optind = 1;
- eal_reset_internal_config(&internal_config);
-
while ((opt = getopt_long(argc, argvopt, eal_short_options,
eal_long_options, &option_index)) != EOF) {
while ((opt = getopt_long(argc, argvopt, eal_short_options,
eal_long_options, &option_index)) != EOF) {
@@
-776,10
+774,10
@@
rte_eal_init(int argc, char **argv)
thread_id = pthread_self();
thread_id = pthread_self();
- eal_
log_level_parse(argc, argv
);
+ eal_
reset_internal_config(&internal_config
);
/* set log level as early as possible */
/* set log level as early as possible */
-
rte_set_log_level(internal_config.log_level
);
+
eal_log_level_parse(argc, argv
);
if (rte_eal_cpu_init() < 0) {
rte_eal_init_alert("Cannot detect lcores.");
if (rte_eal_cpu_init() < 0) {
rte_eal_init_alert("Cannot detect lcores.");
@@
-825,19
+823,27
@@
rte_eal_init(int argc, char **argv)
rte_config_init();
rte_config_init();
- if (rte_eal_log_init(logid, internal_config.syslog_facility) < 0)
- rte_panic("Cannot init logs\n");
-
- if (rte_eal_pci_init() < 0)
- rte_panic("Cannot init PCI\n");
+ if (rte_eal_log_init(logid, internal_config.syslog_facility) < 0) {
+ rte_eal_init_alert("Cannot init logging.");
+ rte_errno = ENOMEM;
+ rte_atomic32_clear(&run_once);
+ return -1;
+ }
#ifdef VFIO_PRESENT
#ifdef VFIO_PRESENT
- if (rte_eal_vfio_setup() < 0)
- rte_panic("Cannot init VFIO\n");
+ if (rte_eal_vfio_setup() < 0) {
+ rte_eal_init_alert("Cannot init VFIO\n");
+ rte_errno = EAGAIN;
+ rte_atomic32_clear(&run_once);
+ return -1;
+ }
#endif
#endif
- if (rte_eal_memory_init() < 0)
- rte_panic("Cannot init memory\n");
+ if (rte_eal_memory_init() < 0) {
+ rte_eal_init_alert("Cannot init memory\n");
+ rte_errno = ENOMEM;
+ return -1;
+ }
/* the directories are locked during eal_hugepage_info_init */
eal_hugedirs_unlock();
/* the directories are locked during eal_hugepage_info_init */
eal_hugedirs_unlock();
@@
-848,19
+854,28
@@
rte_eal_init(int argc, char **argv)
return -1;
}
return -1;
}
- if (rte_eal_tailqs_init() < 0)
- rte_panic("Cannot init tail queues for objects\n");
+ if (rte_eal_tailqs_init() < 0) {
+ rte_eal_init_alert("Cannot init tail queues for objects\n");
+ rte_errno = EFAULT;
+ return -1;
+ }
- if (rte_eal_alarm_init() < 0)
- rte_panic("Cannot init interrupt-handling thread\n");
+ if (rte_eal_alarm_init() < 0) {
+ rte_eal_init_alert("Cannot init interrupt-handling thread\n");
+ /* rte_eal_alarm_init sets rte_errno on failure. */
+ return -1;
+ }
- if (rte_eal_timer_init() < 0)
- rte_panic("Cannot init HPET or TSC timers\n");
+ if (rte_eal_timer_init() < 0) {
+ rte_eal_init_alert("Cannot init HPET or TSC timers\n");
+ rte_errno = ENOTSUP;
+ return -1;
+ }
eal_check_mem_on_local_socket();
if (eal_plugins_init() < 0)
eal_check_mem_on_local_socket();
if (eal_plugins_init() < 0)
- rte_
panic
("Cannot init plugins\n");
+ rte_
eal_init_alert
("Cannot init plugins\n");
eal_thread_init_master(rte_config.master_lcore);
eal_thread_init_master(rte_config.master_lcore);
@@
-870,11
+885,16
@@
rte_eal_init(int argc, char **argv)
rte_config.master_lcore, (int)thread_id, cpuset,
ret == 0 ? "" : "...");
rte_config.master_lcore, (int)thread_id, cpuset,
ret == 0 ? "" : "...");
- if (rte_eal_intr_init() < 0)
- rte_panic("Cannot init interrupt-handling thread\n");
+ if (rte_eal_intr_init() < 0) {
+ rte_eal_init_alert("Cannot init interrupt-handling thread\n");
+ return -1;
+ }
- if (rte_bus_scan())
- rte_panic("Cannot scan the buses for devices\n");
+ if (rte_bus_scan()) {
+ rte_eal_init_alert("Cannot scan the buses for devices\n");
+ rte_errno = ENODEV;
+ return -1;
+ }
RTE_LCORE_FOREACH_SLAVE(i) {
RTE_LCORE_FOREACH_SLAVE(i) {
@@
-913,15
+933,11
@@
rte_eal_init(int argc, char **argv)
rte_eal_mp_wait_lcore();
/* Probe all the buses and devices/drivers on them */
rte_eal_mp_wait_lcore();
/* Probe all the buses and devices/drivers on them */
- if (rte_bus_probe())
- rte_panic("Cannot probe devices\n");
-
- /* Probe & Initialize PCI devices */
- if (rte_eal_pci_probe())
- rte_panic("Cannot probe PCI\n");
-
- if (rte_eal_dev_init() < 0)
- rte_panic("Cannot init pmd devices\n");
+ if (rte_bus_probe()) {
+ rte_eal_init_alert("Cannot probe devices\n");
+ rte_errno = ENOTSUP;
+ return -1;
+ }
rte_eal_mcfg_complete();
rte_eal_mcfg_complete();