- Updated documentation for the update made in the last commit.
parent
259bab9fbd
commit
392291d071
|
@ -1,5 +1,12 @@
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
export MTCP_TARGET=`echo $PWD`/mtcp
|
||||||
autoreconf -ivf
|
autoreconf -ivf
|
||||||
./configure --enable-netmap
|
./configure --enable-netmap
|
||||||
make
|
make
|
||||||
|
cd apps/lighttpd-1.4.32/
|
||||||
|
autoreconf -ivf
|
||||||
|
./configure --without-bzip2 CFLAGS="-g -O3" --with-libmtcp=$MTCP_TARGET --enable-netmap
|
||||||
|
make
|
||||||
|
cd ../apache_benchmark
|
||||||
|
./configure --with-libmtcp=$MTCP_TARGET --enable-netmap
|
||||||
|
make
|
||||||
|
|
|
@ -1,5 +1,13 @@
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
export PSIO_TARGET=`echo $PWD`/io_engine
|
||||||
|
export MTCP_TARGET=`echo $PWD`/mtcp
|
||||||
autoreconf -ivf
|
autoreconf -ivf
|
||||||
./configure --with-psio-lib=`echo $PWD`/io_engine
|
./configure --with-psio-lib=`echo $PWD`/io_engine
|
||||||
make
|
make
|
||||||
|
cd apps/lighttpd-1.4.32/
|
||||||
|
autoreconf -ivf
|
||||||
|
./configure --without-bzip2 CFLAGS="-g -O3" --with-libmtcp=$MTCP_TARGET --with-libpsio=$PSIO_TARGET
|
||||||
|
make
|
||||||
|
cd ../apache_benchmark
|
||||||
|
./configure --with-libmtcp=$MTCP_TARGET --with-libpsio=$PSIO_TARGET
|
||||||
|
make
|
||||||
|
|
33
README
33
README
|
@ -127,7 +127,7 @@ mTCP can be prepared in three ways.
|
||||||
on this page: http://dpdk.org/doc/nics. Please make sure that your
|
on this page: http://dpdk.org/doc/nics. Please make sure that your
|
||||||
NIC is compatible before moving on to the next step.
|
NIC is compatible before moving on to the next step.
|
||||||
|
|
||||||
- recent Systemd tend to rename Ethernet interfaces based on
|
- Systemd tends to rename Ethernet interfaces based on
|
||||||
their PCI addresses. If you are using Intel based Ethernet adapters,
|
their PCI addresses. If you are using Intel based Ethernet adapters,
|
||||||
please rename the interface with a ``dpdk`` prefix. You can do so
|
please rename the interface with a ``dpdk`` prefix. You can do so
|
||||||
using the following command:
|
using the following command:
|
||||||
|
@ -145,20 +145,17 @@ mTCP can be prepared in three ways.
|
||||||
|
|
||||||
This sets the IP address of your interfaces as 10.0.x.4.
|
This sets the IP address of your interfaces as 10.0.x.4.
|
||||||
|
|
||||||
3. Create soft links for include/ and lib/ directories inside
|
3. Set RTE_SDK and RTE_TARGET environment variables
|
||||||
empty dpdk/ directory:
|
|
||||||
# cd dpdk/
|
# export RTE_SDK=`echo $PWD`/dpdk-17.08/
|
||||||
# ln -s <path_to_dpdk_17_08_directory>/x86_64-native-linuxapp-gcc/lib lib
|
# export RTE_TARGET=x86_64-native-linuxapp-gcc
|
||||||
# ln -s <path_to_dpdk_17_08_directory>/x86_64-native-linuxapp-gcc/include include
|
|
||||||
|
|
||||||
4. Setup mtcp library:
|
4. Setup mtcp library:
|
||||||
# ./configure --with-dpdk-lib=$<path_to_mtcp_release_v3>/dpdk
|
# ./configure --with-dpdk-lib=$RTE_SDK/$RTE_TARGET
|
||||||
## And not dpdk-17.08!
|
|
||||||
## e.g. ./configure --with-dpdk-lib=`echo $PWD`/dpdk
|
|
||||||
# make
|
# make
|
||||||
- By default, mTCP assumes that there are 16 CPUs in your system.
|
- By default, mTCP assumes that there are 16 CPUs in your system.
|
||||||
You can set the CPU limit, e.g. on a 32-core system, by using the following command:
|
You can set the CPU limit, e.g. on a 32-core system, by using the following command:
|
||||||
# ./configure --with-dpdk-lib=$<path_to_mtcp_release_v3>/dpdk CFLAGS="-DMAX_CPUS=32"
|
# ./configure --with-dpdk-lib=$RTE_SDK/$RTE_TARGET CFLAGS="-DMAX_CPUS=32"
|
||||||
Please note that your NIC should support RSS queues equal to the MAX_CPUS value
|
Please note that your NIC should support RSS queues equal to the MAX_CPUS value
|
||||||
(since mTCP expects a one-to-one RSS queue to CPU binding).
|
(since mTCP expects a one-to-one RSS queue to CPU binding).
|
||||||
- In case `./configure' script prints an error, run the
|
- In case `./configure' script prints an error, run the
|
||||||
|
@ -167,7 +164,7 @@ mTCP can be prepared in three ways.
|
||||||
- checksum offloading in the NIC is now ENABLED (by default)!!!
|
- checksum offloading in the NIC is now ENABLED (by default)!!!
|
||||||
- this only works for dpdk at the moment
|
- this only works for dpdk at the moment
|
||||||
- use
|
- use
|
||||||
./configure --with-dpdk-lib=`echo $PWD`/dpdk --disable-hwcsum
|
./configure --with-dpdk-lib=$RTE_SDK/$RTE_TARGET --disable-hwcsum
|
||||||
to disable checksum offloading.
|
to disable checksum offloading.
|
||||||
- check libmtcp.a in mtcp/lib
|
- check libmtcp.a in mtcp/lib
|
||||||
- check header files in mtcp/include
|
- check header files in mtcp/include
|
||||||
|
@ -198,20 +195,14 @@ Also, no core overlap between applications and onvm_mgr is allowed.
|
||||||
2. Next bring the dpdk-registered interfaces up. This can be setup using:
|
2. Next bring the dpdk-registered interfaces up. This can be setup using:
|
||||||
# sudo $RTE_SDK/tools/dpdk-setup-iface.sh
|
# sudo $RTE_SDK/tools/dpdk-setup-iface.sh
|
||||||
|
|
||||||
3. Create soft links for include/ and lib/ directories inside
|
3. Setup mtcp library
|
||||||
empty dpdk/ directory:
|
|
||||||
# cd dpdk/
|
|
||||||
# ln -s $RTE_SDK/$RTE_TARGET/lib lib
|
|
||||||
# ln -s $RTE_SDK/$RTE_TARGET/include include
|
|
||||||
|
|
||||||
4. Setup mtcp library
|
|
||||||
# ./configure --with-dpdk-lib=$<path_to_dpdk> --with-onvm-lib=$<path_to_onvm_lib>
|
# ./configure --with-dpdk-lib=$<path_to_dpdk> --with-onvm-lib=$<path_to_onvm_lib>
|
||||||
# e.g. ./configure --with-dpdk-lib=`echo $PWD`/dpdk --with-onvm-lib=`echo $ONVM_HOME`/onvm
|
# e.g. ./configure --with-dpdk-lib=$RTE_SDK/$RTE_TARGET --with-onvm-lib=`echo $ONVM_HOME`/onvm
|
||||||
# make
|
# make
|
||||||
|
|
||||||
- By default, mTCP assumes that there are 16 CPUs in your system.
|
- By default, mTCP assumes that there are 16 CPUs in your system.
|
||||||
You can set the CPU limit, e.g. on a 32-core system, by using the following command:
|
You can set the CPU limit, e.g. on a 32-core system, by using the following command:
|
||||||
# ./configure --with-dpdk-lib=$<path_to_mtcp_release_v3>/dpdk --with-onvm-lib=$<path_to_onvm_lib> CFLAGS="-DMAX_CPUS=32"
|
# ./configure --with-dpdk-lib=$RTE_SDK/$RTE_TARGET --with-onvm-lib=$<path_to_onvm_lib> CFLAGS="-DMAX_CPUS=32"
|
||||||
Please note that your NIC should support RSS queues equal to the MAX_CPUS value
|
Please note that your NIC should support RSS queues equal to the MAX_CPUS value
|
||||||
(since mTCP expects a one-to-one RSS queue to CPU binding).
|
(since mTCP expects a one-to-one RSS queue to CPU binding).
|
||||||
|
|
||||||
|
@ -221,7 +212,7 @@ Also, no core overlap between applications and onvm_mgr is allowed.
|
||||||
- checksum offloading in the NIC is now ENABLED (by default)!!!
|
- checksum offloading in the NIC is now ENABLED (by default)!!!
|
||||||
- this only works for dpdk at the moment
|
- this only works for dpdk at the moment
|
||||||
- use
|
- use
|
||||||
./configure --with-dpdk-lib=`echo $PWD`/dpdk --disable-hwcsum
|
./configure --with-dpdk-lib=$RTE_SDK/$RTE_TARGET --disable-hwcsum
|
||||||
to disable checksum offloading.
|
to disable checksum offloading.
|
||||||
- check libmtcp.a in mtcp/lib
|
- check libmtcp.a in mtcp/lib
|
||||||
- check header files in mtcp/include
|
- check header files in mtcp/include
|
||||||
|
|
36
README.md
36
README.md
|
@ -133,7 +133,7 @@ mTCP can be prepared in three ways.
|
||||||
on this page: http://dpdk.org/doc/nics. Please make sure that your
|
on this page: http://dpdk.org/doc/nics. Please make sure that your
|
||||||
NIC is compatible before moving on to the next step.
|
NIC is compatible before moving on to the next step.
|
||||||
|
|
||||||
- recent Linux kernels tend to rename Ethernet interfaces based on
|
- Systemd tends to rename Ethernet interfaces based on
|
||||||
their PCI addresses. If you are using Intel based Ethernet adapters,
|
their PCI addresses. If you are using Intel based Ethernet adapters,
|
||||||
please rename the interface with a ``dpdk`` prefix. You can do so
|
please rename the interface with a ``dpdk`` prefix. You can do so
|
||||||
using the following command:
|
using the following command:
|
||||||
|
@ -154,25 +154,23 @@ mTCP can be prepared in three ways.
|
||||||
|
|
||||||
This sets the IP address of your interfaces as 10.0.x.4.
|
This sets the IP address of your interfaces as 10.0.x.4.
|
||||||
|
|
||||||
3. Create soft links for ``include/`` and ``lib/`` directories inside
|
3. Set RTE_SDK and RTE_TARGET environment variables
|
||||||
empty ``dpdk/`` directory:
|
|
||||||
```bash
|
```bash
|
||||||
# cd dpdk/
|
# export RTE_SDK=`echo $PWD`/dpdk-17.08/
|
||||||
# ln -s <path_to_dpdk_17_08_directory>/x86_64-native-linuxapp-gcc/lib lib
|
# export RTE_TARGET=x86_64-native-linuxapp-gcc
|
||||||
# ln -s <path_to_dpdk_17_08_directory>/x86_64-native-linuxapp-gcc/include include
|
|
||||||
```
|
```
|
||||||
|
|
||||||
4. Setup mtcp library:
|
4. Setup mtcp library:
|
||||||
```bash
|
```bash
|
||||||
# ./configure --with-dpdk-lib=$<path_to_mtcp_release_v3>/dpdk
|
# ./configure --with-dpdk-lib=$RTE_SDK/$RTE_TARGET
|
||||||
## And not dpdk-17.08!
|
|
||||||
## e.g. ./configure --with-dpdk-lib=`echo $PWD`/dpdk
|
|
||||||
# make
|
# make
|
||||||
```
|
```
|
||||||
|
|
||||||
- By default, mTCP assumes that there are 16 CPUs in your system.
|
- By default, mTCP assumes that there are 16 CPUs in your system.
|
||||||
You can set the CPU limit, e.g. on a 32-core system, by using the following command:
|
You can set the CPU limit, e.g. on a 32-core system, by using the following command:
|
||||||
```bash
|
```bash
|
||||||
# ./configure --with-dpdk-lib=$<path_to_mtcp_release_v3>/dpdk CFLAGS="-DMAX_CPUS=32"
|
# ./configure --with-dpdk-lib=$RTE_SDK/$RTE_TARGET CFLAGS="-DMAX_CPUS=32"
|
||||||
```
|
```
|
||||||
Please note that your NIC should support RSS queues equal to the MAX_CPUS value
|
Please note that your NIC should support RSS queues equal to the MAX_CPUS value
|
||||||
(since mTCP expects a one-to-one RSS queue to CPU binding).
|
(since mTCP expects a one-to-one RSS queue to CPU binding).
|
||||||
|
@ -183,7 +181,7 @@ mTCP can be prepared in three ways.
|
||||||
```# autoreconf -ivf```
|
```# autoreconf -ivf```
|
||||||
- checksum offloading in the NIC is now ENABLED (by default)!!!
|
- checksum offloading in the NIC is now ENABLED (by default)!!!
|
||||||
- this only works for dpdk at the moment
|
- this only works for dpdk at the moment
|
||||||
- use ```./configure --with-dpdk-lib=`echo $PWD`/dpdk --disable-hwcsum``` to disable checksum offloading.
|
- use ```./configure --with-dpdk-lib=$RTE_SDK/$RTE_TARGET --disable-hwcsum``` to disable checksum offloading.
|
||||||
- check libmtcp.a in mtcp/lib
|
- check libmtcp.a in mtcp/lib
|
||||||
- check header files in mtcp/include
|
- check header files in mtcp/include
|
||||||
- check example binary files in apps/example
|
- check example binary files in apps/example
|
||||||
|
@ -212,25 +210,17 @@ ONVM basics are explained in https://github.com/sdnfv/openNetVM.
|
||||||
|
|
||||||
```# sudo $RTE_SDK/tools/dpdk-setup-iface.sh```
|
```# sudo $RTE_SDK/tools/dpdk-setup-iface.sh```
|
||||||
|
|
||||||
3. Create soft links for ``include/`` and ``lib/`` directories inside
|
3. Setup mtcp library
|
||||||
empty ``dpdk/`` directory:
|
|
||||||
```bash
|
|
||||||
# cd dpdk/
|
|
||||||
# ln -s $RTE_SDK/$RTE_TARGET/lib lib
|
|
||||||
# ln -s $RTE_SDK/$RTE_TARGET/include include
|
|
||||||
```
|
|
||||||
|
|
||||||
4. Setup mtcp library
|
|
||||||
```bash
|
```bash
|
||||||
# ./configure --with-dpdk-lib=$<path_to_dpdk> --with-onvm-lib=$<path_to_onvm_lib>
|
# ./configure --with-dpdk-lib=$<path_to_dpdk> --with-onvm-lib=$<path_to_onvm_lib>
|
||||||
# e.g. ./configure --with-dpdk-lib=`echo $PWD`/dpdk --with-onvm-lib=`echo $ONVM_HOME`/onvm
|
# e.g. ./configure --with-dpdk-lib=$RTE_SDK/$RTE_TARGET --with-onvm-lib=`echo $ONVM_HOME`/onvm
|
||||||
# make
|
# make
|
||||||
```
|
```
|
||||||
|
|
||||||
- By default, mTCP assumes that there are 16 CPUs in your system.
|
- By default, mTCP assumes that there are 16 CPUs in your system.
|
||||||
You can set the CPU limit, e.g. on a 32-core system, by using the following command:
|
You can set the CPU limit, e.g. on a 32-core system, by using the following command:
|
||||||
```bash
|
```bash
|
||||||
# ./configure --with-dpdk-lib=$<path_to_mtcp_release_v3>/dpdk --with-onvm-lib=$<path_to_onvm_lib> CFLAGS="-DMAX_CPUS=32"
|
# ./configure --with-dpdk-lib=$RTE_SDK/$RTE_TARGET --with-onvm-lib=$<path_to_onvm_lib> CFLAGS="-DMAX_CPUS=32"
|
||||||
```
|
```
|
||||||
Please note that your NIC should support RSS queues equal to the MAX_CPUS value
|
Please note that your NIC should support RSS queues equal to the MAX_CPUS value
|
||||||
(since mTCP expects a one-to-one RSS queue to CPU binding).
|
(since mTCP expects a one-to-one RSS queue to CPU binding).
|
||||||
|
@ -241,7 +231,7 @@ ONVM basics are explained in https://github.com/sdnfv/openNetVM.
|
||||||
```# autoreconf -ivf```
|
```# autoreconf -ivf```
|
||||||
- checksum offloading in the NIC is now ENABLED (by default)!!!
|
- checksum offloading in the NIC is now ENABLED (by default)!!!
|
||||||
- this only works for dpdk at the moment
|
- this only works for dpdk at the moment
|
||||||
- use ```./configure --with-dpdk-lib=`echo $PWD`/dpdk --with-onvm-lib=$<path_to_onvm_lib> --disable-hwcsum``` to disable checksum offloading.
|
- use ```./configure --with-dpdk-lib=$RTE_SDK/$RTE_TARGET --with-onvm-lib=$<path_to_onvm_lib> --disable-hwcsum``` to disable checksum offloading.
|
||||||
- check libmtcp.a in mtcp/lib
|
- check libmtcp.a in mtcp/lib
|
||||||
- check header files in mtcp/include
|
- check header files in mtcp/include
|
||||||
- check example binary files in apps/example
|
- check example binary files in apps/example
|
||||||
|
|
|
@ -26,7 +26,7 @@ If you want to use ab with mTCP,
|
||||||
(e.g.
|
(e.g.
|
||||||
$ ./configure CFLAGS="-g -O3" \
|
$ ./configure CFLAGS="-g -O3" \
|
||||||
--with-libmtcp="<$PATH_TO_MTCP_RELEASE_V3>/mtcp/" \
|
--with-libmtcp="<$PATH_TO_MTCP_RELEASE_V3>/mtcp/" \
|
||||||
--with-libdpdk="<$PATH_TO_MTCP_RELEASE_V3>/dpdk/"
|
--with-libdpdk="<$PATH_TO_MTCP_RELEASE_V3>/$RTE_SDK/$RTE_TARGET"
|
||||||
)
|
)
|
||||||
|
|
||||||
-FOR NETMAP VERSION-
|
-FOR NETMAP VERSION-
|
||||||
|
|
|
@ -58,7 +58,7 @@ Configure the program with the following arguments:
|
||||||
$ ./configure --without-bzip2 CFLAGS="-g -O3" \
|
$ ./configure --without-bzip2 CFLAGS="-g -O3" \
|
||||||
--with-libmtcp="<$PATH_TO_MTCP_RELEASE_V3>/mtcp/" \
|
--with-libmtcp="<$PATH_TO_MTCP_RELEASE_V3>/mtcp/" \
|
||||||
--with-libpsio="<$PATH_TO_MTCP_RELEASE_V3>/io_engine/" \
|
--with-libpsio="<$PATH_TO_MTCP_RELEASE_V3>/io_engine/" \
|
||||||
--with-libdpdk="<$PATH_TO_MTCP_RELEASE_V3>/dpdk/" \
|
--with-libdpdk="<$PATH_TO_MTCP_RELEASE_V3>/$RTE_SDK/$RTE_TARGET" \
|
||||||
--with-libonvm="<$PATH_TO_ONVM>" \
|
--with-libonvm="<$PATH_TO_ONVM>" \
|
||||||
--enable-netmap
|
--enable-netmap
|
||||||
)
|
)
|
||||||
|
@ -75,7 +75,7 @@ The path should be absolute.
|
||||||
$ ./configure --without-bzip2 CFLAGS="-g -DINFO -DDBGERR" \
|
$ ./configure --without-bzip2 CFLAGS="-g -DINFO -DDBGERR" \
|
||||||
--with-libmtcp="<$PATH_TO_MTCP_RELEASE_V3>/mtcp/" \
|
--with-libmtcp="<$PATH_TO_MTCP_RELEASE_V3>/mtcp/" \
|
||||||
--with-libpsio="<$PATH_TO_MTCP_RELEASE_V3>/io_engine/" \
|
--with-libpsio="<$PATH_TO_MTCP_RELEASE_V3>/io_engine/" \
|
||||||
--with-libdpdk="<$PATH_TO_MTCP_RELEASE_V3>/dpdk/" \
|
--with-libdpdk="<$PATH_TO_MTCP_RELEASE_V3>/$RTE_SDK/$RTE_TARGET" \
|
||||||
--with-libonvm="<$PATH_TO_ONVM>" \
|
--with-libonvm="<$PATH_TO_ONVM>" \
|
||||||
--enable-netmap
|
--enable-netmap
|
||||||
)
|
)
|
||||||
|
|
|
@ -606,6 +606,10 @@ ParseConfiguration(char *line)
|
||||||
}
|
}
|
||||||
} else if (strcmp(p, "io") == 0) {
|
} else if (strcmp(p, "io") == 0) {
|
||||||
AssignIOModule(q);
|
AssignIOModule(q);
|
||||||
|
if (CheckIOModuleAccessPermissions() == -1) {
|
||||||
|
TRACE_CONFIG("[CAUTION] Run the app as root!\n");
|
||||||
|
exit(EXIT_FAILURE);
|
||||||
|
}
|
||||||
} else if (strcmp(p, "num_mem_ch") == 0) {
|
} else if (strcmp(p, "num_mem_ch") == 0) {
|
||||||
CONFIG.num_mem_ch = mystrtol(q, 10);
|
CONFIG.num_mem_ch = mystrtol(q, 10);
|
||||||
#ifdef ENABLE_ONVM
|
#ifdef ENABLE_ONVM
|
||||||
|
|
|
@ -1456,11 +1456,6 @@ mtcp_init(const char *config_file)
|
||||||
int i;
|
int i;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
if (geteuid()) {
|
|
||||||
TRACE_CONFIG("[CAUTION] Run the app as root!\n");
|
|
||||||
exit(EXIT_FAILURE);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* getting cpu and NIC */
|
/* getting cpu and NIC */
|
||||||
/* set to max cpus only if user has not arbitrarily set it to lower # */
|
/* set to max cpus only if user has not arbitrarily set it to lower # */
|
||||||
num_cpus = (CONFIG.num_cores == 0) ? GetNumCPUs() : CONFIG.num_cores;
|
num_cpus = (CONFIG.num_cores == 0) ? GetNumCPUs() : CONFIG.num_cores;
|
||||||
|
|
|
@ -5,6 +5,8 @@
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
/* for ps lib funcs */
|
/* for ps lib funcs */
|
||||||
#include "ps.h"
|
#include "ps.h"
|
||||||
|
/* for netmap macros */
|
||||||
|
#include "netmap_user.h"
|
||||||
#ifndef DISABLE_DPDK
|
#ifndef DISABLE_DPDK
|
||||||
/* for dpdk/onvm big ints */
|
/* for dpdk/onvm big ints */
|
||||||
#include <gmp.h>
|
#include <gmp.h>
|
||||||
|
@ -106,6 +108,10 @@ extern io_module_func netmap_module_func;
|
||||||
/* registered onvm context */
|
/* registered onvm context */
|
||||||
extern io_module_func onvm_module_func;
|
extern io_module_func onvm_module_func;
|
||||||
|
|
||||||
|
/* check I/O module access permissions */
|
||||||
|
int
|
||||||
|
CheckIOModuleAccessPermissions();
|
||||||
|
|
||||||
/* Macro to assign IO module */
|
/* Macro to assign IO module */
|
||||||
#define AssignIOModule(m) { \
|
#define AssignIOModule(m) { \
|
||||||
if (!strcmp(m, "psio")) \
|
if (!strcmp(m, "psio")) \
|
||||||
|
|
|
@ -34,6 +34,9 @@
|
||||||
/* for dpdk/onvm big ints */
|
/* for dpdk/onvm big ints */
|
||||||
#include <gmp.h>
|
#include <gmp.h>
|
||||||
#endif
|
#endif
|
||||||
|
/* for file opening */
|
||||||
|
#include <sys/stat.h>
|
||||||
|
#include <fcntl.h>
|
||||||
/*----------------------------------------------------------------------------*/
|
/*----------------------------------------------------------------------------*/
|
||||||
io_module_func *current_iomodule_func = &dpdk_module_func;
|
io_module_func *current_iomodule_func = &dpdk_module_func;
|
||||||
#ifndef DISABLE_DPDK
|
#ifndef DISABLE_DPDK
|
||||||
|
@ -568,3 +571,22 @@ FetchEndianType()
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
/*----------------------------------------------------------------------------*/
|
/*----------------------------------------------------------------------------*/
|
||||||
|
int
|
||||||
|
CheckIOModuleAccessPermissions()
|
||||||
|
{
|
||||||
|
int fd;
|
||||||
|
/* check if netmap module can access I/O with sudo privileges */
|
||||||
|
if (current_iomodule_func == &netmap_module_func) {
|
||||||
|
fd = open(NETMAP_DEVICE_NAME, O_RDONLY);
|
||||||
|
if (fd != -1)
|
||||||
|
close(fd);
|
||||||
|
return fd;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* sudo privileges are definitely needed otherwise */
|
||||||
|
if (geteuid())
|
||||||
|
return -1;
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
/*----------------------------------------------------------------------------*/
|
||||||
|
|
Loading…
Reference in New Issue