From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mogw0528.ocn.ad.jp (mogw0528.ocn.ad.jp [118.23.178.170]) by dpdk.org (Postfix) with ESMTP id 5FD17A49C for ; Tue, 23 Jan 2018 01:28:46 +0100 (CET) Received: from mf-smf-ucb018.ocn.ad.jp (mf-smf-ucb018.ocn.ad.jp [153.149.227.67]) by mogw0528.ocn.ad.jp (Postfix) with ESMTP id CB9FE2502C7; Tue, 23 Jan 2018 09:28:44 +0900 (JST) Received: from mf-smf-ucb018.ocn.ad.jp (mf-smf-ucb018 [153.149.227.67]) by mf-smf-ucb018.ocn.ad.jp (Postfix) with ESMTP id B437720627; Tue, 23 Jan 2018 09:28:44 +0900 (JST) Received: from ntt.pod01.mv-mta-ucb029 (mv-mta-ucb029.ocn.ad.jp [153.149.230.163]) by mf-smf-ucb018.ocn.ad.jp (Switch-3.3.4/Switch-3.3.4) with ESMTP id w0N0SixN043955; Tue, 23 Jan 2018 09:28:44 +0900 Received: from smtp.ocn.ne.jp ([153.149.227.133]) by ntt.pod01.mv-mta-ucb029 with id 1cUk1x0012tKTyH01cUkNk; Tue, 23 Jan 2018 00:28:44 +0000 Received: from mugwort.jp (p1247-ipngn8903marunouchi.tokyo.ocn.ne.jp [153.221.64.247]) by smtp.ocn.ne.jp (Postfix) with ESMTPA; Tue, 23 Jan 2018 09:28:44 +0900 (JST) From: ogawa.yasufumi@lab.ntt.co.jp To: spp@dpdk.org, ferruh.yigit@intel.com, x-fn-spp@sl.ntt-tx.co.jp Cc: Hiroyuki Nakamura , Naoki Takada Date: Tue, 23 Jan 2018 09:28:47 +0900 Message-Id: <20180123002854.28345-2-ogawa.yasufumi@lab.ntt.co.jp> X-Mailer: git-send-email 2.13.1 In-Reply-To: <20180123002854.28345-1-ogawa.yasufumi@lab.ntt.co.jp> References: <20180123002854.28345-1-ogawa.yasufumi@lab.ntt.co.jp> Subject: [spp] [PATCH 02/28] doc: add how_to_use.md X-BeenThere: spp@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: Soft Patch Panel List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Jan 2018 00:28:48 -0000 From: Hiroyuki Nakamura how_to_use.md is a guide for running spp_vf. Signed-off-by: Naoki Takada --- docs/spp_vf/how_to_use.md | 105 ++++++ docs/spp_vf/setup.md | 3 + docs/spp_vf/spp_vf_overview.svg | 793 ++++++++++++++++++++++++++++++++++++++++ 3 files changed, 901 insertions(+) create mode 100644 docs/spp_vf/how_to_use.md create mode 100644 docs/spp_vf/spp_vf_overview.svg diff --git a/docs/spp_vf/how_to_use.md b/docs/spp_vf/how_to_use.md new file mode 100644 index 0000000..ca9cf15 --- /dev/null +++ b/docs/spp_vf/how_to_use.md @@ -0,0 +1,105 @@ +# How to Use SPP_VF + +## SPP_VF + +SPP_VF is a SR-IOV like network functionality for NFV. + +![spp_vf_overview](spp_vf_overview.svg) + +## Environment + +* Ubuntu 16.04 +* qemu-kvm +* DPDK v17.05 + +## Launch SPP + +Before launching spp, you need to setup described as [setup guide](setup.md). + +### SPP Controller + +First, run SPP Controller with port numbers for spp primary and secondary. + +```sh +$ python ./src/spp.py -p 5555 -s 6666 +``` + +### SPP Primary + +SPP primary reserves and manages resources for secondary processes. +You have to run it before secondaries. + +Options of spp primary are + * -p : port mask + * -n : number of rings + * -s : ip addr and port of spp primary + +```sh +$ sudo ./src/primary/x86_64-native-linuxapp-gcc/spp_primary \ +-c 0x02 -n 4 --socket-mem 512,512 \ +--huge-dir=/run/hugepages/kvm \ +--proc-type=primary \ +-- -p 0x03 -n 9 -s 127.0.0.1:5555 +``` + +### SPP Secondary + +In `spp_vf`, spp secondary processes are launched by single command. +Core assingment and network configuration are defined +in JSON formatted config file. +If you run `spp_vf` without giving config file, it refers default +config file (test/spp_config/spp_config/vf.json). + +```sh +$ sudo ./src/vf/x86_64-native-linuxapp-gcc/spp_vf \ +-c 0x3ffd -n 4 --proc-type=secondary +``` + +You can also indicate which of config you use explicitly with +`--config` option as following example. +Please refer to sample config files in test/spp_config/spp_config. + +[NOTE] Core mask should be changed to correspond with core assingment +defined in each of config files. + +```sh +$ sudo ./src/vf/x86_64-native-linuxapp-gcc/spp_vf \ +-c 0x3ffd -n 4 --proc-type=secondary \ +-- --config /path/to/config/spp_vf1.json +``` + +### SPP VM + +Launch VMs with `virsh` command. + +```sh +$ virsh start [VM] +``` + +### Additional Network Configurations + +To enable processes running on the VM to communicate through spp, +it is required additional network configurations on host and guest VMss. + +#### Host1 + +```sh +# Interface for vhost +$ sudo ifconfig [IF_NAME] inet [IP_ADDR] netmask [NETMASK] up + +# Register host2 to arp table +$ sudo arp -s [IP_ADDR] [MAC_ADDR] -i [IF_NAME] + +# Disable offload for vhost interface +$ sudo ethtool -K [IF_NAME] tx off +``` + +#### Host2 + +```sh +# Register VM to arp table +$ sudo arp -s [IP_ADDR] [MAC_ADDR] -i [IF_NAME] + +# Disable offload for VM interface +$ ethtool -K [IF_NAME] tx off +``` diff --git a/docs/spp_vf/setup.md b/docs/spp_vf/setup.md index 572777b..450e68a 100644 --- a/docs/spp_vf/setup.md +++ b/docs/spp_vf/setup.md @@ -168,6 +168,9 @@ Edit VM configuration with virsh. ```sh $ virsh edit [VM_NAME] +``` + +```xml spp-vm1 d90f5420-861a-4479-8559-62d7a1545cb9 diff --git a/docs/spp_vf/spp_vf_overview.svg b/docs/spp_vf/spp_vf_overview.svg new file mode 100644 index 0000000..d0a6769 --- /dev/null +++ b/docs/spp_vf/spp_vf_overview.svg @@ -0,0 +1,793 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + host2 + host1 + rx + tx + + network + rx + tx + + + + + + + + guest + + + rx + tx + rx + tx + vNIC(vhost) + vNIC(vhost) + + + + spp_vf + + + + + + + + + classifier + merger + fwd + fwd + fwd + fwd + + + + + + + + + + + + -- 2.13.1