|
| 1 | +// Module included in the following assemblies: |
| 2 | +// |
| 3 | +// * networking/switching-bf2-nic-dpu.adoc |
| 4 | + |
| 5 | +:_content-type: PROCEDURE |
| 6 | +[id="proc-switching-bf2-nic_{context}"] |
| 7 | += Switching Bluefield-2 from DPU mode to NIC mode |
| 8 | + |
| 9 | +Use the following procedure to switch Bluefield-2 from data processing units (DPU) mode to network interface controller (NIC) mode. |
| 10 | + |
| 11 | +[IMPORTANT] |
| 12 | +==== |
| 13 | +Currently, only switching Bluefield-2 from DPU to NIC mode is supported. Switching from NIC mode to DPU mode is unsupported. |
| 14 | +==== |
| 15 | + |
| 16 | +.Prerequisites |
| 17 | + |
| 18 | +* You have installed the SR-IOV Network Operator. For more information, see "Installing SR-IOV Network Operator". |
| 19 | +* You have updated Bluefield-2 to the latest firmware. For more information, see link:https://network.nvidia.com/support/firmware/bluefield2/[Firmware for NVIDIA BlueField-2]. |
| 20 | +
|
| 21 | +.Procedure |
| 22 | + |
| 23 | +. Add the following labels to each of your worker nodes by entering the following commands: |
| 24 | ++ |
| 25 | +[source,terminal] |
| 26 | +---- |
| 27 | +$ oc label node <example_node_name_one> node-role.kubernetes.io/sriov= |
| 28 | +---- |
| 29 | ++ |
| 30 | +[source,terminal] |
| 31 | +---- |
| 32 | +$ oc label node <example_node_name_two> node-role.kubernetes.io/sriov= |
| 33 | +
|
| 34 | +---- |
| 35 | + |
| 36 | +. Create a machine config pool for the SR-IOV Operator, for example: |
| 37 | ++ |
| 38 | +[source,yaml] |
| 39 | +---- |
| 40 | + |
| 41 | +apiVersion: machineconfiguration.openshift.io/v1 |
| 42 | +kind: MachineConfigPool |
| 43 | +metadata: |
| 44 | + name: sriov |
| 45 | +spec: |
| 46 | + machineConfigSelector: |
| 47 | + matchExpressions: |
| 48 | + - {key: machineconfiguration.openshift.io/role, operator: In, values: [worker,sriov]} |
| 49 | + nodeSelector: |
| 50 | + matchLabels: |
| 51 | + node-role.kubernetes.io/sriov: "" |
| 52 | +---- |
| 53 | + |
| 54 | +. Apply the following `machineconfig.yaml` file to the worker nodes: |
| 55 | ++ |
| 56 | +[source,yaml] |
| 57 | +---- |
| 58 | +apiVersion: machineconfiguration.openshift.io/v1 |
| 59 | +kind: MachineConfig |
| 60 | +metadata: |
| 61 | + labels: |
| 62 | + machineconfiguration.openshift.io/role: sriov |
| 63 | + name: 99-bf2-dpu |
| 64 | +spec: |
| 65 | + config: |
| 66 | + ignition: |
| 67 | + version: 3.2.0 |
| 68 | + storage: |
| 69 | + files: |
| 70 | + - contents: |
| 71 | + source: data:text/plain;charset=utf-8;base64,ZmluZF9jb250YWluZXIoKSB7CiAgY3JpY3RsIHBzIC1vIGpzb24gfCBqcSAtciAnLmNvbnRhaW5lcnNbXSB8IHNlbGVjdCgubWV0YWRhdGEubmFtZT09InNyaW92LW5ldHdvcmstY29uZmlnLWRhZW1vbiIpIHwgLmlkJwp9CnVudGlsIG91dHB1dD0kKGZpbmRfY29udGFpbmVyKTsgW1sgLW4gIiRvdXRwdXQiIF1dOyBkbwogIGVjaG8gIndhaXRpbmcgZm9yIGNvbnRhaW5lciB0byBjb21lIHVwIgogIHNsZWVwIDE7CmRvbmUKISBzdWRvIGNyaWN0bCBleGVjICRvdXRwdXQgL2JpbmRhdGEvc2NyaXB0cy9iZjItc3dpdGNoLW1vZGUuc2ggIiRAIgo= |
| 72 | + mode: 0755 |
| 73 | + overwrite: true |
| 74 | + path: /etc/default/switch_in_sriov_config_daemon.sh |
| 75 | + systemd: |
| 76 | + units: |
| 77 | + - name: dpu-switch.service |
| 78 | + enabled: true |
| 79 | + contents: | |
| 80 | + [Unit] |
| 81 | + Description=Switch BlueField2 card to NIC/DPU mode |
| 82 | + RequiresMountsFor=%t/containers |
| 83 | + Wants=network.target |
| 84 | + After=network-online.target kubelet.service |
| 85 | + [Service] |
| 86 | + SuccessExitStatus=0 120 |
| 87 | + RemainAfterExit=True |
| 88 | + ExecStart=/bin/bash -c '/etc/default/switch_in_sriov_config_daemon.sh nic || shutdown -r now' <1> |
| 89 | + Type=oneshot |
| 90 | + [Install] |
| 91 | + WantedBy=multi-user.target |
| 92 | +---- |
| 93 | +<1> Optional: The PCI address of a specific card can optionally be specified, for example `ExecStart=/bin/bash -c '/etc/default/switch_in_sriov_config_daemon.sh nic 0000:5e:00.0 || echo done'`. By default, the first device is selected. If there is more than one device, you must specify which PCI address to be used. The PCI address must be the same on all nodes that are switching Bluefield-2 from DPU mode to NIC mode. |
| 94 | + |
| 95 | +. Wait for the worker nodes to restart. After restarting, the Bluefield-2 network device on the worker nodes is switched into NIC mode. |
0 commit comments