Setting up onvm - rohit-mp/onvm-qos GitHub Wiki
Note: When I wrote this, just following their Install.md
gave me errors. But now, it seems to work fine for me. Will try to update on what the issue was soon.
These steps are what worked for me on ubuntu-18.04.
Check if your system has a NIC supported by Intel DPDK. Run
lspci | awk '/[nN]et/ {print $1}' | xargs -i% lspci -ks %
and check if your NIC is present in the list of supported NICs. If it isn't present, you'll need to setup a Virtual Machine and continue.
Then we need to install few packages:
sudo apt-get update
sudo apt-get install build-essential linux-headers-$(uname -r) git libpcap-dev pkg-config net-tools
sudo apt-get install libnuma-dev
Now your system should be ready to setup the rest of the stuff.
Clone the DPDK repository by
git clone https://github.com/DPDK/dpdk.git
openNetVM works with DPDK 8.11, so checkout to that version and then set up dpdk.
cd dpdk
git checkout -b v18.11 v18.11
echo export RTE_SDK=$(pwd) >> ~/.bashrc
echo export RTE_TARGET=x86_64-native-linuxapp-gcc >> ~/.bashrc
source ~/.bashrc
./usertools/dpdk-setup.sh
Here, we'll need to provide the options to setup dpdk:
- Press [15] to compile x86_64-native-linuxapp-gcc version
- Press [18] to install igb_uio driver for Intel NICs
- Press [21] or [22] based on your system and setup 1024 2MB hugepages
To check if NUMA: https://stackoverflow.com/a/11126243 - Press [35] to quit the tool
With that done,
make config T=$RTE_TARGET
sed -ri 's,(PMD_PCAP=).*,\1y,' build/.config
make T=$RTE_TARGET
make examples T=$RTE_TARGET #optional
At this point, dpdk should be setup and you can try running any example to test it out.
Next, we clone openNetVM by
git clone https://github.com/sdnfv/openNetVM
cd openNetVM
Now, we remove the dpdk folder present and create a link to the dpdk repository we set up earlier.
rm dpdk/ -r
ln -s /path/to/dpdk .
Then a few commands to help setup openNetVM
echo export ONVM_HOME=$(pwd) >> ~/.bashrc
echo export ONVM_NUM_HUGEPAGES=1024 >> ~/.bashrc
source ~/.bashrc
sudo sh -c "echo 0 > /proc/sys/kernel/randomize_va_space"
Another thing left to do is binding the NIC to DPDK driver. You can check point 3 of troubleshooting to bind existing NIC port or if you're using a VM, you can change the settings of the VM by adding another Network Adapter and then following the instructions in point 3 of troubleshooting [bind the newly added NIC port to the DPDK drivers].
You will need to bind the NIC everytime the system reboots, and to take care of that, use
export ONVM_NIC_PCI=" 02:02.0 "
and run setup_environment.sh
after every boot to setup the required environment. You could also put the export statement in your .bashrc
.
[Note that the NIC port number above will change from system to system and you should bind the port in your system as done in the previous step.]
And then the rest can be followed from here
[Make sure to use proper portmask and coremask for your system while running onvm manager and examples]