Skip to content

Commit 7d4138c

Browse files
committed
OSDOCS-6321: SR-IOV: Document VF usage on management port
1 parent 6d17dda commit 7d4138c

File tree

2 files changed

+130
-0
lines changed

2 files changed

+130
-0
lines changed
Lines changed: 122 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,122 @@
1+
// Module included in the following assemblies:
2+
//
3+
// * networking/hardware_networks/configuring-hardware-offloading.adoc
4+
5+
:_content-type: PROCEDURE
6+
[id="improving-network-traffic-performance-using-vf_{context}"]
7+
= Improving network traffic performance using a virtual function
8+
9+
Follow this procedure to assign a virtual function to the OVN-Kubernetes management port and increase its network traffic performance.
10+
11+
This procedure results in the creation of two pools: the first has a virtual function used by OVN-Kubernetes, and the second comprises the remaining virtual functions.
12+
13+
.Prerequisites
14+
15+
* You installed the OpenShift CLI (`oc`).
16+
* You have access to the cluster as a user with the `cluster-admin` role.
17+
18+
.Procedure
19+
20+
. Add the `network.operator.openshift.io/smart-nic` label to each worker node with a SmartNIC present by running the following command:
21+
+
22+
[source,terminal]
23+
----
24+
$ oc label node <node-name> network.operator.openshift.io/smart-nic=
25+
----
26+
+
27+
Use the `oc get nodes` command to get a list of the available nodes.
28+
29+
. Create a policy named `sriov-node-mgmt-vf-policy.yaml` for the management port with content such as the following example:
30+
+
31+
[source,yaml]
32+
----
33+
apiVersion: sriovnetwork.openshift.io/v1
34+
kind: SriovNetworkNodePolicy
35+
metadata:
36+
name: sriov-node-mgmt-vf-policy
37+
namespace: openshift-sriov-network-operator
38+
spec:
39+
deviceType: netdevice
40+
eSwitchMode: "switchdev"
41+
nicSelector:
42+
deviceID: "1019"
43+
rootDevices:
44+
- 0000:d8:00.0
45+
vendor: "15b3"
46+
pfNames:
47+
- ens8f0#0-0 <.>
48+
nodeSelector:
49+
network.operator.openshift.io/smart-nic: ""
50+
numVfs: 6 <.>
51+
priority: 5
52+
resourceName: mgmtvf
53+
----
54+
<.> Replace this device with the appropriate network device for your use case. The `#0-0` part of the `pfNames` value reserves a single virtual function used by OVN-Kubernetes.
55+
<.> The value provided here is an example. Replace this value with one that meets your requirements. For more information, see _SR-IOV network node configuration object_ in the _Additional resources_ section.
56+
57+
. Create a policy named `sriov-node-policy.yaml` with content such as the following example:
58+
+
59+
[source,yaml]
60+
----
61+
apiVersion: sriovnetwork.openshift.io/v1
62+
kind: SriovNetworkNodePolicy
63+
metadata:
64+
name: sriov-node-policy
65+
namespace: openshift-sriov-network-operator
66+
spec:
67+
deviceType: netdevice
68+
eSwitchMode: "switchdev"
69+
nicSelector:
70+
deviceID: "1019"
71+
rootDevices:
72+
- 0000:d8:00.0
73+
vendor: "15b3"
74+
pfNames:
75+
- ens8f0#1-5 <.>
76+
nodeSelector:
77+
network.operator.openshift.io/smart-nic: ""
78+
numVfs: 6 <.>
79+
priority: 5
80+
resourceName: mlxnics
81+
----
82+
<.> Replace this device with the appropriate network device for your use case.
83+
<.> The value provided here is an example. Replace this value with the value specified in the `sriov-node-mgmt-vf-policy.yaml` file. For more information, see _SR-IOV network node configuration object_ in the _Additional resources_ section.
84+
+
85+
[NOTE]
86+
====
87+
The `sriov-node-mgmt-vf-policy.yaml` file has different values for the `pfNames` and `resourceName` keys than the `sriov-node-policy.yaml` file.
88+
====
89+
90+
. Apply the configuration for both policies:
91+
+
92+
[source,terminal]
93+
----
94+
$ oc create -f sriov-node-policy.yaml
95+
----
96+
+
97+
[source,terminal]
98+
----
99+
$ oc create -f sriov-node-mgmt-vf-policy.yaml
100+
----
101+
102+
. Create a Cluster Network Operator (CNO) ConfigMap in the cluster for the management configuration:
103+
104+
.. Create a ConfigMap named `hardware-offload-config.yaml` with the following contents:
105+
+
106+
[source,yaml]
107+
----
108+
apiVersion: v1
109+
kind: ConfigMap
110+
metadata:
111+
name: hardware-offload-config
112+
namespace: openshift-network-operator
113+
data:
114+
mgmt-port-resource-name: openshift.io/mgmtvf
115+
----
116+
117+
.. Apply the configuration for the ConfigMap:
118+
+
119+
[source,terminal]
120+
----
121+
$ oc create -f hardware-offload-config.yaml
122+
----

networking/hardware_networks/configuring-hardware-offloading.adoc

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,14 @@ include::modules/nw-sriov-hwol-creating-sriov-policy.adoc[leveloffset=+1]
3232

3333
include::modules/nw-sriov-hwol-ref-openstack-sriov-policy.adoc[leveloffset=+2]
3434

35+
// Improving network traffic performance using a virtual function
36+
include::modules/nw-sriov-hwol-improving-network-traffic-performance.adoc[leveloffset=+1]
37+
38+
[role="_additional-resources"]
39+
[id="additional-resources_using-vf-improve-network-traffic-performance"]
40+
.Additional resources
41+
* xref:../../networking/hardware_networks/configuring-sriov-device.adoc#nw-sriov-networknodepolicy-object_configuring-sriov-device[SR-IOV network node configuration object]
42+
3543
//Creating a Network Attachment Definition
3644
include::modules/nw-sriov-hwol-creating-network-attachment-definition.adoc[leveloffset=+1]
3745

0 commit comments

Comments
 (0)