]>
Commit | Line | Data |
---|---|---|
8a9562d2 PS |
1 | Using Open vSwitch with DPDK |
2 | ============================ | |
3 | ||
4 | Open vSwitch can use Intel(R) DPDK lib to operate entirely in | |
5 | userspace. This file explains how to install and use Open vSwitch in | |
6 | such a mode. | |
7 | ||
8 | The DPDK support of Open vSwitch is considered experimental. | |
9 | It has not been thoroughly tested. | |
10 | ||
11 | This version of Open vSwitch should be built manually with "configure" | |
12 | and "make". | |
13 | ||
14 | Building and Installing: | |
15 | ------------------------ | |
16 | ||
17 | Recommended to use DPDK 1.6. | |
18 | ||
19 | DPDK: | |
20 | cd DPDK | |
21 | update config/defconfig_x86_64-default-linuxapp-gcc so that dpdk generate single lib file. | |
22 | CONFIG_RTE_BUILD_COMBINE_LIBS=y | |
23 | ||
24 | make install T=x86_64-default-linuxapp-gcc | |
25 | For details refer to http://dpdk.org/ | |
26 | ||
27 | Linux kernel: | |
28 | Refer to intel-dpdk-getting-started-guide.pdf for understanding | |
29 | DPDK kernel requirement. | |
30 | ||
31 | OVS: | |
32 | cd $(OVS_DIR)/openvswitch | |
33 | ./boot.sh | |
34 | ./configure --with-dpdk=$(DPDK_BUILD) | |
35 | make | |
36 | ||
37 | Refer to INSTALL.userspace for general requirements of building | |
38 | userspace OVS. | |
39 | ||
40 | Using the DPDK with ovs-vswitchd: | |
41 | --------------------------------- | |
42 | ||
43 | First setup DPDK devices: | |
44 | - insert uio.ko | |
45 | - insert igb_uio.ko | |
46 | e.g. insmod DPDK/x86_64-default-linuxapp-gcc/kmod/igb_uio.ko | |
47 | - mount hugetlbfs | |
48 | e.g. mount -t hugetlbfs -o pagesize=1G none /mnt/huge/ | |
49 | - Bind network device to ibg_uio. | |
50 | e.g. DPDK/tools/pci_unbind.py --bind=igb_uio eth1 | |
51 | ||
52 | Ref to http://www.dpdk.org/doc/quick-start for verifying DPDK setup. | |
53 | ||
54 | Start vswitchd: | |
55 | DPDK configuration arguments can be passed to vswitchd via `--dpdk` | |
56 | argument. dpdk arg -c is ignored by ovs-dpdk, but it is required parameter | |
57 | for dpdk initialization. | |
58 | ||
59 | e.g. | |
60 | ./vswitchd/ovs-vswitchd --dpdk -c 0x1 -n 4 -- unix:$DB_SOCK --pidfile --detach | |
61 | ||
62 | To use ovs-vswitchd with DPDK, create a bridge with datapath_type | |
63 | "netdev" in the configuration database. For example: | |
64 | ||
65 | ovs-vsctl add-br br0 | |
66 | ovs-vsctl set bridge br0 datapath_type=netdev | |
67 | ||
68 | Now you can add dpdk devices. OVS expect DPDK device name start with dpdk | |
69 | and end with portid. vswitchd should print number of dpdk devices found. | |
70 | ||
71 | ovs-vsctl add-port br0 dpdk0 -- set Interface dpdk0 type=dpdk | |
72 | ||
73 | Once first DPDK port is added vswitchd, it creates Polling thread and | |
74 | polls dpdk device in continuous loop. Therefore CPU utilization | |
75 | for that thread is always 100%. | |
76 | ||
77 | Restrictions: | |
78 | ------------- | |
79 | ||
80 | - This Support is for Physical NIC. I have tested with Intel NIC only. | |
81 | - vswitchd userspace datapath does affine polling thread but it is | |
82 | assumed that devices are on numa node 0. Therefore if device is | |
83 | attached to non zero numa node switching performance would be | |
84 | suboptimal. | |
85 | - There are fixed number of polling thread and fixed number of per | |
86 | device queues configured. | |
87 | - Work with 1500 MTU, needs few changes in DPDK lib to fix this issue. | |
88 | - Currently DPDK port does not make use any offload functionality. | |
89 | ||
90 | Bug Reporting: | |
91 | -------------- | |
92 | ||
93 | Please report problems to bugs@openvswitch.org. |