aboutsummaryrefslogtreecommitdiffstats
path: root/manifests/config.pp
blob: 9f5fc5839c245817972f4dfe3d3e4881080cfdc6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
# == Class fdio::config
#
# This class handles fdio config changes.
#
class fdio::config {

  if $fdio::vpp_dpdk_support {
    # ensure that dpdk module is loaded
    $dpdk_pmd_real = regsubst($fdio::vpp_dpdk_uio_driver, '-', '_', 'G')
    exec { 'insert_dpdk_kmod':
      command => "modprobe ${fdio::vpp_dpdk_uio_driver}",
      unless  => "lsmod | grep ${dpdk_pmd_real}",
      path    => '/bin:/sbin',
    }

    vpp_config {
      'dpdk/dev/default': value => $fdio::vpp_dpdk_dev_default_options;
      'dpdk/uio-driver': value => $fdio::vpp_dpdk_uio_driver;
      'dpdk/socket-mem': value => $fdio::vpp_dpdk_socket_mem;
    }

    fdio::config::vpp_devices {  $fdio::vpp_dpdk_devs: }
  }

  vpp_config {
    'vhost-user/coalesce-frames': value => $fdio::vpp_vhostuser_coalesce_frames;
    'vhost-user/coalesce-time': value => $fdio::vpp_vhostuser_coalesce_time;
    'tuntap/mtu': value => $fdio::vpp_tuntap_mtu;
    'tapcli/mtu': value => $fdio::vpp_tapcli_mtu;
  }

  if $fdio::vpp_vhostuser_dont_dump_memory {
    vpp_config {
      'vhost-user/dont-dump-memory': ensure => present;
    }
  }

  if $fdio::vpp_tuntap_enable != undef {
    if $fdio::vpp_tuntap_enable {
      vpp_config {
        'tuntap/enable': ensure => present;
        'tuntap/disable': ensure => absent;
      }
    }
    else {
      vpp_config {
        'tuntap/enable': ensure => absent;
        'tuntap/disable': ensure => present;
      }
    }
  }

  if !empty($fdio::vpp_exec_commands) {
    file { $fdio::vpp_exec_file:
      ensure => present,
    }
    fdio::config::vpp_exec_line { $fdio::vpp_exec_commands:
      path => $fdio::vpp_exec_file,
    }
    vpp_config {
      'unix/exec': value => $fdio::vpp_exec_file;
    }
  }

  vpp_config {
    'cpu/main-core': value => $fdio::vpp_cpu_main_core;
    'cpu/corelist-workers': value => $fdio::vpp_cpu_corelist_workers;
  }
}