blob: 59f3724388d4a087cdf6192480a4c770dd6fe220 [file] [log] [blame]
Jeremy Ronquillo223db002020-06-05 10:28:22 -07001{{/*
Jeremy Ronquilloec2d3e42020-06-05 11:33:39 -07002# Copyright 2019-present Open Networking Foundation
3# Copyright 2019 Intel Corporation
Jeremy Ronquillo223db002020-06-05 10:28:22 -07004
Jeremy Ronquilloec2d3e42020-06-05 11:33:39 -07005# SPDX-License-Identifier: Apache-2.0
Jeremy Ronquillo6046ce32020-06-18 11:06:29 -07006# SPDX-License-Identifier: LicenseRef-ONF-Member-Only-1.0
Jeremy Ronquillo223db002020-06-05 10:28:22 -07007*/}}
8
9---
10apiVersion: v1
11kind: ConfigMap
12metadata:
13 name: spgwu
14 labels:
15{{ tuple "spgwu" . | include "omec-data-plane.metadata_labels" | indent 4 }}
16data:
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 Ronquillo223db002020-06-05 10:28:22 -070051 dp_comm_ip = DP_ADDR
Ajay Lotan Thakurb48ed2d2020-07-01 11:58:51 -070052{{- if .Values.config.spgwu.pfcp }}
53 dp_comm_port = 8805
54 zmq_protocol = udp
55{{- else }}
56 zmq_protocol = tcp
Jeremy Ronquillo223db002020-06-05 10:28:22 -070057 dp_comm_port = 20
Ajay Lotan Thakurb48ed2d2020-07-01 11:58:51 -070058{{- end }}
Jeremy Ronquillo223db002020-06-05 10:28:22 -070059{{- if .Values.config.spgwu.multiUpfs }}
60 cp_nb_ip = {{ .Values.config.spgwu.cpComm.addr }}
61 cp_nb_port = {{ .Values.config.spgwu.cpComm.port }}
Hyunsun Moon258fca52020-07-10 10:39:46 -070062{{- if .Values.config.spgwu.pfcp }}
63 cp_comm_ip = 127.0.0.1
64{{- else }}
Jeremy Ronquillo223db002020-06-05 10:28:22 -070065 cp_comm_ip = {{ .Values.config.spgwu.cpComm.addr }}
Hyunsun Moon258fca52020-07-10 10:39:46 -070066{{- end }}
Jeremy Ronquillo223db002020-06-05 10:28:22 -070067 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 }}