Hyunsun Moon | 06f9855 | 2019-08-15 13:44:47 -0600 | [diff] [blame] | 1 | {{/* |
| 2 | Copyright 2019-present Open Networking Foundation |
| 3 | Copyright 2019 Intel Corporation |
| 4 | |
| 5 | Licensed under the Apache License, Version 2.0 (the "License"); |
| 6 | you may not use this file except in compliance with the License. |
| 7 | You may obtain a copy of the License at |
| 8 | |
| 9 | http://www.apache.org/licenses/LICENSE-2.0 |
| 10 | |
| 11 | Unless required by applicable law or agreed to in writing, software |
| 12 | distributed under the License is distributed on an "AS IS" BASIS, |
| 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 14 | See the License for the specific language governing permissions and |
| 15 | limitations under the License. |
| 16 | */}} |
Hyunsun Moon | c4a7d54 | 2019-08-22 18:53:40 -0500 | [diff] [blame] | 17 | |
Hyunsun Moon | a24d3f9 | 2019-06-19 03:04:58 -0500 | [diff] [blame] | 18 | --- |
| 19 | apiVersion: v1 |
| 20 | kind: ConfigMap |
| 21 | metadata: |
Hyunsun Moon | 06f9855 | 2019-08-15 13:44:47 -0600 | [diff] [blame] | 22 | name: spgwu |
| 23 | labels: |
Hyunsun Moon | 7a007bb | 2019-08-19 16:41:36 -0600 | [diff] [blame] | 24 | {{ tuple "spgwu" . | include "omec-data-plane.metadata_labels" | indent 4 }} |
Hyunsun Moon | a24d3f9 | 2019-06-19 03:04:58 -0500 | [diff] [blame] | 25 | data: |
| 26 | dp_config.cfg: | |
| 27 | if [ ! -d "/dev/hugepages" ]; then |
| 28 | MEMORY="--no-huge -m $((MEM_LIMIT-1024))" |
| 29 | fi |
Hyunsun Moon | a24d3f9 | 2019-06-19 03:04:58 -0500 | [diff] [blame] | 30 | CORES="-c $(taskset -p $$ | awk '{print $NF}')" |
Hyunsun Moon | 7a921d1 | 2019-08-21 20:52:09 -0500 | [diff] [blame] | 31 | EAL_ARGS="${CORES} ${MEMORY} {{ .Values.config.spgwu.devices }}" |
Hyunsun Moon | a24d3f9 | 2019-06-19 03:04:58 -0500 | [diff] [blame] | 32 | |
Hyunsun Moon | 7a921d1 | 2019-08-21 20:52:09 -0500 | [diff] [blame] | 33 | {{- if .Values.config.sriov.enabled }} |
| 34 | S1U_DEVNAME={{ .Values.config.spgwu.s1u.device }} |
| 35 | {{- else }} |
| 36 | S1U_DEVNAME={{ .Values.config.spgwu.s1u.device }}-veth |
| 37 | {{- end }} |
| 38 | {{- if .Values.config.sriov.enabled }} |
| 39 | SGI_DEVNAME={{ .Values.config.spgwu.sgi.device }} |
| 40 | {{- else }} |
| 41 | SGI_DEVNAME={{ .Values.config.spgwu.sgi.device }}-veth |
| 42 | {{- end }} |
| 43 | |
Hyunsun Moon | a24d3f9 | 2019-06-19 03:04:58 -0500 | [diff] [blame] | 44 | S1U_IP=$(ip -4 addr show dev ${S1U_DEVNAME} | grep -oP '(?<=inet\s)\d+(\.\d+){3}') |
| 45 | SGI_IP=$(ip -4 addr show dev ${SGI_DEVNAME} | grep -oP '(?<=inet\s)\d+(\.\d+){3}') |
| 46 | S1U_MAC=$(ip addr show dev ${S1U_DEVNAME} | awk '$1=="link/ether"{print $2}') |
| 47 | SGI_MAC=$(ip addr show dev ${SGI_DEVNAME} | awk '$1=="link/ether"{print $2}') |
Hyunsun Moon | 7a921d1 | 2019-08-21 20:52:09 -0500 | [diff] [blame] | 48 | |
Hyunsun Moon | a24d3f9 | 2019-06-19 03:04:58 -0500 | [diff] [blame] | 49 | S1U="--s1u_ip ${S1U_IP} --s1u_mac ${S1U_MAC} --ul_iface ${S1U_DEVNAME}" |
Hyunsun Moon | 7a921d1 | 2019-08-21 20:52:09 -0500 | [diff] [blame] | 50 | SGI="--sgi_ip ${SGI_IP} --sgi_mac ${SGI_MAC} --dl_iface ${SGI_DEVNAME} --sgi_gw_ip {{ .Values.networks.sgi.gateway }} --sgi_mask {{ .Values.networks.sgi.mask }}" |
Hyunsun Moon | a24d3f9 | 2019-06-19 03:04:58 -0500 | [diff] [blame] | 51 | MISC="--log 1" |
Hyunsun Moon | 7a921d1 | 2019-08-21 20:52:09 -0500 | [diff] [blame] | 52 | SPGW_CFG="--spgw_cfg 03" |
| 53 | |
Hyunsun Moon | a24d3f9 | 2019-06-19 03:04:58 -0500 | [diff] [blame] | 54 | APP_ARGS="${S1U} ${SGI} ${MISC} ${SPGW_CFG}" |
| 55 | cdr.cfg: | |
| 56 | CDR_PATH=./cdr |
| 57 | MASTER_CDR=./cdr/master.csv |
| 58 | interface.cfg: | |
| 59 | [0] |
| 60 | dp_comm_ip = DP_ADDR |
| 61 | dp_comm_port = 20 |
Hyunsun Moon | c4a7d54 | 2019-08-22 18:53:40 -0500 | [diff] [blame] | 62 | cp_comm_ip = {{ .Values.config.spgwu.cpComm.addr }} |
| 63 | cp_comm_port = {{ .Values.config.spgwu.cpComm.port }} |
Hyunsun Moon | 7a007bb | 2019-08-19 16:41:36 -0600 | [diff] [blame] | 64 | {{- if not .Values.config.sriov.enabled }} |
Hyunsun Moon | a24d3f9 | 2019-06-19 03:04:58 -0500 | [diff] [blame] | 65 | setup-af-iface.sh: | |
Hyunsun Moon | 7a007bb | 2019-08-19 16:41:36 -0600 | [diff] [blame] | 66 | {{ tuple "bin/_spgwu-setup-af-iface.sh.tpl" . | include "omec-data-plane.template" | indent 4 }} |
Hyunsun Moon | a24d3f9 | 2019-06-19 03:04:58 -0500 | [diff] [blame] | 67 | {{- end }} |
Hyunsun Moon | 06f9855 | 2019-08-15 13:44:47 -0600 | [diff] [blame] | 68 | run.sh: | |
Hyunsun Moon | 7a007bb | 2019-08-19 16:41:36 -0600 | [diff] [blame] | 69 | {{ tuple "bin/_spgwu-run.sh.tpl" . | include "omec-data-plane.template" | indent 4 }} |