[fdio] Bump VPP to 19.08.1-release
[fuel.git] / mcp / patches / salt-formula-linux / 0002-network-Bring-in-basic-VPP-support.patch
1 ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
2 : Copyright (c) 2019 Mirantis Inc., Enea AB and others.
3 :
4 : All rights reserved. This program and the accompanying materials
5 : are made available under the terms of the Apache License, Version 2.0
6 : which accompanies this distribution, and is available at
7 : http://www.apache.org/licenses/LICENSE-2.0
8 ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
9 From: Alexandru Avadanii <Alexandru.Avadanii@enea.com>
10 Date: Mon, 10 Dec 2018 16:16:26 +0100
11 Subject: [PATCH] network: Bring in basic VPP support
12
13 For now, we only care about DPDK-backed VPP ports.
14
15 TODO:
16 - README.rst: VPP port usage
17
18 Signed-off-by: Alexandru Avadanii <Alexandru.Avadanii@enea.com>
19 ---
20  linux/files/vpp_commands.txt |  4 +++
21  linux/files/vpp_startup.conf | 47 ++++++++++++++++++++++++++++++++++++
22  linux/network/dpdk.sls       | 38 +++++++++++++++++++++++++++++
23  3 files changed, 89 insertions(+)
24  create mode 100644 linux/files/vpp_commands.txt
25  create mode 100644 linux/files/vpp_startup.conf
26
27 diff --git a/linux/files/vpp_commands.txt b/linux/files/vpp_commands.txt
28 new file mode 100644
29 index 0000000..2ce4726
30 --- /dev/null
31 +++ b/linux/files/vpp_commands.txt
32 @@ -0,0 +1,4 @@
33 +{%- from "linux/map.jinja" import network with context %}
34 +{%- if network.vpp.commands is defined %}
35 +{{ network.vpp.commands }}
36 +{%- endif %}
37 diff --git a/linux/files/vpp_startup.conf b/linux/files/vpp_startup.conf
38 new file mode 100644
39 index 0000000..fcfc1fd
40 --- /dev/null
41 +++ b/linux/files/vpp_startup.conf
42 @@ -0,0 +1,47 @@
43 +{%- from "linux/map.jinja" import network with context %}
44 +unix {
45 +  cli-listen /run/vpp/cli.sock
46 +  log /var/log/vpp.log
47 +  full-coredump
48 +  nodaemon
49 +  startup-config /etc/vpp/commands.txt
50 +{%- if network.vpp.gid is defined %}
51 +  gid {{ network.vpp.gid }}
52 +{%- endif %}
53 +}
54 +api-trace {
55 +  on
56 +}
57 +{%- if network.vpp.gid is defined %}
58 +api-segment {
59 +  gid {{ network.vpp.gid }}
60 +}
61 +{%- endif %}
62 +cpu {
63 +{%- if network.vpp.main_core is defined %}
64 +  main-core {{ network.vpp.main_core }}
65 +{%- endif %}
66 +{%- if network.vpp.corelist_workers is defined %}
67 +  corelist-workers {{ network.vpp.corelist_workers }}
68 +{%- endif %}
69 +{%- if network.vpp.skip_core is defined %}
70 +  skip-core {{ network.vpp.skip_core }}
71 +{%- endif %}
72 +{%- if network.vpp.workers is defined %}
73 +  workers {{ network.vpp.workers }}
74 +{%- endif %}
75 +}
76 +dpdk {
77 +{%- if network.vpp.decimal_interface_names is defined %}
78 +  decimal-interface-names
79 +{%- endif %}
80 +{%- if network.vpp.dpdk_socket_mem is defined %}
81 +  socket-mem {{ network.vpp.dpdk_socket_mem }}
82 +{%- endif %}
83 +  ## Whitelist specific interface by specifying PCI address
84 +{%- for interface_name, interface in network.interface.items() %}
85 +{%- if 'dpdk_vpp_port' in interface.type and interface.pci is defined %}
86 +  dev {{ interface.pci }}
87 +{%- endif %}
88 +{%- endfor %}
89 +}
90 diff --git a/linux/network/dpdk.sls b/linux/network/dpdk.sls
91 index 786f7c8..09453c6 100644
92 --- a/linux/network/dpdk.sls
93 +++ b/linux/network/dpdk.sls
94 @@ -32,6 +32,45 @@ linux_network_dpdk_service:
95    - watch:
96      - file: /etc/dpdk/interfaces
97
98 +{%- if network.vpp is defined %}
99 +
100 +vpp_pkgs:
101 +  pkg.installed:
102 +  - pkgs:
103 +    - vpp
104 +    - vpp-plugin-core
105 +    - vpp-plugin-dpdk
106 +    - bridge-utils
107 +
108 +/etc/vpp/commands.txt:
109 +  file.managed:
110 +    - source: salt://linux/files/vpp_commands.txt
111 +    - template: jinja
112 +    - require:
113 +      - pkg: vpp_pkgs
114 +
115 +/etc/vpp/startup.conf:
116 +  file.managed:
117 +    - source: salt://linux/files/vpp_startup.conf
118 +    - template: jinja
119 +    - require:
120 +      - pkg: vpp_pkgs
121 +
122 +/etc/sysctl.d/80-vpp.conf:
123 +  file.managed:
124 +    - contents:
125 +      - '# Disabled by salt-formula-linux'
126 +
127 +linux_network_vpp_service:
128 +  service.running:
129 +  - enable: true
130 +  - name: vpp
131 +  - watch:
132 +    - file: /etc/vpp/startup.conf
133 +    - file: /etc/vpp/commands.txt
134 +
135 +{%- endif %}
136 +
137  {%- if network.openvswitch is defined %}
138
139  openvswitch_dpdk_pkgs: