Jeremy Ronquillo | 223db00 | 2020-06-05 10:28:22 -0700 | [diff] [blame] | 1 | {{/* |
Jeremy Ronquillo | ec2d3e4 | 2020-06-05 11:33:39 -0700 | [diff] [blame] | 2 | # Copyright 2019-present Open Networking Foundation |
| 3 | # Copyright 2019 Intel Corporation |
Jeremy Ronquillo | 223db00 | 2020-06-05 10:28:22 -0700 | [diff] [blame] | 4 | |
Jeremy Ronquillo | ec2d3e4 | 2020-06-05 11:33:39 -0700 | [diff] [blame] | 5 | # SPDX-License-Identifier: Apache-2.0 |
Jeremy Ronquillo | 6046ce3 | 2020-06-18 11:06:29 -0700 | [diff] [blame] | 6 | # SPDX-License-Identifier: LicenseRef-ONF-Member-Only-1.0 |
Jeremy Ronquillo | 223db00 | 2020-06-05 10:28:22 -0700 | [diff] [blame] | 7 | */}} |
| 8 | |
| 9 | --- |
| 10 | apiVersion: v1 |
| 11 | kind: ConfigMap |
| 12 | metadata: |
| 13 | name: spgwu |
| 14 | labels: |
| 15 | {{ tuple "spgwu" . | include "omec-data-plane.metadata_labels" | indent 4 }} |
| 16 | data: |
| 17 | dp_config.cfg: | |
| 18 | if [ ! -d "/dev/hugepages" ]; then |
| 19 | MEMORY="--no-huge -m $((MEM_LIMIT-1024))" |
| 20 | fi |
| 21 | CORES="-c $(taskset -p $$ | awk '{print $NF}')" |
| 22 | EAL_ARGS="${CORES} ${MEMORY} {{ .Values.config.spgwu.devices }}" |
| 23 | |
| 24 | {{- if .Values.config.sriov.enabled }} |
| 25 | S1U_DEVNAME={{ .Values.config.spgwu.s1u.device }} |
| 26 | {{- else }} |
| 27 | S1U_DEVNAME={{ .Values.config.spgwu.s1u.device }}-veth |
| 28 | {{- end }} |
| 29 | {{- if .Values.config.sriov.enabled }} |
| 30 | SGI_DEVNAME={{ .Values.config.spgwu.sgi.device }} |
| 31 | {{- else }} |
| 32 | SGI_DEVNAME={{ .Values.config.spgwu.sgi.device }}-veth |
| 33 | {{- end }} |
| 34 | |
| 35 | S1U_IP=$(ip -4 addr show dev ${S1U_DEVNAME} | grep -oP '(?<=inet\s)\d+(\.\d+){3}') |
| 36 | SGI_IP=$(ip -4 addr show dev ${SGI_DEVNAME} | grep -oP '(?<=inet\s)\d+(\.\d+){3}') |
| 37 | S1U_MAC=$(ip addr show dev ${S1U_DEVNAME} | awk '$1=="link/ether"{print $2}') |
| 38 | SGI_MAC=$(ip addr show dev ${SGI_DEVNAME} | awk '$1=="link/ether"{print $2}') |
| 39 | |
| 40 | S1U="--s1u_ip ${S1U_IP} --s1u_mac ${S1U_MAC} --ul_iface ${S1U_DEVNAME}" |
| 41 | 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 }}" |
| 42 | MISC="--log 1" |
| 43 | SPGW_CFG="--spgw_cfg 03" |
| 44 | |
| 45 | APP_ARGS="${S1U} ${SGI} ${MISC} ${SPGW_CFG}" |
| 46 | cdr.cfg: | |
| 47 | CDR_PATH=./cdr |
| 48 | MASTER_CDR=./cdr/master.csv |
| 49 | interface.cfg: | |
| 50 | [0] |
Jeremy Ronquillo | 223db00 | 2020-06-05 10:28:22 -0700 | [diff] [blame] | 51 | dp_comm_ip = DP_ADDR |
Ajay Lotan Thakur | b48ed2d | 2020-07-01 11:58:51 -0700 | [diff] [blame] | 52 | {{- if .Values.config.spgwu.pfcp }} |
| 53 | dp_comm_port = 8805 |
| 54 | zmq_protocol = udp |
| 55 | {{- else }} |
| 56 | zmq_protocol = tcp |
Jeremy Ronquillo | 223db00 | 2020-06-05 10:28:22 -0700 | [diff] [blame] | 57 | dp_comm_port = 20 |
Ajay Lotan Thakur | b48ed2d | 2020-07-01 11:58:51 -0700 | [diff] [blame] | 58 | {{- end }} |
Jeremy Ronquillo | 223db00 | 2020-06-05 10:28:22 -0700 | [diff] [blame] | 59 | {{- if .Values.config.spgwu.multiUpfs }} |
| 60 | cp_nb_ip = {{ .Values.config.spgwu.cpComm.addr }} |
| 61 | cp_nb_port = {{ .Values.config.spgwu.cpComm.port }} |
Hyunsun Moon | 258fca5 | 2020-07-10 10:39:46 -0700 | [diff] [blame] | 62 | {{- if .Values.config.spgwu.pfcp }} |
| 63 | cp_comm_ip = 127.0.0.1 |
| 64 | {{- else }} |
Jeremy Ronquillo | 223db00 | 2020-06-05 10:28:22 -0700 | [diff] [blame] | 65 | cp_comm_ip = {{ .Values.config.spgwu.cpComm.addr }} |
Hyunsun Moon | 258fca5 | 2020-07-10 10:39:46 -0700 | [diff] [blame] | 66 | {{- end }} |
Jeremy Ronquillo | 223db00 | 2020-06-05 10:28:22 -0700 | [diff] [blame] | 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 }} |