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