You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jun 6, 2024. It is now read-only.
Edge deployments consist of both network functions and applications. Cloud-native solutions such as Kubernetes* typically expose only one interface to the application or network function pods. These interfaces are typically bridged interfaces. This means that network functions like Base station or Core network User plane functions and applications such as CDN are limited by the default interface. To address this, two key networking features must be enabled:
23
25
24
26
1. Enable a Kubernetes like orchestration environment to provision more than one interface to the application and network function pods.
25
27
2. Enable the allocation of dedicated hardware interfaces to application and network function pods.
26
28
27
29
### Overview of SR-IOV CNI
30
+
28
31
The Single Root I/O Virtualization (SR-IOV) feature provides the ability to partition a single physical PCI resource into virtual PCI functions that can be allocated to application and network function pods. The SR-IOV CNI plugin enables the Kubernetes pod to be attached directly to an SR-IOV virtual function (VF) using the standard SR-IOV VF driver in the container host’s kernel.
29
32
30
33
### Overview of SR-IOV Device Plugin
34
+
31
35
The Intel SR-IOV Network device plugin discovers and exposes SR-IOV network resources as consumable extended resources in Kubernetes. This works with SR-IOV VFs in both Kernel drivers and DPDK drivers. When a VF is attached with a kernel driver, the SR-IOV CNI plugin can be used to configure this VF in the pod. When using the DPDK driver, a VNF application configures this VF as required.
32
36
33
37
### Overview of SR-IOV Network Operator
38
+
34
39
To enable SR-IOV device resource allocation and CNI, Intel® Smart Edge Open uses the SR-IOV Network Operator which wraps SR-IOV CNI and SR-IOV Device Plugin to one simple component. Operator uses custom resources like `SriovNetworkNodePolicy` and `SriovNetwork` to configure SR-IOV plugins and [Multus](./multus.md) CNI.
35
40
36
41
## SR-IOV Network Operator configuration and usage
@@ -40,40 +45,53 @@ SR-IOV Network Operator is deployed using Makefiles and it requires additional p
40
45
Images for Operator are downloaded from Openshift repository and stored in local registry.
41
46
42
47
### Configuration
48
+
43
49
#### SR-IOV Network Operator
44
50
45
-
The SR-IOV NIC's are preconfigured, i.e. currently the list of network interfaces is hard coded (for supported HW platform).
51
+
The SR-IOV NICs are preconfigured, i.e. the list of network interfaces (for supported HW platform), in 2 ways:
52
+
53
+
1) Automatically: By using the [SR-IOV NICs Detection Application](https://github.com/smart-edge-open/docs/blob/main/components/networking/sriov-detection-app.md). In order to use it:
54
+
55
+
- Find the relevant platform In `platform_profiles` directory.
56
+
- In the relevant sub directory configure `all.yml` file according to the instructions in [How to edit the configuration YAML file](https://github.com/smart-edge-open/docs/blob/main/components/networking/sriov-detection-app.md#how-to-edit-the-configuration-yaml-file)
57
+
- Make sure that the number of NICs in `sriov_nics` variable is identical to the number of PFs in `criteriaLists` variable.
58
+
59
+
2) Manually: The SR-IOV NIC's are preconfigured, i.e. currently the list of network interfaces is hard coded (for supported HW platform).
46
60
Users who are installing the DEK on a system with a different NIC's must update manually the list above with the related interface names in the ESP provisioning configuration file (before Smart Edge Open deployment):
47
61
48
62
- generate a custom configuration file with `./dek_provision.py --init-config > custom.yml`
49
-
- edit generated file and set `cvl_sriov_nics` under `group vars: all:`, e.g.
50
-
51
-
```yaml
52
-
profiles:
53
-
- name: SEO_DEK
54
-
[...]
55
-
group_vars:
56
-
groups:
57
-
all:
58
-
cvl_sriov_nics:
59
-
Debian:
60
-
c0p0: "<interface name>"
61
-
c0p1: "<interface name>"
62
-
c1p0: "<interface name>"
63
-
c1p1: "<interface name>"
64
-
```
63
+
- edit generated file and disable automatic interface detection by setting the flag: `sriov_network_detection_application_enable` to false under under `group vars: all
64
+
- edit generated file and set `sriov_nics` under `group vars: all:`, e.g.
65
+
66
+
```yaml
67
+
profiles:
68
+
- name: SEO_DEK
69
+
[...]
70
+
group_vars:
71
+
groups:
72
+
all:
73
+
sriov_network_detection_application_enable: false
74
+
sriov_nics:
75
+
c0p0: "<interface name>"
76
+
c0p1: "<interface name>"
77
+
c1p0: "<interface name>"
78
+
c1p1: "<interface name>"
79
+
```
65
80
66
81
During deployment users can use a flag (in the same yml file) which allows for enabling and disabling the NIC's configuration: "sriov_network_operator_configure_enable".
67
82
68
83
Each NIC interface in the list above is a physical function of a SR-IOV NIC and configured in the same yml file in:
84
+
69
85
- The related VF's in the next section: "sriov_network_node_policies".
70
86
- The routing data in the section: "sriov_networks".
71
87
72
88
SR-IOV Network Operator provides two custom resources to configure SR-IOV network devices and network attachments:
73
89
74
90
#### SR-IOV Network Node Policy
91
+
75
92
Specifies SR-IOV network device configuration by e.g. creating VFs from given NIC interface/PCI address or its priority and defines Config Map for SR-IOV Device plugin. To apply resource to the Operator just simply use command: `kubectl apply -f sample-policy.yml`.
76
93
Sample Policy can look like:
94
+
77
95
```yaml
78
96
apiVersion: sriovnetwork.openshift.io/v1
79
97
kind: SriovNetworkNodePolicy
@@ -90,13 +108,16 @@ spec:
90
108
deviceID: "159b"
91
109
rootDevices: ["0000:31:00.0"]
92
110
```
111
+
93
112
> **NOTE:** After applying it, Operator will create 4 VFs from given Interface and create Config Map for SR-IOV Device plugin with defined `intel_sriov_netdevice` as allocable resource and mapped from given interface.
94
113
95
-
> **NOTE:** If `SriovNetworkNodePolicy` should be applied only on specific node, `kubernetes.io/hostname: "<hostname>"` should be added to `nodeSelector` field.
114
+
> **NOTE:** If `SriovNetworkNodePolicy` should be applied only on specific node, `kubernetes.io/hostname: "<hostname>"` should be added to `nodeSelector` field.
96
115
97
116
#### SR-IOV Network
117
+
98
118
It defines and configures Network attachment for Multus/SR-IOV CNI. To apply resource to the Operator just simply use command: `kubectl apply -f sample-network.yml`.
99
119
Sample network can look like:
120
+
100
121
```yaml
101
122
apiVersion: sriovnetwork.openshift.io/v1
102
123
kind: SriovNetwork
@@ -116,9 +137,11 @@ spec:
116
137
"gateway": "192.168.2.1"
117
138
}
118
139
```
140
+
119
141
> **NOTE:** After applying it, Operator will create Network Attachment Definition for Multus/SR-IOV CNI plugin with defined `sriov-seo` network, which applies to `intel_sriov_netdevice` allocable resource in `default` namespace.
120
142
121
143
### Usage
144
+
122
145
To create a pod with an attached SR-IOV device, add the network annotation (`sriov-seo`) to the pod definition and request access to the SR-IOV capable device (`intel.com/intel_sriov_netdevice`):
123
146
124
147
```yaml
@@ -158,10 +181,13 @@ To verify that the additional interface was configured, run `ip a` in the deploy
158
181
inet 192.168.2.2/24 brd 192.168.2.255 scope global net1
159
182
valid_lft forever preferred_lft forever
160
183
```
184
+
161
185
> **NOTE**: Interface `net1` is SR-IOV net device.
162
186
163
187
## Limitations
188
+
164
189
It was observed that on Ubuntu 20.04, configuring SR-IOV devices via `SriovNetworkNodePolicy` using `pfNames` on CLV NIC can cause some problems. To avoid this issue it is recommended to use `rootDevices`(see [example above](#sr-iov-network-node-policy)) instead of `pfNames`. To get PCI address of devices `lshw -c network -businfo` command can be used, i.g:
There is also observed that on Ubuntu 20.04 with only one type of SR-IOV NIC which is CLV, there can be lack of label on the node: `feature.node.kubernetes.io/network-sriov.capable: "true"`. To properly apply CLV SR-IOV NIC configuration via `SriovNetworkNodePolicy` using `nodeSelector` use entries like `kubernetes.io/hostname: "<hostname>"` (`<hostname>` should be replaced by node hostname) or `sriov-network-operator-node: "yes"`. Using [example above](#sr-iov-network-node-policy) `feature.node.kubernetes.io/network-sriov.capable: "true"` can be replaced with given examples.
0 commit comments