blob: c92e2be0b159d7a6a876c177f50d3b86048965b0 [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]
51 zmq_protocol = tcp
52 dp_comm_ip = DP_ADDR
53 dp_comm_port = 20
54{{- if .Values.config.spgwu.multiUpfs }}
55 cp_nb_ip = {{ .Values.config.spgwu.cpComm.addr }}
56 cp_nb_port = {{ .Values.config.spgwu.cpComm.port }}
57 cp_comm_ip = {{ .Values.config.spgwu.cpComm.addr }}
58 cp_comm_port = {{ .Values.config.spgwu.cpComm.port }}
59 zmq_dp_ip=127.0.0.1
60 zmq_cp_ip=127.0.0.1
61{{- else }}
62 cp_comm_ip = {{ .Values.config.spgwu.cpComm.addr }}
63 cp_comm_port = {{ .Values.config.spgwu.cpComm.port }}
64{{- end }}
65{{- if not .Values.config.sriov.enabled }}
66 setup-af-iface.sh: |
67{{ tuple "bin/_spgwu-setup-af-iface.sh.tpl" . | include "omec-data-plane.template" | indent 4 }}
68{{- end }}
69 run.sh: |
70{{ tuple "bin/_spgwu-run.sh.tpl" . | include "omec-data-plane.template" | indent 4 }}