-/*
- * Parse the coremask given as argument (hexadecimal string) and fill
- * the global configuration (core role and core count) with the parsed
- * value.
- */
-static int
-eal_parse_coremask(const char *coremask)
-{
- struct rte_config *cfg = rte_eal_get_configuration();
- unsigned i;
- char *end = NULL;
- unsigned long long cm;
- unsigned count = 0;
-
- /* parse hexadecimal string */
- cm = strtoull(coremask, &end, 16);
- if ((coremask[0] == '\0') || (end == NULL) || (*end != '\0') || (cm == 0))
- return -1;
-
- RTE_LOG(DEBUG, EAL, "coremask set to %llx\n", cm);
- /* set core role and core count */
- for (i = 0; i < RTE_MAX_LCORE; i++) {
- if ((1ULL << i) & cm) {
- if (count == 0)
- cfg->master_lcore = i;
- cfg->lcore_role[i] = ROLE_RTE;
- count++;
- }
- else {
- cfg->lcore_role[i] = ROLE_OFF;
- }
- }
- return 0;
-}
-
-static int
-eal_parse_syslog(const char *facility)
-{
- int i;
- static struct {
- const char *name;
- int value;
- } map[] = {
- { "auth", LOG_AUTH },
- { "cron", LOG_CRON },
- { "daemon", LOG_DAEMON },
- { "ftp", LOG_FTP },
- { "kern", LOG_KERN },
- { "lpr", LOG_LPR },
- { "mail", LOG_MAIL },
- { "news", LOG_NEWS },
- { "syslog", LOG_SYSLOG },
- { "user", LOG_USER },
- { "uucp", LOG_UUCP },
- { "local0", LOG_LOCAL0 },
- { "local1", LOG_LOCAL1 },
- { "local2", LOG_LOCAL2 },
- { "local3", LOG_LOCAL3 },
- { "local4", LOG_LOCAL4 },
- { "local5", LOG_LOCAL5 },
- { "local6", LOG_LOCAL6 },
- { "local7", LOG_LOCAL7 },
- { NULL, 0 }
- };
-
- for (i = 0; map[i].name; i++) {
- if (!strcmp(facility, map[i].name)) {
- internal_config.syslog_facility = map[i].value;
- return 0;
- }
- }
- return -1;
-}
-