1 ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
2 : Copyright (c) 2019 Mirantis Inc., Enea AB and others.
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
13 For now, we only care about DPDK-backed VPP ports.
16 - README.rst: VPP port usage
18 Signed-off-by: Alexandru Avadanii <Alexandru.Avadanii@enea.com>
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
27 diff --git a/linux/files/vpp_commands.txt b/linux/files/vpp_commands.txt
29 index 0000000..2ce4726
31 +++ b/linux/files/vpp_commands.txt
33 +{%- from "linux/map.jinja" import network with context %}
34 +{%- if network.vpp.commands is defined %}
35 +{{ network.vpp.commands }}
37 diff --git a/linux/files/vpp_startup.conf b/linux/files/vpp_startup.conf
39 index 0000000..fcfc1fd
41 +++ b/linux/files/vpp_startup.conf
43 +{%- from "linux/map.jinja" import network with context %}
45 + cli-listen /run/vpp/cli.sock
46 + log /var/log/vpp.log
49 + startup-config /etc/vpp/commands.txt
50 +{%- if network.vpp.gid is defined %}
51 + gid {{ network.vpp.gid }}
57 +{%- if network.vpp.gid is defined %}
59 + gid {{ network.vpp.gid }}
63 +{%- if network.vpp.main_core is defined %}
64 + main-core {{ network.vpp.main_core }}
66 +{%- if network.vpp.corelist_workers is defined %}
67 + corelist-workers {{ network.vpp.corelist_workers }}
69 +{%- if network.vpp.skip_core is defined %}
70 + skip-core {{ network.vpp.skip_core }}
72 +{%- if network.vpp.workers is defined %}
73 + workers {{ network.vpp.workers }}
77 +{%- if network.vpp.decimal_interface_names is defined %}
78 + decimal-interface-names
80 +{%- if network.vpp.dpdk_socket_mem is defined %}
81 + socket-mem {{ network.vpp.dpdk_socket_mem }}
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 }}
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:
96 - file: /etc/dpdk/interfaces
98 +{%- if network.vpp is defined %}
108 +/etc/vpp/commands.txt:
110 + - source: salt://linux/files/vpp_commands.txt
115 +/etc/vpp/startup.conf:
117 + - source: salt://linux/files/vpp_startup.conf
122 +/etc/sysctl.d/80-vpp.conf:
125 + - '# Disabled by salt-formula-linux'
127 +linux_network_vpp_service:
132 + - file: /etc/vpp/startup.conf
133 + - file: /etc/vpp/commands.txt
137 {%- if network.openvswitch is defined %}
139 openvswitch_dpdk_pkgs: