- Updated documentation for the update made in the last commit.
parent
259bab9fbd
commit
392291d071
|
@ -1,5 +1,12 @@
|
|||
#!/usr/bin/env bash
|
||||
export MTCP_TARGET=`echo $PWD`/mtcp
|
||||
autoreconf -ivf
|
||||
./configure --enable-netmap
|
||||
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
|
||||
export PSIO_TARGET=`echo $PWD`/io_engine
|
||||
export MTCP_TARGET=`echo $PWD`/mtcp
|
||||
autoreconf -ivf
|
||||
./configure --with-psio-lib=`echo $PWD`/io_engine
|
||||
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
|
||||
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,
|
||||
please rename the interface with a ``dpdk`` prefix. You can do so
|
||||
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.
|
||||
|
||||
3. Create soft links for include/ and lib/ directories inside
|
||||
empty dpdk/ directory:
|
||||
# cd dpdk/
|
||||
# ln -s <path_to_dpdk_17_08_directory>/x86_64-native-linuxapp-gcc/lib lib
|
||||
# ln -s <path_to_dpdk_17_08_directory>/x86_64-native-linuxapp-gcc/include include
|
||||
3. Set RTE_SDK and RTE_TARGET environment variables
|
||||
|
||||
# export RTE_SDK=`echo $PWD`/dpdk-17.08/
|
||||
# export RTE_TARGET=x86_64-native-linuxapp-gcc
|
||||
|
||||
4. Setup mtcp library:
|
||||
# ./configure --with-dpdk-lib=$<path_to_mtcp_release_v3>/dpdk
|
||||
## And not dpdk-17.08!
|
||||
## e.g. ./configure --with-dpdk-lib=`echo $PWD`/dpdk
|
||||
# ./configure --with-dpdk-lib=$RTE_SDK/$RTE_TARGET
|
||||
# make
|
||||
- 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:
|
||||
# ./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
|
||||
(since mTCP expects a one-to-one RSS queue to CPU binding).
|
||||
- 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)!!!
|
||||
- this only works for dpdk at the moment
|
||||
- use
|
||||
./configure --with-dpdk-lib=`echo $PWD`/dpdk --disable-hwcsum
|
||||
./configure --with-dpdk-lib=$RTE_SDK/$RTE_TARGET --disable-hwcsum
|
||||
to disable checksum offloading.
|
||||
- check libmtcp.a in mtcp/lib
|
||||
- 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:
|
||||
# sudo $RTE_SDK/tools/dpdk-setup-iface.sh
|
||||
|
||||
3. Create soft links for include/ and lib/ directories inside
|
||||
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
|
||||
3. Setup mtcp library
|
||||
# ./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
|
||||
|
||||
- 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:
|
||||
# ./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
|
||||
(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)!!!
|
||||
- this only works for dpdk at the moment
|
||||
- use
|
||||
./configure --with-dpdk-lib=`echo $PWD`/dpdk --disable-hwcsum
|
||||
./configure --with-dpdk-lib=$RTE_SDK/$RTE_TARGET --disable-hwcsum
|
||||
to disable checksum offloading.
|
||||
- check libmtcp.a in mtcp/lib
|
||||
- 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
|
||||
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,
|
||||
please rename the interface with a ``dpdk`` prefix. You can do so
|
||||
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.
|
||||
|
||||
3. Create soft links for ``include/`` and ``lib/`` directories inside
|
||||
empty ``dpdk/`` directory:
|
||||
3. Set RTE_SDK and RTE_TARGET environment variables
|
||||
|
||||
```bash
|
||||
# cd dpdk/
|
||||
# ln -s <path_to_dpdk_17_08_directory>/x86_64-native-linuxapp-gcc/lib lib
|
||||
# ln -s <path_to_dpdk_17_08_directory>/x86_64-native-linuxapp-gcc/include include
|
||||
# export RTE_SDK=`echo $PWD`/dpdk-17.08/
|
||||
# export RTE_TARGET=x86_64-native-linuxapp-gcc
|
||||
```
|
||||
|
||||
4. Setup mtcp library:
|
||||
```bash
|
||||
# ./configure --with-dpdk-lib=$<path_to_mtcp_release_v3>/dpdk
|
||||
## And not dpdk-17.08!
|
||||
## e.g. ./configure --with-dpdk-lib=`echo $PWD`/dpdk
|
||||
# ./configure --with-dpdk-lib=$RTE_SDK/$RTE_TARGET
|
||||
# make
|
||||
```
|
||||
|
||||
- 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:
|
||||
```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
|
||||
(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```
|
||||
- checksum offloading in the NIC is now ENABLED (by default)!!!
|
||||
- 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 header files in mtcp/include
|
||||
- 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```
|
||||
|
||||
3. Create soft links for ``include/`` and ``lib/`` directories inside
|
||||
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
|
||||
3. Setup mtcp library
|
||||
```bash
|
||||
# ./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
|
||||
```
|
||||
|
||||
- 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:
|
||||
```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
|
||||
(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```
|
||||
- checksum offloading in the NIC is now ENABLED (by default)!!!
|
||||
- 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 header files in mtcp/include
|
||||
- check example binary files in apps/example
|
||||
|
|
|
@ -26,7 +26,7 @@ If you want to use ab with mTCP,
|
|||
(e.g.
|
||||
$ ./configure CFLAGS="-g -O3" \
|
||||
--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-
|
||||
|
|
|
@ -58,7 +58,7 @@ Configure the program with the following arguments:
|
|||
$ ./configure --without-bzip2 CFLAGS="-g -O3" \
|
||||
--with-libmtcp="<$PATH_TO_MTCP_RELEASE_V3>/mtcp/" \
|
||||
--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>" \
|
||||
--enable-netmap
|
||||
)
|
||||
|
@ -75,7 +75,7 @@ The path should be absolute.
|
|||
$ ./configure --without-bzip2 CFLAGS="-g -DINFO -DDBGERR" \
|
||||
--with-libmtcp="<$PATH_TO_MTCP_RELEASE_V3>/mtcp/" \
|
||||
--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>" \
|
||||
--enable-netmap
|
||||
)
|
||||
|
|
|
@ -606,6 +606,10 @@ ParseConfiguration(char *line)
|
|||
}
|
||||
} else if (strcmp(p, "io") == 0) {
|
||||
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) {
|
||||
CONFIG.num_mem_ch = mystrtol(q, 10);
|
||||
#ifdef ENABLE_ONVM
|
||||
|
|
|
@ -1456,11 +1456,6 @@ mtcp_init(const char *config_file)
|
|||
int i;
|
||||
int ret;
|
||||
|
||||
if (geteuid()) {
|
||||
TRACE_CONFIG("[CAUTION] Run the app as root!\n");
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
/* getting cpu and NIC */
|
||||
/* set to max cpus only if user has not arbitrarily set it to lower # */
|
||||
num_cpus = (CONFIG.num_cores == 0) ? GetNumCPUs() : CONFIG.num_cores;
|
||||
|
|
|
@ -5,6 +5,8 @@
|
|||
#include <stdint.h>
|
||||
/* for ps lib funcs */
|
||||
#include "ps.h"
|
||||
/* for netmap macros */
|
||||
#include "netmap_user.h"
|
||||
#ifndef DISABLE_DPDK
|
||||
/* for dpdk/onvm big ints */
|
||||
#include <gmp.h>
|
||||
|
@ -106,6 +108,10 @@ extern io_module_func netmap_module_func;
|
|||
/* registered onvm context */
|
||||
extern io_module_func onvm_module_func;
|
||||
|
||||
/* check I/O module access permissions */
|
||||
int
|
||||
CheckIOModuleAccessPermissions();
|
||||
|
||||
/* Macro to assign IO module */
|
||||
#define AssignIOModule(m) { \
|
||||
if (!strcmp(m, "psio")) \
|
||||
|
|
|
@ -34,6 +34,9 @@
|
|||
/* for dpdk/onvm big ints */
|
||||
#include <gmp.h>
|
||||
#endif
|
||||
/* for file opening */
|
||||
#include <sys/stat.h>
|
||||
#include <fcntl.h>
|
||||
/*----------------------------------------------------------------------------*/
|
||||
io_module_func *current_iomodule_func = &dpdk_module_func;
|
||||
#ifndef DISABLE_DPDK
|
||||
|
@ -568,3 +571,22 @@ FetchEndianType()
|
|||
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