update Intel copyright years to 2014
[dpdk.git] / lib / librte_eal / linuxapp / eal / eal.c
index f1d3a55..b5e755f 100644 (file)
@@ -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 <errno.h>
 #include <sys/mman.h>
 #include <sys/queue.h>
+#include <sys/io.h>
 #include <sys/user.h>
 #include <linux/binfmts.h>
 
@@ -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");