|
2 | 2 | // |
3 | 3 | // * networking/hardware_networks/configuring-sriov-device.adoc |
4 | 4 |
|
| 5 | +:_mod-docs-content-type: PROCEDURE |
5 | 6 | [id="nw-sriov-nic-mlx-secure-boot_{context}"] |
6 | | -= MLX Secure Boot |
| 7 | += Configuring the SR-IOV Network Operator on Mellanox cards when Secure Boot is enabled |
7 | 8 |
|
8 | | -In some cases, you might want to split virtual functions (VFs) from the same physical function (PF) into multiple resource pools. |
9 | | -For example, you might want some of the VFs to load with the default driver and the remaining VFs load with the `vfio-pci` driver. |
10 | | -In such a deployment, the `pfNames` selector in your SriovNetworkNodePolicy custom resource (CR) can be used to specify a range of VFs for a pool using the following format: `<pfname>#<first_vf>-<last_vf>`. |
| 9 | +The SR-IOV Network Operator supports an option to skip the firmware configuration for Mellanox (MLX) devices. It is currently the only way to create virtual functions by using the SR-IOV Network Operator, if the system has secure boot enabled. You are required to manually configure and allocate the number of virtual functions in the firmware before switching the system to secure boot. |
11 | 10 |
|
12 | | -For example, the following YAML shows the selector for an interface named `netpf0` with VF `2` through `7`: |
| 11 | +[NOTE] |
| 12 | +==== |
| 13 | +The number of virtual functions in the firmware are the maximum number of virtual functions that you can request in the policy. |
| 14 | +==== |
13 | 15 |
|
14 | | -[source,yaml] |
15 | | ----- |
16 | | -pfNames: ["netpf0#2-7"] |
17 | | ----- |
18 | | - |
19 | | -* `netpf0` is the PF interface name. |
20 | | -* `2` is the first VF index (0-based) that is included in the range. |
21 | | -* `7` is the last VF index (0-based) that is included in the range. |
22 | | - |
23 | | -You can select VFs from the same PF by using different policy CRs if the following requirements are met: |
| 16 | +.Procedure |
24 | 17 |
|
25 | | -* The `numVfs` value must be identical for policies that select the same PF. |
26 | | -* The VF index must be in the range of `0` to `<numVfs>-1`. For example, if you have a policy with `numVfs` set to `8`, then the `<first_vf>` value must not be smaller than `0`, and the `<last_vf>` must not be larger than `7`. |
27 | | -* The VFs ranges in different policies must not overlap. |
28 | | -* The `<first_vf>` must not be larger than the `<last_vf>`. |
| 18 | +. Configure the virtual functions (VFs): |
29 | 19 |
|
30 | | -The following example illustrates NIC partitioning for an SR-IOV device. |
31 | | - |
32 | | -The policy `policy-net-1` defines a resource pool `net-1` that contains the VF `0` of PF `netpf0` with the default VF driver. |
33 | | -The policy `policy-net-1-dpdk` defines a resource pool `net-1-dpdk` that contains the VF `8` to `15` of PF `netpf0` with the `vfio` VF driver. |
34 | | - |
35 | | -Policy `policy-net-1`: |
36 | | - |
37 | | -[source,yaml] |
| 20 | +.. Run the following command when the system is without a secure boot when using the sriov-config daemon: |
| 21 | ++ |
| 22 | +[source,terminal] |
38 | 23 | ---- |
39 | | -apiVersion: sriovnetwork.openshift.io/v1 |
40 | | -kind: SriovNetworkNodePolicy |
41 | | -metadata: |
42 | | - name: policy-net-1 |
43 | | - namespace: openshift-sriov-network-operator |
44 | | -spec: |
45 | | - resourceName: net1 |
46 | | - nodeSelector: |
47 | | - feature.node.kubernetes.io/network-sriov.capable: "true" |
48 | | - numVfs: 16 |
49 | | - nicSelector: |
50 | | - pfNames: ["netpf0#0-0"] |
51 | | - deviceType: netdevice |
| 24 | +$ mstconfig -d -0001:b1:00.1 set SRIOV_EN=1 NUM_OF_VFS=16 <1> <2> |
52 | 25 | ---- |
| 26 | +<1> The `SRIOV_EN` environment variable enables the SR-IOV Network Operator support on the Mellanox card. |
| 27 | +<2> The `NUM_OF_VFS` environment variable specifies the number of virtual functions to enable in the firmware. |
53 | 28 |
|
54 | | -Policy `policy-net-1-dpdk`: |
55 | | - |
| 29 | +. Configure the SR-IOV Network Operator by disabling the Mellanox plugin. See the following `SriovOperatorConfig` example configuration: |
| 30 | ++ |
56 | 31 | [source,yaml] |
57 | 32 | ---- |
58 | 33 | apiVersion: sriovnetwork.openshift.io/v1 |
59 | | -kind: SriovNetworkNodePolicy |
| 34 | +kind: SriovOperatorConfig |
60 | 35 | metadata: |
61 | | - name: policy-net-1-dpdk |
| 36 | + name: default |
62 | 37 | namespace: openshift-sriov-network-operator |
63 | 38 | spec: |
64 | | - resourceName: net1dpdk |
65 | | - nodeSelector: |
66 | | - feature.node.kubernetes.io/network-sriov.capable: "true" |
67 | | - numVfs: 16 |
68 | | - nicSelector: |
69 | | - pfNames: ["netpf0#8-15"] |
70 | | - deviceType: vfio-pci |
| 39 | + configDaemonNodeSelector: {} |
| 40 | + configurationMode: daemon |
| 41 | + disableDrain: false |
| 42 | + disablePlugins: |
| 43 | + - mellanox |
| 44 | + enableInjector: true |
| 45 | + enableOperatorWebhook: true |
| 46 | + logLevel: 2 |
71 | 47 | ---- |
72 | 48 |
|
73 | | -.Verifying that the interface is successfully partitioned |
74 | | -Confirm that the interface partitioned to virtual functions (VFs) for the SR-IOV device by running the following command. |
| 49 | +. Reboot the system to enable the virtual functions and the configuration settings. |
75 | 50 |
|
| 51 | +. Check the virtual functions (VFs) after rebooting the system by running the following command: |
| 52 | ++ |
76 | 53 | [source,terminal] |
77 | 54 | ---- |
78 | | -$ ip link show <interface> <1> |
| 55 | +$ oc -n openshift-sriov-network-operator get sriovnetworknodestate.sriovnetwork.openshift.io worker-0 -oyaml |
79 | 56 | ---- |
| 57 | ++ |
| 58 | +[source,yaml] |
| 59 | +---- |
| 60 | +- deviceID: 101d |
| 61 | + driver: mlx5_core |
| 62 | + eSwitchMode: legacy |
| 63 | + linkSpeed: -1 Mb/s |
| 64 | + linkType: ETH |
| 65 | + mac: 08:c0:eb:96:31:25 |
| 66 | + mtu: 1500 |
| 67 | + name: ens3f1np1 |
| 68 | + pciAddress: 0000:b1:00.1 <1> |
| 69 | + totalvfs: 16 |
| 70 | + vendor: 15b3 |
| 71 | +---- |
| 72 | +<1> The `totalvfs` value is the same number used in the `mstconfig` command earlier in the procedure. |
80 | 73 |
|
81 | | -<1> Replace `<interface>` with the interface that you specified when partitioning to VFs for the SR-IOV device, for example, `ens3f1`. |
| 74 | +. Enable secure boot |
| 75 | +Enabling secure boot improves your system's security by preventing unauthorized operating systems and malicious software from loading during the device's boot process. |
82 | 76 |
|
83 | | -.Example output |
| 77 | +.. Enable secure boot using the BIOS (Basic Input/Output System). |
| 78 | ++ |
84 | 79 | [source,terminal] |
85 | 80 | ---- |
86 | | -5: ens3f1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP mode DEFAULT group default qlen 1000 |
87 | | -link/ether 3c:fd:fe:d1:bc:01 brd ff:ff:ff:ff:ff:ff |
88 | | -
|
89 | | -vf 0 link/ether 5a:e7:88:25:ea:a0 brd ff:ff:ff:ff:ff:ff, spoof checking on, link-state auto, trust off |
90 | | -vf 1 link/ether 3e:1d:36:d7:3d:49 brd ff:ff:ff:ff:ff:ff, spoof checking on, link-state auto, trust off |
91 | | -vf 2 link/ether ce:09:56:97:df:f9 brd ff:ff:ff:ff:ff:ff, spoof checking on, link-state auto, trust off |
92 | | -vf 3 link/ether 5e:91:cf:88:d1:38 brd ff:ff:ff:ff:ff:ff, spoof checking on, link-state auto, trust off |
93 | | -vf 4 link/ether e6:06:a1:96:2f:de brd ff:ff:ff:ff:ff:ff, spoof checking on, link-state auto, trust off |
| 81 | +Secure Boot: Enabled |
| 82 | +Secure Boot Policy: Standard |
| 83 | +Secure Boot Mode: Mode Deployed |
94 | 84 | ---- |
| 85 | + |
| 86 | +.. Reboot the system. |
0 commit comments