X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;f=lib%2Flibrte_eal%2Flinuxapp%2Feal%2Feal.c;h=b5e755fc8b5fd9f5b76d9b31be81f03d6a9107ef;hb=e9d48c0072d36eb6423b45fba4ec49d0def6c36f;hp=f1d3a55cf4cc82a7310a495fd24a74fa04074278;hpb=e1e4017751f1a7ed4807269559b8a9bedb9cd73a;p=dpdk.git diff --git a/lib/librte_eal/linuxapp/eal/eal.c b/lib/librte_eal/linuxapp/eal/eal.c index f1d3a55cf4..b5e755fc8b 100644 --- a/lib/librte_eal/linuxapp/eal/eal.c +++ b/lib/librte_eal/linuxapp/eal/eal.c @@ -1,7 +1,7 @@ /*- * BSD LICENSE * - * Copyright(c) 2010-2013 Intel Corporation. All rights reserved. + * Copyright(c) 2010-2014 Intel Corporation. All rights reserved. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -47,6 +47,7 @@ #include #include #include +#include #include #include @@ -97,6 +98,8 @@ #define SOCKET_MEM_STRLEN (RTE_MAX_NUMA_NODES * 10) +#define HIGHEST_RPL 3 + #define BITS_PER_HEX 4 #define GET_BLACKLIST_FIELD(in, fd, lim, dlm) \ @@ -337,7 +340,7 @@ eal_usage(const char *prgname) " --"OPT_HUGE_DIR" : directory where hugetlbfs is mounted\n" " --"OPT_PROC_TYPE" : type of this process\n" " --"OPT_FILE_PREFIX": prefix for hugepage filenames\n" - " --"OPT_USE_DEVICE": use the specified ethernet device(s) only." + " --"OPT_USE_DEVICE": use the specified ethernet device(s) only. " "Use comma-separate <[domain:]bus:devid.func> values.\n" " [NOTE: Cannot be used with -b option]\n" " --"OPT_VMWARE_TSC_MAP": use VMware TSC map instead of " @@ -833,6 +836,15 @@ rte_eal_mcfg_complete(void) rte_config.mem_config->magic = RTE_MAGIC; } +/* + * Request iopl priviledge for all RPL, returns 0 on success + */ +static int +rte_eal_iopl_init(void) +{ + return iopl(HIGHEST_RPL); +} + /* Launch threads, called at application init(). */ int rte_eal_init(int argc, char **argv) @@ -879,6 +891,9 @@ rte_eal_init(int argc, char **argv) rte_srand(rte_rdtsc()); rte_config_init(); + + if (rte_eal_iopl_init() == 0) + rte_config.flags |= EAL_FLG_HIGH_IOPL; if (rte_eal_cpu_init() < 0) rte_panic("Cannot detect lcores\n");