licenses: Add license headers
[ovsnfv.git] / fuel-plugin-ovsnfv / deployment_scripts / puppet / modules / ovsdpdk / manifests / init.pp
1 # Copyright (c) 2016 Open Platform for NFV Project, Inc. and its contributors
2 #
3 #    Licensed under the Apache License, Version 2.0 (the "License");
4 #    you may not use this file except in compliance with the License.
5 #    You may obtain a copy of the License at
6 #
7 #        http://www.apache.org/licenses/LICENSE-2.0
8 #
9 #    Unless required by applicable law or agreed to in writing, software
10 #    distributed under the License is distributed on an "AS IS" BASIS,
11 #    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 #    See the License for the specific language governing permissions and
13 #    limitations under the License.
14
15 # == Class: ovsdpdk
16 #
17 # Configures and installs OVS with DPDK support service
18 #
19 # == Parameters:
20 #
21 # [*rte_target*]
22 #   rte_target to compile OVS DPDK
23 #   Defaults to 'x86_64-native-linuxapp-gcc'
24 #
25 # [*ovs_dpdk_mem_segments*]
26 #   another parameter for OVS DPDK build
27 #   Defaults to '256'
28 #
29 # [*ovs_dpdk_rte_librte_vhost*]
30 #   another parameter for OVS DPDK build
31 #   Defaults to 'y'
32 #
33 # [*ovs_dpdk_vhost_user_debug*]
34 #   (True/False) indicates whether to enable debugging for VHOST USER in DPDK
35 #   Defaults to 'n'
36 #
37 # [*ovs_allocate_hugepages*]
38 #   (True/False) indicates whether to allocate hugepages during ovs-dpdk startup
39 #   Defaults to 'True'
40 #
41 # [*ovs_datapath_type*]
42 #   OVS bridges will be set to use this datapath, possible values are 'system'
43 #   for kernel OVS and 'netdev' for userspace OVS
44 #   Defaults to 'netdev'
45 #
46 # [*ovs_tunnel_cidr_mapping*]
47 #   (bridge:cidr) when specified, this option enables automatic assignment of
48 #   the tunnel endpoint ip to a specific interface.
49 #   e.g. OVS_TUNNEL_CIDR_MAPPING=br-phy:192.168.50.1/24 assignes the ip of
50 #   192.168.50.1 with subnetmask 255.255.255.0 to the br-phy local port.
51 #   This is required to enabled vxlan or other tunneling protocols with ovs-dpdk
52 #   and dpdk physical ports.
53 #
54 # [*ovs_hugepage_mount*]
55 #   mount point to use for hugepages. It's created and hugepages mounted if
56 #   it doesn't exist on the filesystem
57 #   Defaults to '/mnt/huge'
58 #
59 # [*ovs_hugepage_mount_pagesize*]
60 #   preffered hugepage size (2M/1G)
61 #   Defaults to OS defaults if not set. If '1G' value is used hugepages should be
62 #   allocated before starting ovs (e.g. kernel boot command line)
63 #
64 # [*ovs_num_hugepages*]
65 #   amount of hugepages to mount if ovs_allocate_hugepages is True
66 #
67 # [*ovs_socket_mem*]
68 #   amount of memory to allocate on socket, recommended minimum is '512' MB
69 #
70 # [*ovs_mem_channels*]
71 #   number of memory channels into the processor OVS will use
72 #
73 # [*ovs_core_mask*]
74 #   cpu core mask in hexa format, is used for ovs-vswitchd process as -c option
75 #   Defaults is '2'
76 #   Example:
77 #   ovs_core_mask=3 (0x11 binary -> first two cores taken)
78 #
79 # [*ovs_pmd_core_mask*]
80 #   mask in hexa format for PMD threads od OVS set in the db.
81 #   ovs_pmd_core_mask value is used for other_config:pmd-cpu-mask parameter in
82 #   ovsdb.
83 #   Defaults is '4'. In case of HT enabled, it's 4 + sibling
84 #
85 # [*ovs_bridge_mappings*]
86 #   (network:bridge) list of comma separated pairs of "physical network:bridge"
87 #   used by OVS/DPDK.
88 #   Example: ovs_bridge_mappings=default:br-eth1,defaul1:br-enp9s0f0
89 #
90 # [*ovs_dpdk_port_mappings*]
91 #   (nic:bridge) list of comma separated pairs of "nic:bridge name" used by
92 #   OVS/DPDK. "nic" must be a NIC interface present in the system
93 #   "bridge" is the linux bridge created by OVS
94 #   Example: ovs_dpdk_port_mappings=eth1:br-01,eth2:br02
95 #
96 # [*ovs_log_dir*]
97 #   directory where ovs-vswitchd.log will be created
98 #   Defaults: "/tmp"
99 #
100 # [*ovs_lock_dir*]
101 #   directory containing OVS lock file
102 #
103 # [*ovs_interface_driver*]
104 #   (vfio-pci/igb_uio) NIC driver to use for physical network interfaces.
105 #   Drivers names are the ones supported by DPDK, i.e: not the kernel names.
106 #   Defaults: "igb_uio"
107 #
108 # [*ovs_patches*]
109 #   *todo*
110 #
111 # [*ovs_dpdk_patches*]
112 #   *todo*
113 #
114 class ovsdpdk (
115   $rte_target                  = 'x86_64-native-linuxapp-gcc',
116   $ovs_dpdk_mem_segments       = '256',
117   $ovs_dpdk_rte_librte_vhost   = 'y',
118   $ovs_dpdk_vhost_user_debug   = 'n',
119   $ovs_allocate_hugepages      = 'True',
120   $ovs_datapath_type           = 'netdev',
121   $ovs_tunnel_cidr_mapping     = '',
122   $ovs_hugepage_mount          = '/mnt/huge',
123   $ovs_hugepage_mount_pagesize = '2M',
124   $ovs_num_hugepages           = '1024',
125   $ovs_socket_mem              = 'auto',
126   $ovs_mem_channels            = '4',
127   $ovs_core_mask               = '2',
128   $ovs_pmd_core_mask           = '4',
129   $ovs_bridge_mappings         = '',
130   $ovs_dpdk_port_mappings      = '',
131   $ovs_log_dir                 = '/tmp',
132   $ovs_lock_dir                = '',
133   $ovs_interface_driver        = 'igb_uio',
134   $ovs_patches                 = '',
135   $ovs_dpdk_patches            = '',
136   $controller                  = 'False',
137   $compute                     = 'False',
138 ) inherits ::ovsdpdk::params {
139
140   include '::ovsdpdk::clone'
141   include '::ovsdpdk::uninstall_ovs'
142   include '::ovsdpdk::build_ovs_dpdk'
143   include '::ovsdpdk::install_ovs_dpdk'
144   include '::ovsdpdk::postinstall_ovs_dpdk'
145 }