#include <rte_memory.h>
#include <rte_memzone.h>
#include <rte_launch.h>
-#include <rte_tailq.h>
#include <rte_eal.h>
#include <rte_eal_memconfig.h>
#include <rte_per_lcore.h>
printf("\nUsage: %s ", prgname);
eal_common_usage();
printf("EAL Linux options:\n"
- " -d LIB.so : add driver (can be used multiple times)\n"
- " --"OPT_XEN_DOM0" : support application running on Xen Domain0 "
- "without hugetlbfs\n"
- " --"OPT_SOCKET_MEM" : memory to allocate on specific\n"
- " sockets (use comma separated values)\n"
- " --"OPT_HUGE_DIR" : directory where hugetlbfs is mounted\n"
- " --"OPT_FILE_PREFIX": prefix for hugepage filenames\n"
- " --"OPT_BASE_VIRTADDR": specify base virtual address\n"
- " --"OPT_VFIO_INTR": specify desired interrupt mode for VFIO "
- "(legacy|msi|msix)\n"
- " --"OPT_CREATE_UIO_DEV": create /dev/uioX (usually done by hotplug)\n"
+ " -d LIB.so Add driver (can be used multiple times)\n"
+ " --"OPT_SOCKET_MEM" Memory to allocate on sockets (comma separated values)\n"
+ " --"OPT_HUGE_DIR" Directory where hugetlbfs is mounted\n"
+ " --"OPT_FILE_PREFIX" Prefix for hugepage filenames\n"
+ " --"OPT_BASE_VIRTADDR" Base virtual address\n"
+ " --"OPT_CREATE_UIO_DEV" Create /dev/uioX (usually done by hotplug)\n"
+ " --"OPT_VFIO_INTR" Interrupt mode for VFIO (legacy|msi|msix)\n"
+ " --"OPT_XEN_DOM0" Support running on Xen dom0 without hugetlbfs\n"
"\n");
/* Allow the application to print its usage message too if hook is set */
if ( rte_application_usage_hook ) {
int ret;
/* getopt is not happy, stop right now */
- if (opt == '?')
+ if (opt == '?') {
+ eal_usage(prgname);
return -1;
+ }
ret = eal_parse_common_option(opt, optarg, &internal_config);
/* common parser is not happy */
continue;
switch (opt) {
+ case 'h':
+ eal_usage(prgname);
+ exit(EXIT_SUCCESS);
+
/* force loading of external driver */
case 'd':
solib = malloc(sizeof(*solib));
static rte_atomic32_t run_once = RTE_ATOMIC32_INIT(0);
struct shared_driver *solib = NULL;
const char *logid;
+ char cpuset[RTE_CPU_AFFINITY_STR_LEN];
if (!rte_atomic32_test_and_set(&run_once))
return -1;
eal_thread_init_master(rte_config.master_lcore);
- RTE_LOG(DEBUG, EAL, "Master core %u is ready (tid=%x)\n",
- rte_config.master_lcore, (int)thread_id);
+ ret = eal_thread_dump_affinity(cpuset, RTE_CPU_AFFINITY_STR_LEN);
+
+ RTE_LOG(DEBUG, EAL, "Master lcore %u is ready (tid=%x;cpuset=[%s%s])\n",
+ rte_config.master_lcore, (int)thread_id, cpuset,
+ ret == 0 ? "" : "...");
if (rte_eal_dev_init() < 0)
rte_panic("Cannot init pmd devices\n");
{
return ! internal_config.no_hugetlbfs;
}
+
+int
+rte_eal_check_module(const char *module_name)
+{
+ char mod_name[30]; /* Any module names can be longer than 30 bytes? */
+ int ret = 0;
+ int n;
+
+ if (NULL == module_name)
+ return -1;
+
+ FILE *fd = fopen("/proc/modules", "r");
+ if (NULL == fd) {
+ RTE_LOG(ERR, EAL, "Open /proc/modules failed!"
+ " error %i (%s)\n", errno, strerror(errno));
+ return -1;
+ }
+ while (!feof(fd)) {
+ n = fscanf(fd, "%29s %*[^\n]", mod_name);
+ if ((n == 1) && !strcmp(mod_name, module_name)) {
+ ret = 1;
+ break;
+ }
+ }
+ fclose(fd);
+
+ return ret;
+}