Migrate ALTO user docs to rst
[docs.git] / manuals / user-guide / src / main / asciidoc / ovsdb / odl-ovs-dpdk-user-guide.adoc
1 ==== Using OVS with DPDK hosts and OVSDB NetVirt
2
3 The Data Plane Development Kit (http://dpdk.org/[DPDK]) is a userspace set
4 of libraries and drivers designed for fast packet processing.  The userspace
5 datapath variant of OVS can be built with DPDK enabled to provide the
6 performance features of DPDK to Open vSwitch (OVS).  In the 2.4.0 version of OVS, the
7 Open_vSwtich table schema was enhanced to include the lists 'datapath-types' and
8 'interface-types'.  When the OVS with DPDK variant of OVS is running, the
9 'inteface-types' list will include DPDK interface types such as 'dpdk' and 'dpdkvhostuser'.
10 The OVSDB Southbound Plugin includes this information in the OVSDB YANG model
11 in the MD-SAL, so when a specific OVS host is running OVS with DPDK, it is possible
12 for NetVirt to detect that information by checking that DPDK interface types are
13 included in the list of supported interface types.
14
15 For example, query the operational MD-SAL for OVSDB nodes:
16
17 HTTP GET:
18
19  http://{{CONTROLLER-IP}}:8181/restconf/operational/network-topology:network-topology/topology/ovsdb:1/
20
21 Result Body:
22
23  {
24    "topology": [
25      {
26        "topology-id": "ovsdb:1",
27        "node": [
28          < content edited out >
29          {
30            "node-id": "ovsdb://uuid/f9b58b6d-04db-459a-b914-fff82b738aec",
31            < content edited out >
32            "ovsdb:interface-type-entry": [
33              {
34                "interface-type": "ovsdb:interface-type-ipsec-gre"
35              },
36              {
37                "interface-type": "ovsdb:interface-type-internal"
38              },
39              {
40                "interface-type": "ovsdb:interface-type-system"
41              },
42              {
43                "interface-type": "ovsdb:interface-type-patch"
44              },
45              {
46                "interface-type": "ovsdb:interface-type-dpdkvhostuser"
47              },
48              {
49                "interface-type": "ovsdb:interface-type-dpdk"
50              },
51              {
52                "interface-type": "ovsdb:interface-type-dpdkr"
53              },
54              {
55                "interface-type": "ovsdb:interface-type-vxlan"
56              },
57              {
58                "interface-type": "ovsdb:interface-type-lisp"
59              },
60              {
61                "interface-type": "ovsdb:interface-type-geneve"
62              },
63              {
64                "interface-type": "ovsdb:interface-type-gre"
65              },
66              {
67                "interface-type": "ovsdb:interface-type-tap"
68              },
69              {
70                "interface-type": "ovsdb:interface-type-stt"
71              }
72            ],
73            < content edited out >
74            "ovsdb:datapath-type-entry": [
75              {
76                "datapath-type": "ovsdb:datapath-type-netdev"
77              },
78              {
79                "datapath-type": "ovsdb:datapath-type-system"
80              }
81            ],
82            < content edited out >
83          },
84          < content edited out >
85        ]
86      }
87    ]
88  }
89
90 This example illustrates the output of an OVS with DPDK host because
91 the list of interface types includes types supported by DPDK.
92
93 Bridges on OVS with DPDK hosts need to be created with the 'netdev' datapath type
94 and DPDK specific ports need to be created with the appropriate interface type.
95 The OpenDaylight OVSDB Southbound Plugin supports these attributes.
96
97 The OpenDaylight NetVirt application checks whether the OVS host is using OVS with DPDK
98 when creating the bridges that are expected to be present on the host, e.g. 'br-int'.
99
100 Following are some tips for supporting hosts using OVS with DPDK when using NetVirt as the Neutron service
101 provider and 'devstack' to deploy Openstack.
102
103 In addition to the 'networking-odl' ML2 plugin, enable the 'networking-odl-dpdk' plugin in 'local.conf'.
104
105  For working with Openstack Liberty
106  enable_plugin networking-odl https://github.com/FedericoRessi/networking-odl integration/liberty
107  enable_plugin networking-ovs-dpdk https://github.com/openstack/networking-ovs-dpdk stable/liberty
108
109  For working with Openstack Mitaka (or later) branch
110  enable_plugin networking-odl https://github.com/openstack/networking-odl
111  enable_plugin networking-ovs-dpdk https://github.com/openstack/networking-ovs-dpdk
112
113 The order of these plugin lines is important.  The 'networking-odl' plugin will install and
114 setup 'openvswitch'.  The 'networking-ovs-dpdk' plugin will install OVS with DPDK.  Note, the 'networking-ovs-dpdk'
115 plugin is only being used here to setup OVS with DPDK.  The 'networking-odl' plugin will be used as the Neutron ML2 driver.
116
117 For VXLAN tenant network support, the NetVirt application interacts with OVS with DPDK host in the same way as OVS hosts
118 using the kernel datapath by creating VXLAN ports on 'br-int' to communicate with other tunnel endpoints.  The IP address
119 for the local tunnel endpoint may be configured in the 'local.conf' file.  For example:
120
121  ODL_LOCAL_IP=192.100.200.10
122
123 NetVirt will use this information to configure the VXLAN port on 'br-int'.  On a host with the OVS kernel datapath, it
124 is expected that there will be a networking interface configured with this IP address.  On an OVS with DPDK host, an OVS
125 bridge is created and a DPDK port is added to the bridge.  The local tunnel endpoint address is then assigned to the
126 bridge port of the bridge.  So, for example, if the physical network interface is associated with 'eth0' on the host,
127 a bridge named 'br-eth0' could be created.  The DPDK port, such as 'dpdk0' (per the naming conventions of OVS with DPDK), is
128 added to bridge 'br-eth0'.  The local tunnel endpoint address is assigned to the network interface 'br-eth0' which is
129 attached to bridge 'br-eth0'.  All of this setup is not done by NetVirt.  The 'networking-ovs-dpdk' can be made to
130 perform this setup by putting configuration like the following in 'local.conf'.
131
132  ODL_LOCAL_IP=192.168.200.9
133  ODL_PROVIDER_MAPPINGS=physnet1:eth0,physnet2:eht1
134  OVS_DPDK_PORT_MAPPINGS=eth0:br-eth0,eth1:br-ex
135  OVS_BRIDGE_MAPPINGS=physnet1:br-eth0,physnet2:br-ex
136
137 The above settings associate the host networking interface 'eth0' with bridge 'br-eth0'.  The 'networking-ovs-dpdk' plugin
138 will determine the DPDK port name associated with 'eth0' and add it to the bridge 'br-eth0'.  If using the NetVirt L3 support,
139 these settings will enable setup of the 'br-ex' bridge and attach the DPDK port associated with network interface 'eth1' to it.
140
141 The following settings are included in 'local.conf' to specify specific attributes associated with OVS with DPDK.  These are
142 used by the 'networking-ovs-dpdk' plugin to configure OVS with DPDK.
143
144  OVS_DATAPATH_TYPE=netdev
145  OVS_NUM_HUGEPAGES=8192
146  OVS_DPDK_MEM_SEGMENTS=8192
147  OVS_HUGEPAGE_MOUNT_PAGESIZE=2M
148  OVS_DPDK_RTE_LIBRTE_VHOST=y
149  OVS_DPDK_MODE=compute
150
151 Once the stack is up and running virtual machines may be deployed on OVS with DPDK hosts.  The 'networking-odl' plugin handles
152 ensuring that 'dpdkvhostuser' interfaces are utilized by Nova instead of the default 'tap' interface.  The 'dpdkvhostuser' interface
153 provides the best performance for VMs on OVS with DPDK hosts.
154
155 A Nova flavor is created for VMs that may be deployed on OVS with DPDK hosts.
156
157  nova flavor-create largepage-flavor 1002 1024 4 1
158  nova flavor-key 1002 set "hw:mem_page_size=large"
159
160 Then, just specify the flavor when creating a VM.
161
162  nova boot --flavor largepage-flavor --image cirros-0.3.4-x86_64-uec --nic net-id=<NET ID VALUE> vm-name