From 8489986bf80269ca8a70d1ad4f5957102b3f5665 Mon Sep 17 00:00:00 2001 From: yinzhongyi Date: Fri, 18 May 2018 13:50:52 +0800 Subject: Update docs and remove the unrelated 'sudo' cmd in build.sh Change-Id: Ieed544e8965c30d1dd0c9cc8c5f64d3c66e7df0b Signed-off-by: yinzhongyi --- doc/Build_DMM.md | 35 +++++++++++++++------------------ doc/TestAppUserGuide.md | 46 ++++++++++++++++++++++++++++++++------------ resources/extras/Vagrantfile | 3 --- scripts/build.sh | 22 ++++++++------------- 4 files changed, 58 insertions(+), 48 deletions(-) diff --git a/doc/Build_DMM.md b/doc/Build_DMM.md index bda16b0..283c58d 100644 --- a/doc/Build_DMM.md +++ b/doc/Build_DMM.md @@ -1,12 +1,12 @@ # 1. Introduction: - This document purpose is to build the DMM and run applications on it. + The purpose of this document is to illustrate how to build DMM and run applications on it. Note: - Users can easily build the DMM by running DMM/scripts/build.sh, which contains following steps. + Users can easily build DMM by running DMM/scripts/build.sh, which contains following steps. # 2. Build DPDK: - DPDK need to be built first for DMM RTE memory dependency. + DPDK needs to be built first for DMM RTE memory dependency. - Steps : @@ -14,29 +14,28 @@ Note: ``` #wget http://static.dpdk.org/rel/dpdk-16.04.tar.xz #tar xvf dpdk-16.04.tar.xz - #vi dpdk-16.04/config/common_base //make CONFIG_RTE_BUILD_SHARED_LIB=y CONFIG_RTE_EXEC_ENV=y CONFIG_RTE_LIBRTE_EAL=y + #vi dpdk-16.04/config/common_base //make CONFIG_RTE_BUILD_SHARED_LIB=y, CONFIG_RTE_EXEC_ENV=y, CONFIG_RTE_LIBRTE_EAL=y #cd dpdk-16.04 - #make install T=x86_64-native-linuxapp-gcc DESTDIR=/root/dpdk_build/tmp2 + #make install T=x86_64-native-linuxapp-gcc DESTDIR=/usr -j 4 #cd x86_64-native-linuxapp-gcc #make //install the dpdk which will generate .so inside lib folder in the path. ``` Note: - Environment: - Linux ubuntu 14.04 or some distro which support dpdk-16.04 + Environment: + Linux ubuntu 14.04 or some distro which support dpdk-16.04 # 3. Build DMM: ``` - #cd dmm/build - #cmake -D DMM_DPDK_INSTALL_DIR=$DPDK_INSTALL_PATH .. + #cd $(DMM_DIR)/thirdparty/glog/glog-0.3.4/ && autoreconf -ivf + #cd $(DMM_DIR)/build + #cmake .. ``` Note: - - $DPDK_INSTALL_PATH is the path where DPDK has been installed - + $(DMM_DIR) is the directory where dmm has been cloned. After cmake all the makefiles and dependent .sh files will be copied under build directory. ``` @@ -49,10 +48,7 @@ Note: - Hugepage setting: ``` - #vi /etc/default/grub - //update GRUB_CMDLINE_LINUX_DEFAULT="default_hugepagesz=1G hugepagesz=1G hugepages=8" - #update-grub - #reboot + #sudo sysctl -w vm.nr_hugepages=1024 ``` Check hugepage info @@ -65,9 +61,9 @@ Check hugepage info - Mount hugepages: ``` - #mkdir -p /mnt/nstackhuge/ - #mount -t hugetlbfs -o pagesize=1G none /mnt/nstackhuge/ //only 1G pgsize supported now - #mkdir -p /var/run/ip_module + #sudo mkdir -p /mnt/nstackhuge/ + #sudo mount -t hugetlbfs -o pagesize=2M none /mnt/nstackhuge/ + #sudo mkdir -p /var/run/ip_module ``` @@ -78,6 +74,7 @@ Check hugepage info - Enable detail log of nstack by setting env var ``` + #export LD_LIBRARY_PATH=/dmm/release/lib64 #export NSTACK_LOG_ON=DBG ``` diff --git a/doc/TestAppUserGuide.md b/doc/TestAppUserGuide.md index e8c0802..2f21023 100644 --- a/doc/TestAppUserGuide.md +++ b/doc/TestAppUserGuide.md @@ -18,6 +18,10 @@ Copy the two json files to release/bin and configure in next step. +Note: + + If users have run scripts/build.sh, configuration files were generated in /dmm/config/app_test. + # 3. JSON files configuration. We need to setup configuration as given below. @@ -26,23 +30,38 @@ We need to setup configuration as given below. ``` { - "default_stack_name": "kernel", /*when rd can't be find maybe - choose the defualt one*/ + "default_stack_name": "kernel", /*when rd can't be find maybe choose the defualt one*/ "module_list": [ { - "stack_name": "kernel", - "function_name": "kernel_stack_register", - "libname": "", /*library name, if loadtype is static, this maybe - null, else must give a library name*/ - "loadtype": "static", /*library load type: static or dynamic*/ - "deploytype": "1", + "stack_name": "kernel", /*stack name*/ + "function_name": "kernel_stack_register", /*function name*/ + "libname": "./", /*library name, if loadtype is static, this maybe + null, else must give a library name*/ + "loadtype": "static", /*library load type: static or dynamic*/ + "deploytype": "1", /*deploy model type:model type1, model type2, + model type3. Indicating single or multi process + deployment. Used during shared memory initialization.*/ + "maxfd": "1024", /*the max fd supported*/ + "minfd": "0", /*the min fd supported*/ + "priorty": "1", /*priorty when executing, reserv*/ + "stackid": "0", /*stack id, this must be ordered and not be repeated*/ + }, +/*********************************** + { + "stack_name": "stackx", /*this is not a real stack, just an example for multiple + stack configurations*/ + "function_name": "stackx_register", + "libname": "libstackx.so", + "loadtype": "dynmic", + "deploytype": "3", "maxfd": "1024", "minfd": "0", "priorty": "1", - "stackid": "0", /*must be ordered and not be repeated*/ - } + "stackid": "1", + }, ] } +***********************************/ ``` # 3.2 rd_config.json for example: @@ -87,7 +106,7 @@ The use of ks_epoll,ks_select,vs_epoll and vs_select are the same. Examples: -**With Kernel stack:** +**With Kernel stack(With direct kernel stack):** server: ``` @@ -98,7 +117,10 @@ client: #./kc_common -p 20000 -d 172.16.25.126 -a 10000 -s 172.16.25.125 -l 200 -t 5000000 -i 0 -f 1 -r 20000 -n 1 -w 10 -u 10000 -e 10 -x 1 ``` -**With DMM nStack:** +**With DMM nStack(Stack is choosed by congfigure file):** +Note: + + Currently DMM nstack only support kernel mode. please check the config file. server: ``` diff --git a/resources/extras/Vagrantfile b/resources/extras/Vagrantfile index 70c0d78..c3107c9 100644 --- a/resources/extras/Vagrantfile +++ b/resources/extras/Vagrantfile @@ -7,9 +7,6 @@ Vagrant.configure(2) do |config| distro = ( ENV['DMM_VAGRANT_DISTRO'] || "ubuntu") if distro == 'centos7' config.vm.box = "puppetlabs/centos-7.2-64-nocm" - #config.vm.box = "centos/7" - #config.vm.box_version = "1708.01" - #config.ssh.insert_key = false else config.vm.box = "fdio-csit/ubuntu-14.04.4_2016-05-25_1.0" end diff --git a/scripts/build.sh b/scripts/build.sh index d09df32..7fc4e00 100755 --- a/scripts/build.sh +++ b/scripts/build.sh @@ -22,7 +22,7 @@ DMM_DIR=$1 if [ "x$1" != "x" ]; then DMM_DIR=$1 else - DMM_DIR=`dirname $0`/../ + DMM_DIR=`dirname $(readlink -f $0)`/../ fi echo 0:$0 @@ -30,7 +30,6 @@ echo 1:$1 echo 2:$2 echo DMM_DIR: $DMM_DIR -#DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" BUILD_DIR=${DMM_DIR}/build LIB_PATH=${DMM_DIR}/release/lib64 @@ -55,7 +54,6 @@ DPDK_DOWNLOAD_PATH=/tmp/dpdk DPDK_INSTALL_PATH=/usr #set and check the environment for Linux -#set env if [ "$OS_ID" == "ubuntu" ]; then export DEBIAN_FRONTEND=noninteractive export DEBCONF_NONINTERACTIVE_SEEN=true @@ -76,7 +74,7 @@ elif [ "$OS_ID" == "opensuse" ]; then sudo yum install -y git cmake gcc g++ automake libtool wget lsof lshw pciutils net-tools tcpdump vim sudo yum-utils pcre-devel zlib-devel fi -#check env +#set and check env sudo sysctl -w vm.nr_hugepages=1024 HUGEPAGES=`sysctl -n vm.nr_hugepages` if [ $HUGEPAGES != 1024 ]; then @@ -86,9 +84,9 @@ fi #DPDK will be having dependancy on linux headers if [ "$OS_ID" == "ubuntu" ]; then - apt-get -y install git build-essential linux-headers-`uname -r` + sudo apt-get -y install git build-essential linux-headers-`uname -r` elif [ "$OS_ID" == "debian" ]; then - apt-get -y install git build-essential linux-headers-`uname -r` + sudo apt-get -y install git build-essential linux-headers-`uname -r` elif [ "$OS_ID" == "centos" ]; then sudo yum groupinstall -y "Development Tools" sudo yum install -y kernel-headers @@ -116,7 +114,7 @@ if [ $hugepageSize -ne 0 ]; then fi -mkdir /mnt/nstackhuge -p +sudo mkdir /mnt/nstackhuge -p sudo mount -t hugetlbfs -o pagesize=2M none /mnt/nstackhuge/ sudo mkdir -p /var/run/ip_module/ @@ -151,10 +149,7 @@ export NSTACK_LOG_ON=DBG #===========build DMM================= echo "DMM build started....." -#cd $LIB_PATH && rm -rf * - cd $DMM_DIR/thirdparty/glog/glog-0.3.4/ && sudo autoreconf -ivf - cd $BUILD_DIR rm -rf * cmake .. @@ -163,8 +158,7 @@ make -j 8 ############### Preapre APP test directory echo -e "\e[41m Preapring APP test directory.....\e[0m" - -sudo mkdir -p $DMM_DIR/config/app_test +mkdir -p $DMM_DIR/config/app_test cd $DMM_DIR/config/app_test if [ "$OS_ID" == "ubuntu" ]; then @@ -194,7 +188,7 @@ echo '{ "stackid": "0", }, ] -}' | sudo tee module_config.json +}' | tee module_config.json echo '{ "ip_route": [ @@ -217,6 +211,6 @@ echo '{ "type": "nstack-kernel", } ], -}' | sudo tee rd_config.json +}' | tee rd_config.json echo "DMM build finished....." -- cgit 1.2.3-korg