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 | 44 ++++++++++++++++++++++++++++++++++++
22 linux/network/dpdk.sls | 38 +++++++++++++++++++++++++++++++
23 3 files changed, 86 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..d66ecd3
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.dpdk_socket_mem is defined %}
78 + socket-mem {{ network.vpp.dpdk_socket_mem }}
80 + ## Whitelist specific interface by specifying PCI address
81 +{%- for interface_name, interface in network.interface.items() %}
82 +{%- if 'dpdk_vpp_port' in interface.type and interface.pci is defined %}
83 + dev {{ interface.pci }}
87 diff --git a/linux/network/dpdk.sls b/linux/network/dpdk.sls
88 index 786f7c8..09453c6 100644
89 --- a/linux/network/dpdk.sls
90 +++ b/linux/network/dpdk.sls
91 @@ -32,6 +32,44 @@ linux_network_dpdk_service:
93 - file: /etc/dpdk/interfaces
95 +{%- if network.vpp is defined %}
104 +/etc/vpp/commands.txt:
106 + - source: salt://linux/files/vpp_commands.txt
111 +/etc/vpp/startup.conf:
113 + - source: salt://linux/files/vpp_startup.conf
118 +/etc/sysctl.d/80-vpp.conf:
121 + - '# Disabled by salt-formula-linux'
123 +linux_network_vpp_service:
128 + - file: /etc/vpp/startup.conf
129 + - file: /etc/vpp/commands.txt
133 {%- if network.openvswitch is defined %}
135 openvswitch_dpdk_pkgs: