Skip to content

Commit 6a240a2

Browse files
koolzznks5295
authored andcommitted
Doc updates (#70)
Updates the provided shell examples with new NF and onvm_mgr args in all docs. Appends new feature documentation to docs/ files. Commit log: * Update Intall.md doc * Update example with the new launch script changes * Fix readme spaces * Examples.md fixes * Update old mgr usage in Debug.md * Update Docker.md with new argument examples * Update Install.md * Update Install.md * U
1 parent 8ede865 commit 6a240a2

File tree

4 files changed

+36
-28
lines changed

4 files changed

+36
-28
lines changed

docs/Debug.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ The NF/mgr hugepage memory layout discrepency is resolved by using the base virt
4343
Examples of compex NFs: ndpi_stats, onvm_mtcp epserver
4444

4545
Example onvm_mgr setup:
46-
```./go.sh 0,1,2,3 3 -v 0x7f000000000 -s stdout```
46+
```./go.sh 0,1,2,3 3 0xF0 -v 0x7f000000000 -s stdout```
4747

4848
[dpdk-pdump]: http://dpdk.org/doc/guides/tools/pdump.html#example
4949
[speed_tester]: ../examples/speed_tester

docs/Docker.md

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ sudo ./docker.sh -h HUGEPAGES -o ONVM -n NAME [-D DEVICES] [-d DIRECTORY] [-c CO
3434
- This will start a container with two NIC devices mapped in, /dev/uio0 and /dev/uio1, the hugepage directory at `/mnt/huge` mapped in, and the openNetVM source directory at `/root/openNetVM` mapped into the container with the name of Basic_Monitor_NF.
3535

3636
```bash
37-
sudo ./docker.sh -h /mnt/huge -o /root/openNetVM -n Speed_Tester_NF -D /dev/uio0 -c "./examples/speed_tester/go.sh 5 1 1"
37+
sudo ./docker.sh -h /mnt/huge -o /root/openNetVM -n Speed_Tester_NF -D /dev/uio0 -c "./examples/speed_tester/go.sh 1 -d 1"
3838
```
3939

4040
- This will start a container with one NIC device mapped in, /dev/uio0 , the hugepage directory at `/mnt/huge` mapped in, and the openNetVM source directory at `/root/openNetVM` mapped into the container with the name of Speed_Tester_NF. Also, the container will be started in detached mode (no connection to it) and it will run the go script of the simple forward NF.
@@ -71,21 +71,15 @@ Makefile aes_decrypt aes_encrypt arp_response basic_monitor bridge flow_tab
7171
root@899618eaa98c:/openNetVM/examples# cd basic_monitor/
7272
root@899618eaa98c:/openNetVM/examples/basic_monitor# ls
7373
Makefile README.md build go.sh monitor.c
74-
root@899618eaa98c:/openNetVM/examples/basic_monitor# ./go.sh
75-
./go.sh CPU-LIST SERVICE-ID [-p PRINT] [-n NF-ID]
76-
./go.sh 3 0 --> core 3, Service ID 0
77-
./go.sh 3,7,9 1 --> cores 3,7, and 9 with Service ID 1
78-
./go.sh -p 1000 -n 6 3,7,9 1 --> cores 3,7, and 9 with Service ID 1 and
79-
Print Rate of 1000 and instance ID 6
80-
root@899618eaa98c:/openNetVM/examples/basic_monitor# ./go.sh 3 1
74+
root@899618eaa98c:/openNetVM/examples/basic_monitor# ./go.sh 3 -d 1
8175
...
8276
```
8377
8478
You can also use the optional command argument to run directly the NF inside of the container, without connecting to it. Then, to stop gracefully the NF (so it has time to notify onvm manager), use the docker stop command before docker rm the container.
8579
The prerequisites are the same as in the case where you connect to the container.
8680
8781
```bash
88-
root@nimbnode /root/openNetVM# ./scripts/docker.sh -h /mnt/huge -o /root/openNetVM -n speed_tester_nf -D /dev/uio0,/dev/uio1 -c "./examples/speed_tester/go.sh 5 1 1"
82+
root@nimbnode /root/openNetVM# ./scripts/docker.sh -h /mnt/huge -o /root/openNetVM -n speed_tester_nf -D /dev/uio0,/dev/uio1 -c "./examples/speed_tester/go.sh 1 -d 1"
8983
14daebeba1adea581c2998eead16ff7ce7fdc45394c0cc5d6489228aad939711
9084
root@nimbnode /root/openNetVM# sudo docker stop speed_tester_nf
9185
speed_tester_nf

docs/Examples.md

Lines changed: 22 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,33 @@ contains ONVM and DPDK arguments. An example of this can be seen
88
[here](../examples/example_config.json). In addition, the values
99
specified in the config file can be overwritten by passing them at the
1010
command line. The general structure for launching an NF from a config file is
11-
`./go -F <CONFIG_FILE.json> <DPDK ARGS> -- <ONVM ARGS> -- <NF ARGS>`.
11+
`./go.sh -F <CONFIG_FILE.json> <DPDK ARGS> -- <ONVM ARGS> -- <NF ARGS>`.
1212
Any args specified in `<DPDK args>` or `<ONVM ARGS>` will replace the
1313
corresponding args in the config file. **An important note:** If no DPDK
1414
or ONVM args are passed, **but** NF args are required, the `-- --` is
1515
still required. For documentation on developing with config files, see
1616
[NF_Dev](NF_Dev.md)
1717

18+
NF Starting Scripts
19+
--
20+
The example NFs can be started using the `start_nf.sh` script. The script can run any example NF based on the first argument which is the NF name(this is based on the assumption that the name matches the NF folder and the build binary).
21+
The script has 2 modes:
22+
- Simple
23+
```sh
24+
./start_nf.sh NF_NAME SERVICE_ID (NF_ARGS)
25+
./start_nf.sh speed_tester 1 -d 1
26+
```
27+
- Complex
28+
```sh
29+
./start_nf.sh NF_NAME DPDK_ARGS -- ONVM_ARGS -- NF_ARGS
30+
./start_nf.sh speed_tester -l 4 -- -s -r 6 -- -d 5
31+
```
32+
*All the NF directories have a symlink to `examples/go.sh` file which allows to omit the NF name argument when running the NF from its directory:*
33+
```sh
34+
cd speed_tester && ./go.sh 1 -d 1
35+
cd speed_tester && ./go.sh -l 4 -- -s -r 6 -- -d 5
36+
```
37+
1838
Linear NF Chain
1939
--
2040
In this example, we will be setting up a chain of NFs. The length of the chain is determined by our system's CPU architecture. Some of the commands used in this example are specific to our system; in the cases where we refer to core lists or number of NFs, please run the [Core Helper Script][cores] to get your numbers.
@@ -115,17 +135,7 @@ In this example, we can set up a circular chain of NFs. Here, traffic does not
115135
- `# ./examples/start_nf.sh simple_forward 2 -d 1`
116136
- Second, start up 1 speed_tester NF and have it forward to service ID 2.
117137
- `# ./examples/start_nf.sh speed_tester 1 -d 2 -c 16000`
118-
4. We now have a speed_tester sending packets to service ID 2 who then forwards packets back to service ID 1, the speed_tester. This is a circular chain of NFs.
119-
120-
121-
NF Config Files
122-
--
123-
All NFs support launching from a JSON config file. By specifying `-F`
124-
and then a JSON file in either `go.sh` or the NF binary file directly,
125-
the NF will pull all ONVM and DPDK settings from the file instead of the
126-
command line. See the `example_config.json` file in each NF directory
127-
for an example on how to structure the file and all options that can be
128-
set.
138+
4. We now have a speed_tester sending packets to service ID 2 who then forwards packets back to service ID 1, the speed_tester. This is a circular chain of NFs.
129139
130140
131141
[cores]: ../scripts/corehelper.py

docs/Install.md

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -39,11 +39,12 @@ Setup Repositories
3939
cd openNetVM
4040
git checkout master
4141
```
42-
This will ensure you are on the stable, `master` branch. If you want to use potentially buggy features, you can use the default `develop` branch.
42+
This will ensure you are on the stable, `master` branch. If you want to use the most recent but potentially buggy features, you can use the default `develop` branch.
4343

4444
2. Initialize DPDK submodule
4545
```sh
46-
git submodule init && git submodule update
46+
git submodule sync
47+
git submodule update --init
4748
```
4849

4950
**From this point forward, this guide assumes that you are working out of the openNetVM source directory.**
@@ -148,19 +149,22 @@ Make and test openNetVM
148149

149150
3. Run openNetVM manager
150151

151-
Run openNetVM manager to use 4 cores (1 for displaying statistics, 1 for NIC RX, 1 for NIC TX, and 1 for NF TX), to use 1 NIC port (hexadecimal portmask), and to use stdout for the statistics console:
152+
Run openNetVM manager to use 4 cores (1 for displaying statistics, 1 for NIC RX, 1 for NIC TX, and 1 for NF TX), to use 1 NIC port (hexadecimal portmask), 0xF8 for the NF coremask (cores 4, 5, 6, 7), and to use stdout for the statistics console:
152153

153-
`./onvm/go.sh 0,1,2,3 1 -s stdout`
154+
`./onvm/go.sh 0,1,2,3 1 0xF8 -s stdout`
154155

155156
You should see information regarding the NIC port that openNetVM is using, and openNetVM manager statistics will be displayed.
156157

157158
4. Run speed_tester NF
158159

159160
To test the system, we will run the speed_tester example NF. This NF generates a buffer of packets, and sends them to itself to measure the speed of a single NF TX thread.
160161

161-
In a new shell, run this command to start the speed_tester by giving it one core, assigning it a service ID of 1, setting its destination service ID to 1, and creating an initial batch of 16000 packets (increasing the packet count from the default 128 is especially important if you run a chain of multiple NFs):
162+
In a new shell, run this command to start the speed_tester, assigning it a service ID of 1, setting its destination service ID to 1, and creating an initial batch of 16000 packets (increasing the packet count from the default 128 is especially important if you run a chain of multiple NFs):
162163

163-
`./examples/speed_tester/go.sh 5 1 1 -c 16000`
164+
```sh
165+
cd examples/speed_tester
166+
./go.sh 1 -d 1 -c 16000
167+
```
164168

165169
Once the NF's initialization is completed, you should see the NF display how many packets it is sending to itself. Go back to the manager to verify that `NF 1` is receiving data. If this is the case, the openNetVM is working correctly.
166170

0 commit comments

Comments
 (0)