Skip to content

Commit bc5446f

Browse files
authored
Merge pull request #109235 from kquinn1204/TELCODOCS-2858
TELCODOCS-2858: Fix AsciiDocDITA violations in using-dpdk-and-rdma
2 parents c1793c4 + 4de400f commit bc5446f

14 files changed

Lines changed: 228 additions & 168 deletions

modules/nw-openstack-ovs-dpdk-testpmd-pod.adoc

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
[id="nw-openstack-ovs-dpdk-testpmd-pod_{context}"]
77
= A test pod template for clusters that use OVS-DPDK on OpenStack
88

9+
[role="_abstract"]
910
The following `testpmd` pod demonstrates container creation with huge pages, reserved CPUs, and the SR-IOV port.
1011

1112
.An example `testpmd` pod
@@ -35,7 +36,7 @@ spec:
3536
memory: 1000Mi
3637
hugepages-1Gi: 1Gi
3738
cpu: '2'
38-
openshift.io/dpdk1: 1 <1>
39+
openshift.io/dpdk1: 1
3940
limits:
4041
hugepages-1Gi: 1Gi
4142
cpu: '2'
@@ -45,11 +46,14 @@ spec:
4546
- mountPath: /mnt/huge
4647
name: hugepage
4748
readOnly: False
48-
runtimeClassName: performance-cnf-performanceprofile <2>
49+
runtimeClassName: performance-cnf-performanceprofile
4950
volumes:
5051
- name: hugepage
5152
emptyDir:
5253
medium: HugePages
5354
----
54-
<1> The name `dpdk1` in this example is a user-created `SriovNetworkNodePolicy` resource. You can substitute this name for that of a resource that you create.
55-
<2> If your performance profile is not named `cnf-performance profile`, replace that string with the correct performance profile name.
55+
56+
--
57+
* The name `dpdk1` in this example is a user-created `SriovNetworkNodePolicy` resource. You can substitute this name for that of a resource that you create.
58+
* If your performance profile is not named `cnf-performance profile`, replace that string with the correct performance profile name.
59+
--

modules/nw-running-dpdk-rootless-tap.adoc

Lines changed: 57 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,10 @@
66
[id="nw-running-dpdk-rootless-tap_{context}"]
77
= Using the TAP CNI to run a rootless DPDK workload with kernel access
88

9+
[role="_abstract"]
910
DPDK applications can use `virtio-user` as an exception path to inject certain types of packets, such as log messages, into the kernel for processing. For more information about this feature, see link:https://doc.dpdk.org/guides/howto/virtio_user_as_exception_path.html[Virtio_user as Exception Path].
1011

11-
In OpenShift Container Platform version 4.14 and later, you can use non-privileged pods to run DPDK applications alongside the tap CNI plugin. To enable this functionality, you need to mount the `vhost-net` device by setting the `needVhostNet` parameter to `true` within the `SriovNetworkNodePolicy` object.
12+
In {product-title} version 4.14 and later, you can use non-privileged pods to run DPDK applications alongside the tap CNI plugin. To enable this functionality, you need to mount the `vhost-net` device by setting the `needVhostNet` parameter to `true` within the `SriovNetworkNodePolicy` object.
1213

1314
.DPDK and TAP example configuration
1415
image::348_OpenShift_rootless_DPDK_0923.png[DPDK and TAP plugin]
@@ -27,7 +28,7 @@ Use the Machine Config Operator to set this SELinux boolean.
2728
2829
.Procedure
2930

30-
. Create a file, such as `test-namespace.yaml`, with content like the following example:
31+
. Create a file, such as `test-namespace.yaml`, with content such as the following example:
3132
+
3233
[source,yaml]
3334
----
@@ -49,7 +50,7 @@ metadata:
4950
$ oc apply -f test-namespace.yaml
5051
----
5152

52-
. Create a file, such as `sriov-node-network-policy.yaml`, with content like the following example::
53+
. Create a file, such as `sriov-node-network-policy.yaml`, with content such as the following example:
5354
+
5455
[source,yaml]
5556
----
@@ -59,24 +60,27 @@ metadata:
5960
name: sriovnic
6061
namespace: openshift-sriov-network-operator
6162
spec:
62-
deviceType: netdevice <1>
63-
isRdma: true <2>
64-
needVhostNet: true <3>
63+
deviceType: netdevice
64+
isRdma: true
65+
needVhostNet: true
6566
nicSelector:
66-
vendor: "15b3" <4>
67-
deviceID: "101b" <5>
67+
vendor: "15b3"
68+
deviceID: "101b"
6869
rootDevices: ["00:05.0"]
6970
numVfs: 10
7071
priority: 99
7172
resourceName: sriovnic
7273
nodeSelector:
7374
feature.node.kubernetes.io/network-sriov.capable: "true"
7475
----
75-
<1> This indicates that the profile is tailored specifically for Mellanox Network Interface Controllers (NICs).
76-
<2> Setting `isRdma` to `true` is only required for a Mellanox NIC.
77-
<3> This mounts the `/dev/net/tun` and `/dev/vhost-net` devices into the container so the application can create a tap device and connect the tap device to the DPDK workload.
78-
<4> The vendor hexadecimal code of the SR-IOV network device. The value 15b3 is associated with a Mellanox NIC.
79-
<5> The device hexadecimal code of the SR-IOV network device.
76+
+
77+
where:
78+
+
79+
`spec.deviceType`:: Specifies that the profile is tailored specifically for Mellanox Network Interface Controllers (NICs). Set to `netdevice`.
80+
`spec.isRdma`:: Setting to `true` is only required for a Mellanox NIC.
81+
`spec.needVhostNet`:: Setting to `true` mounts the `/dev/net/tun` and `/dev/vhost-net` devices into the container so the application can create a tap device and connect the tap device to the DPDK workload.
82+
`spec.nicSelector.vendor`:: Specifies the vendor hexadecimal code of the SR-IOV network device. The value `"15b3"` is associated with a Mellanox NIC.
83+
`spec.nicSelector.deviceID`:: Specifies the device hexadecimal code of the SR-IOV network device.
8084

8185
. Create the `SriovNetworkNodePolicy` object by running the following command:
8286
+
@@ -115,15 +119,15 @@ An optional library, `app-netutil`, provides several API methods for gathering n
115119
$ oc create -f sriov-network-attachment.yaml
116120
----
117121

118-
. Create a file, such as `tap-example.yaml`, that defines a network attachment definition, with content like the following example:
122+
. Create a file, such as `tap-example.yaml`, that defines a network attachment definition, with content such as the following example:
119123
+
120124
[source,yaml]
121125
----
122126
apiVersion: "k8s.cni.cncf.io/v1"
123127
kind: NetworkAttachmentDefinition
124128
metadata:
125129
name: tap-one
126-
namespace: test-namespace <1>
130+
namespace: test-namespace
127131
spec:
128132
config: '{
129133
"cniVersion": "0.4.0",
@@ -143,7 +147,10 @@ spec:
143147
]
144148
}'
145149
----
146-
<1> Specify the same `target_namespace` where the `SriovNetwork` object is created.
150+
+
151+
where:
152+
+
153+
`metadata.namespace`:: Specifies the same `target_namespace` where the `SriovNetwork` object is created.
147154

148155
. Create the `NetworkAttachmentDefinition` object by running the following command:
149156
+
@@ -152,15 +159,15 @@ spec:
152159
$ oc apply -f tap-example.yaml
153160
----
154161

155-
. Create a file, such as `dpdk-pod-rootless.yaml`, with content like the following example:
162+
. Create a file, such as `dpdk-pod-rootless.yaml`, with content such as the following example:
156163
+
157164
[source,yaml]
158165
----
159166
apiVersion: v1
160167
kind: Pod
161168
metadata:
162169
name: dpdk-app
163-
namespace: test-namespace <1>
170+
namespace: test-namespace
164171
annotations:
165172
k8s.v1.cni.cncf.io/networks: '[
166173
{"name": "sriov-network", "namespace": "test-namespace"},
@@ -169,64 +176,63 @@ spec:
169176
nodeSelector:
170177
kubernetes.io/hostname: "worker-0"
171178
securityContext:
172-
fsGroup: 1001 <2>
173-
runAsGroup: 1001 <3>
179+
fsGroup: 1001
180+
runAsGroup: 1001
174181
seccompProfile:
175182
type: RuntimeDefault
176183
containers:
177184
- name: testpmd
178-
image: <DPDK_image> <4>
185+
image: <DPDK_image>
179186
securityContext:
180187
capabilities:
181-
drop: ["ALL"] <5>
182-
add: <6>
188+
drop: ["ALL"]
189+
add:
183190
- IPC_LOCK
184-
- NET_RAW #for mlx only <7>
185-
runAsUser: 1001 <8>
186-
privileged: false <9>
187-
allowPrivilegeEscalation: true <10>
188-
runAsNonRoot: true <11>
191+
- NET_RAW #for mlx only
192+
runAsUser: 1001
193+
privileged: false
194+
allowPrivilegeEscalation: true
195+
runAsNonRoot: true
189196
volumeMounts:
190-
- mountPath: /mnt/huge <12>
197+
- mountPath: /mnt/huge
191198
name: hugepages
192199
resources:
193200
limits:
194-
openshift.io/sriovnic: "1" <13>
201+
openshift.io/sriovnic: "1"
195202
memory: "1Gi"
196-
cpu: "4" <14>
197-
hugepages-1Gi: "4Gi" <15>
203+
cpu: "4"
204+
hugepages-1Gi: "4Gi"
198205
requests:
199206
openshift.io/sriovnic: "1"
200207
memory: "1Gi"
201208
cpu: "4"
202209
hugepages-1Gi: "4Gi"
203210
command: ["sleep", "infinity"]
204-
runtimeClassName: performance-cnf-performanceprofile <16>
211+
runtimeClassName: performance-cnf-performanceprofile
205212
volumes:
206213
- name: hugepages
207214
emptyDir:
208215
medium: HugePages
209216
----
210217
+
211-
--
212-
<1> Specify the same `target_namespace` in which the `SriovNetwork` object is created. If you want to create the pod in a different namespace, change `target_namespace` in both the `Pod` spec and the `SriovNetwork` object.
213-
<2> Sets the group ownership of volume-mounted directories and files created in those volumes.
214-
<3> Specify the primary group ID used for running the container.
215-
<4> Specify the DPDK image that contains your application and the DPDK library used by application.
216-
<5> Removing all capabilities (`ALL`) from the container's securityContext means that the container has no special privileges beyond what is necessary for normal operation.
217-
<6> Specify additional capabilities required by the application inside the container for hugepage allocation, system resource allocation, and network interface access. These capabilities must also be set in the binary file by using the `setcap` command.
218-
<7> Mellanox network interface controller (NIC) requires the `NET_RAW` capability.
219-
<8> Specify the user ID used for running the container.
220-
<9> This setting indicates that the container or containers within the pod should not be granted privileged access to the host system.
221-
<10> This setting allows a container to escalate its privileges beyond the initial non-root privileges it might have been assigned.
222-
<11> This setting ensures that the container runs with a non-root user. This helps enforce the principle of least privilege, limiting the potential impact of compromising the container and reducing the attack surface.
223-
<12> Mount a hugepage volume to the DPDK pod under `/mnt/huge`. The hugepage volume is backed by the emptyDir volume type with the medium being `Hugepages`.
224-
<13> Optional: Specify the number of DPDK devices allocated for the DPDK pod. If not explicitly specified, this resource request and limit is automatically added by the SR-IOV network resource injector. The SR-IOV network resource injector is an admission controller component managed by SR-IOV Operator. It is enabled by default and can be disabled by setting the `enableInjector` option to `false` in the default `SriovOperatorConfig` CR.
225-
<14> Specify the number of CPUs. The DPDK pod usually requires exclusive CPUs to be allocated from the kubelet. This is achieved by setting CPU Manager policy to `static` and creating a pod with `Guaranteed` QoS.
226-
<15> Specify hugepage size `hugepages-1Gi` or `hugepages-2Mi` and the quantity of hugepages that will be allocated to the DPDK pod. Configure `2Mi` and `1Gi` hugepages separately. Configuring `1Gi` hugepage requires adding kernel arguments to Nodes. For example, adding kernel arguments `default_hugepagesz=1GB`, `hugepagesz=1G` and `hugepages=16` will result in `16*1Gi` hugepages be allocated during system boot.
227-
<16> If your performance profile is not named `cnf-performance profile`, replace that string with the correct performance profile name.
228-
--
218+
where:
229219
+
220+
`metadata.namespace`:: Specifies the same `target_namespace` in which the `SriovNetwork` object is created. If you want to create the pod in a different namespace, change `target_namespace` in both the `Pod` spec and the `SriovNetwork` object.
221+
`spec.securityContext.fsGroup`:: Sets the group ownership of volume-mounted directories and files created in those volumes.
222+
`spec.securityContext.runAsGroup`:: Specifies the primary group ID used for running the container.
223+
`spec.containers.image`:: Specifies the DPDK image that contains your application and the DPDK library used by application.
224+
`spec.containers.securityContext.capabilities.drop`:: Removing all capabilities (`ALL`) from the container's `securityContext` means that the container has no special privileges beyond what is necessary for normal operation.
225+
`spec.containers.securityContext.capabilities.add`:: Specifies additional capabilities required by the application inside the container for hugepage allocation, system resource allocation, and network interface access. These capabilities must also be set in the binary file by using the `setcap` command. Mellanox network interface controller (NIC) requires the `NET_RAW` capability.
226+
`spec.containers.securityContext.runAsUser`:: Specifies the user ID used for running the container.
227+
`spec.containers.securityContext.privileged`:: Setting to `false` indicates that the container or containers within the pod should not be granted privileged access to the host system.
228+
`spec.containers.securityContext.allowPrivilegeEscalation`:: Setting to `true` allows a container to escalate its privileges beyond the initial non-root privileges it might have been assigned.
229+
`spec.containers.securityContext.runAsNonRoot`:: Setting to `true` ensures that the container runs with a non-root user. This helps enforce the principle of least privilege, limiting the potential impact of compromising the container and reducing the attack surface.
230+
`spec.containers.volumeMounts.mountPath`:: Specifies the path where a hugepage volume is mounted in the DPDK pod. The hugepage volume is backed by the `emptyDir` volume type with the medium being `Hugepages`.
231+
`spec.containers.resources.limits.openshift.io/sriovnic`:: Optional: Specifies the number of DPDK devices allocated for the DPDK pod. If not explicitly specified, this resource request and limit is automatically added by the SR-IOV network resource injector. The SR-IOV network resource injector is an admission controller component managed by SR-IOV Operator. It is enabled by default and can be disabled by setting the `enableInjector` option to `false` in the default `SriovOperatorConfig` CR.
232+
`spec.containers.resources.limits.cpu`:: Specifies the number of CPUs. The DPDK pod usually requires exclusive CPUs to be allocated from the kubelet. This is achieved by setting CPU Manager policy to `static` and creating a pod with `Guaranteed` QoS.
233+
`spec.containers.resources.limits.hugepages-1Gi`:: Specifies the hugepage size `hugepages-1Gi` or `hugepages-2Mi` and the quantity of hugepages that will be allocated to the DPDK pod. Configure `2Mi` and `1Gi` hugepages separately. Configuring `1Gi` hugepage requires adding kernel arguments to Nodes. For example, adding kernel arguments `default_hugepagesz=1GB`, `hugepagesz=1G` and `hugepages=16` will result in `16*1Gi` hugepages be allocated during system boot.
234+
`spec.runtimeClassName`:: Specifies the performance profile runtime class. If your performance profile is not named `cnf-performance profile`, replace that string with the correct performance profile name.
235+
230236
. Create the DPDK pod by running the following command:
231237
+
232238
[source,terminal]

modules/nw-sriov-app-netutil.adoc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
[id="nw-sriov-app-netutil_{context}"]
77
= DPDK library for use with container applications
88

9+
[role="_abstract"]
910
An link:https://github.com/openshift/app-netutil[optional library], `app-netutil`, provides several API methods for gathering network information about a pod from within a container running within that pod.
1011

1112
This library can assist with integrating SR-IOV virtual functions (VFs) in Data Plane Development Kit (DPDK) mode into the container.

modules/nw-sriov-concept-dpdk-line-rate.adoc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
[id="nw-sriov-example-dpdk-line-rate_{context}"]
77
= Overview of achieving a specific DPDK line rate
88

9+
[role="_abstract"]
910
To achieve a specific Data Plane Development Kit (DPDK) line rate, deploy a Node Tuning Operator and configure Single Root I/O Virtualization (SR-IOV). You must also tune the DPDK settings for the following resources:
1011

1112
- Isolated CPUs
@@ -17,13 +18,12 @@ To achieve a specific Data Plane Development Kit (DPDK) line rate, deploy a Node
1718
In previous versions of {product-title}, the Performance Addon Operator was used to implement automatic tuning to achieve low latency performance for {product-title} applications. In {product-title} 4.11 and later, this functionality is part of the Node Tuning Operator.
1819
====
1920

20-
.DPDK test environment
21-
The following diagram shows the components of a traffic-testing environment:
21+
The following diagram shows the components of a DPDK test environment:
2222

2323
image::261_OpenShift_DPDK_0722.png[DPDK test environment]
2424

2525
- **Traffic generator**: An application that can generate high-volume packet traffic.
26-
- **SR-IOV-supporting NIC**: A network interface card compatible with SR-IOV. The card runs a number of virtual functions on a physical interface.
26+
- **SR-IOV-supporting NIC**: A network interface controller (NIC) compatible with SR-IOV. The card runs several virtual functions on a physical interface.
2727
- **Physical Function (PF)**: A PCI Express (PCIe) function of a network adapter that supports the SR-IOV interface.
2828
- **Virtual Function (VF)**: A lightweight PCIe function on a network adapter that supports SR-IOV. The VF is associated with the PCIe PF on the network adapter. The VF represents a virtualized instance of the network adapter.
2929
- **Switch**: A network switch. Nodes can also be connected back-to-back.

modules/nw-sriov-create-object.adoc

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
[id="nw-sriov-create-object_{context}"]
77
= Example SR-IOV network operator
88

9+
[role="_abstract"]
910
The following is an example definition of an `sriovNetwork` object. In this case, Intel and Mellanox configurations are identical:
1011
[source,yaml]
1112
----
@@ -16,11 +17,11 @@ metadata:
1617
namespace: openshift-sriov-network-operator
1718
spec:
1819
ipam: '{"type": "host-local","ranges": [[{"subnet": "10.0.1.0/24"}]],"dataDir":
19-
"/run/my-orchestrator/container-ipam-state-1"}' <1>
20-
networkNamespace: dpdk-test <2>
20+
"/run/my-orchestrator/container-ipam-state-1"}'
21+
networkNamespace: dpdk-test
2122
spoofChk: "off"
2223
trust: "on"
23-
resourceName: dpdk_nic_1 <3>
24+
resourceName: dpdk_nic_1
2425
---
2526
apiVersion: sriovnetwork.openshift.io/v1
2627
kind: SriovNetwork
@@ -35,6 +36,9 @@ spec:
3536
trust: "on"
3637
resourceName: dpdk_nic_2
3738
----
38-
<1> You can use a different IP Address Management (IPAM) implementation, such as Whereabouts. For more information, see _Dynamic IP address assignment configuration with Whereabouts_.
39-
<2> You must request the `networkNamespace` where the network attachment definition will be created. You must create the `sriovNetwork` CR under the `openshift-sriov-network-operator` namespace.
40-
<3> The `resourceName` value must match that of the `resourceName` created under the `sriovNetworkNodePolicy`.
39+
40+
--
41+
* You can use a different IP Address Management (IPAM) implementation, such as Whereabouts. For more information, see _Dynamic IP address assignment configuration with Whereabouts_.
42+
* You must request the `networkNamespace` where the network attachment definition will be created. You must create the `sriovNetwork` CR under the `openshift-sriov-network-operator` namespace.
43+
* The `resourceName` value must match that of the `resourceName` created under the `sriovNetworkNodePolicy`.
44+
--

0 commit comments

Comments
 (0)