Skip to content

Commit

Permalink
refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
pirog-spb committed Dec 23, 2024
1 parent 7881e60 commit 0e0db00
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 8 deletions.
6 changes: 3 additions & 3 deletions cmd/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ func init() {
pflag.String("nodeid", "127.0.0.1", "PFCP Server Node ID")
pflag.String("maddr", ":9090", "Address to bind metrics server to")
pflag.String("n3addr", "127.0.0.1", "Address for communication over N3 interface")
pflag.String("n9addr", "127.0.0.1", "Address for communication over N9 interface")
pflag.String("n9addr", "n3addr", "Address for communication over N9 interface")
pflag.StringArray("peer", []string{}, "Address of GTP peer")
pflag.Uint32("echo", 10, "Interval of sending echo requests in seconds")
pflag.Uint32("qersize", 1024, "Size of the QER ebpf map")
Expand Down Expand Up @@ -103,7 +103,7 @@ func init() {
v.SetDefault("association_setup_timeout", 5)
v.SetDefault("metrics_address", ":9090")
v.SetDefault("n3_address", "127.0.0.1")
v.SetDefault("n9_address", "127.0.0.1")
v.SetDefault("n9_address", "n3addr")
v.SetDefault("gtp_echo_interval", 10)
v.SetDefault("qer_map_size", 1024)
v.SetDefault("far_map_size", 1024)
Expand Down Expand Up @@ -150,7 +150,7 @@ func (c *UpfConfig) Validate() error {
c.UEIPPool = ""
}

if c.N9Address == "127.0.0.1" && c.N3Address != "127.0.0.1" {
if c.N9Address == "n3addr" {
c.N9Address = c.N3Address
}

Expand Down
2 changes: 1 addition & 1 deletion docs/Configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Currently UPF have several config parameters shown below.<br>Parameters can be c
|--------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-------------------|-----------------------|-------------|-----------------|
| Interface name<br>`Mandatory` | List of network interfaces handling N3 (GTP) & N6 (SGi) traffic. eUPF attaches XDP hook to every interface in this list. Format: `[ifnameA, ifnameB, ...]`. | `interface_name` | `UPF_INTERFACE_NAME` | `--iface` | `lo` |
| N3 address <br>`Mandatory` | IPv4 address for N3 interface | `n3_address` | `UPF_N3_ADDRESS` | `--n3addr` | `127.0.0.1` |
| N9 address <br>`Mandatory` | IPv4 address for N9 interface | `n9_address` | `UPF_N9_ADDRESS` | `--n9addr` | `127.0.0.1` |
| N9 address <br>`Optional` | IPv4 address for N9 interface | `n9_address` | `UPF_N9_ADDRESS` | `--n9addr` | `n3_address` |
| XDP mode <br>`Optional` | XDP attach mode: <br> ∘ **generic** – Kernel-level implementation. For evaluation purpose. <br> ∘ **native** – Driver-level implenemntaion <br> ∘ **offload** – NIC-level implementation. XDP can be loaded and executed directly on the NIC. <br> Refer to [How XDP Works](https://www.tigera.io/learn/guides/ebpf/ebpf-xdp/#How-XDP-Works) | `xdp_attach_mode` | `UPF_XDP_ATTACH_MODE` | `--attach` | `generic` |
| API address <br>`Optional` | Local address for serving [REST API](api.md) server | `api_address` | `UPF_API_ADDRESS` | `--aaddr` | `:8080` |
| PFCP address <br>`Optional` | Local address that PFCP server will listen to | `pfcp_address` | `UPF_PFCP_ADDRESS` | `--paddr` | `:8805` |
Expand Down
4 changes: 2 additions & 2 deletions docs/docs-ru_ru/Configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
| Параметр | Описание | yaml | env | cli arg | Значение по умолчанию |
|--------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-------------------|-----------------------|-------------|-------------|
| Interface name<br>`Обязательный` | Список сетевых интерфейсов, обрабатывающих трафик N3 (GTP) и N6 (SGi). eUPF присоединяет перехватчик XDP к каждому интерфейсу в этом списке. Формат: `[ifnameA, ifnameB, ...]`. | `interface_name` | `UPF_INTERFACE_NAME` | `--iface` | `lo` |
| N3 address <br>`Обязательный` | IPv4 адрея для N3 интерфейса | `n3_address` | `UPF_N3_ADDRESS` | `--n3addr` | `127.0.0.1` |
| N9 address <br>`Обязательный` | IPv4 адрея для N9 интерфейса | `n9_address` | `UPF_N9_ADDRESS` | `--n9addr` | `127.0.0.1` |
| N3 address <br>`Обязательный` | IPv4 адреc для N3 интерфейса | `n3_address` | `UPF_N3_ADDRESS` | `--n3addr` | `127.0.0.1` |
| N9 address <br>`Дополнительный` | IPv4 адреc для N9 интерфейса. | `n9_address` | `UPF_N9_ADDRESS` | `--n9addr` | `n3_address` |
| XDP mode <br>`Дополнительный` | XDP attach mode: <br> ∘ **generic** – Реализация на уровне ядра. В целях оценки. <br> ∘ **native** – реализация на уровне драйвера <br> ∘ **offload** – реализация на уровне NIC. XDP можно загрузить и выполнить непосредственно на сетевой карте. <br> См. [Как работает XDP](https://www.tigera.io/learn/guides/ebpf/ebpf-xdp/#How-XDP-Works) | `xdp_attach_mode` | `UPF_XDP_ATTACH_MODE` | `--attach` | `generic` |
| API address <br>`Дополнительный` | Локальный адрес для обслуживания сервера [REST API](../../docs/api.md) | `api_address` | `UPF_API_ADDRESS` | `--aaddr` | `:8080` |
| PFCP address <br>`Дополнительный` | Локальный адрес, по которому буедт доступен PFCP server | `pfcp_address` | `UPF_PFCP_ADDRESS` | `--paddr` | `:8805` |
Expand Down
1 change: 0 additions & 1 deletion docs/docs-ru_ru/install.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,6 @@ services:
- UPF_METRICS_ADDRESS=:9091
- UPF_PFCP_NODE_ID=172.21.0.100
- UPF_N3_ADDRESS=172.21.0.100
- UPF_N9_ADDRESS=172.21.0.100
ulimits:
memlock: -1
cap_add:
Expand Down
2 changes: 1 addition & 1 deletion docs/docs-ru_ru/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ sudo docker run -d --rm -v --privileged \
-e UPF_INTERFACE_NAME=[eth0,n6] -e UPF_XDP_ATTACH_MODE=generic \
-e UPF_API_ADDRESS=:8081 -e UPF_PFCP_ADDRESS=:8806 \
-e UPF_METRICS_ADDRESS=:9091 -e UPF_PFCP_NODE_ID=10.100.50.241 \
-e UPF_N3_ADDRESS=10.100.50.233 -e UPF_N9_ADDRESS=10.100.50.233 \
-e UPF_N3_ADDRESS=10.100.50.233 \
ghcr.io/edgecomllc/eupf:main
```

Expand Down

0 comments on commit 0e0db00

Please sign in to comment.