Jeremy Ronquillo | 223db00 | 2020-06-05 10:28:22 -0700 | [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 | */}} |
| 17 | |
| 18 | --- |
| 19 | apiVersion: v1 |
| 20 | kind: ConfigMap |
| 21 | metadata: |
| 22 | name: spgwu |
| 23 | labels: |
| 24 | {{ tuple "spgwu" . | include "omec-data-plane.metadata_labels" | indent 4 }} |
| 25 | data: |
| 26 | dp_config.cfg: | |
| 27 | if [ ! -d "/dev/hugepages" ]; then |
| 28 | MEMORY="--no-huge -m $((MEM_LIMIT-1024))" |
| 29 | fi |
| 30 | CORES="-c $(taskset -p $$ | awk '{print $NF}')" |
| 31 | EAL_ARGS="${CORES} ${MEMORY} {{ .Values.config.spgwu.devices }}" |
| 32 | |
| 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 | |
| 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}') |
| 48 | |
| 49 | S1U="--s1u_ip ${S1U_IP} --s1u_mac ${S1U_MAC} --ul_iface ${S1U_DEVNAME}" |
| 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 }}" |
| 51 | MISC="--log 1" |
| 52 | SPGW_CFG="--spgw_cfg 03" |
| 53 | |
| 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 | zmq_protocol = tcp |
| 61 | dp_comm_ip = DP_ADDR |
| 62 | dp_comm_port = 20 |
| 63 | {{- if .Values.config.spgwu.multiUpfs }} |
| 64 | cp_nb_ip = {{ .Values.config.spgwu.cpComm.addr }} |
| 65 | cp_nb_port = {{ .Values.config.spgwu.cpComm.port }} |
| 66 | cp_comm_ip = {{ .Values.config.spgwu.cpComm.addr }} |
| 67 | cp_comm_port = {{ .Values.config.spgwu.cpComm.port }} |
| 68 | zmq_dp_ip=127.0.0.1 |
| 69 | zmq_cp_ip=127.0.0.1 |
| 70 | {{- else }} |
| 71 | cp_comm_ip = {{ .Values.config.spgwu.cpComm.addr }} |
| 72 | cp_comm_port = {{ .Values.config.spgwu.cpComm.port }} |
| 73 | {{- end }} |
| 74 | {{- if not .Values.config.sriov.enabled }} |
| 75 | setup-af-iface.sh: | |
| 76 | {{ tuple "bin/_spgwu-setup-af-iface.sh.tpl" . | include "omec-data-plane.template" | indent 4 }} |
| 77 | {{- end }} |
| 78 | run.sh: | |
| 79 | {{ tuple "bin/_spgwu-run.sh.tpl" . | include "omec-data-plane.template" | indent 4 }} |