From 1b271d2c31f221e276b929c27a224ef159b8d80d Mon Sep 17 00:00:00 2001 From: Zenghui Shi Date: Thu, 7 Jan 2021 12:55:20 +0800 Subject: [PATCH 1/2] Add SR-IOV doc for shift-on-stack --- .../nw-sriov-networknodepolicy-object.adoc | 47 ++++++++++++++++--- 1 file changed, 41 insertions(+), 6 deletions(-) diff --git a/modules/nw-sriov-networknodepolicy-object.adoc b/modules/nw-sriov-networknodepolicy-object.adoc index 60fe3cfeec7c..eebe0557f626 100644 --- a/modules/nw-sriov-networknodepolicy-object.adoc +++ b/modules/nw-sriov-networknodepolicy-object.adoc @@ -28,9 +28,10 @@ spec: deviceID: "" <10> pfNames: ["", ...] <11> rootDevices: ["", "..."] <12> - deviceType: <13> - isRdma: false <14> - linkType: <15> + netFilter: "" <13> + deviceType: <14> + isRdma: false <15> + linkType: <16> ---- <1> The name for the CR object. @@ -60,14 +61,21 @@ If you specify both `pfNames` and `rootDevices` at the same time, ensure that th <12> An array of one or more PCI bus addresses for the PF of the device. Provide the address in the following format: `0000:02:00.1`. -<13> Optional: The driver type for the virtual functions. The only allowed values are `netdevice` and `vfio-pci`. The default value is `netdevice`. +<13> Optional: The platform specific filter string. The only supported platform is `openstack` and allowed value is `openstack/NetworkID:xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx`. ++ +[NOTE] +==== +`xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx` is the `network_id` from `/var/config/openstack/latest/network_data.json` metadata file. +==== + +<14> Optional: The driver type for the virtual functions. The only allowed values are `netdevice` and `vfio-pci`. The default value is `netdevice`. + [NOTE] ==== For a Mellanox card to work in Data Plane Development Kit (DPDK) mode on bare metal nodes, use the `netdevice` driver type and set `isRdma` to `true`. ==== -<14> Optional: Whether to enable remote direct memory access (RDMA) mode. The default value is `false`. +<15> Optional: Whether to enable remote direct memory access (RDMA) mode. The default value is `false`. + [NOTE] ==== @@ -75,7 +83,7 @@ If the `isRDMA` parameter is set to `true`, you can continue to use the RDMA ena A device can be used in either mode. ==== -<15> Optional: The link type for the VFs. You can specify one of the following values: `eth` or `ib`. `eth` is ethernet and `ib` is InfiniBand. The default value is `eth` if it is not explicitly set. When `linkType` is set to `ib`, `isRdma` will be set to `true` by SR-IOV Network Operator webhook automatically. When `linkType` is set to `ib`, `deviceType` should not be set to `vfio-pci`. +<16> Optional: The link type for the VFs. You can specify one of the following values: `eth` or `ib`. `eth` is ethernet and `ib` is InfiniBand. The default value is `eth` if it is not explicitly set. When `linkType` is set to `ib`, `isRdma` will be set to `true` by SR-IOV Network Operator webhook automatically. When `linkType` is set to `ib`, `deviceType` should not be set to `vfio-pci`. [id="sr-iov-network-node-configuration-examples_{context}"] == SR-IOV network node configuration examples @@ -103,3 +111,30 @@ spec: linkType: ib isRdma: true ---- + +The following example describes the configuration for a SR-IOV device in OpenStack Virtual Machine: + +.Example configuration for a SR-IOV device in Virtual Machine +[source,yaml] +---- +apiVersion: sriovnetwork.openshift.io/v1 +kind: SriovNetworkNodePolicy +metadata: + name: policy-sriov-net-openstack-1 + namespace: openshift-sriov-network-operator +spec: + resourceName: sriovnic1 + nodeSelector: + feature.node.kubernetes.io/network-sriov.capable: "true" + numVfs: 1 + nicSelector: + vendor: "15b3" + deviceID: "101b" + netFilter: "openstack/NetworkID:ea24bd04-8674-4f69-b0ee-fa0b3bd20509" +---- + +[NOTE] +==== +`numVfs` parameter is always set to `1` when configuring SR-IOV node policy in a Virtual Machine enviroment. For example: OpenShift on OpenStack. `netFilter` is a filter sting that may vary on different platforms, it refers to Network ID on openstack platform. `netFilter` value can be observed from `sriovnetworknodestate` in a supported platform. +==== + From b44901ccd3e2e611116f31fccc052452f011d73a Mon Sep 17 00:00:00 2001 From: Jason Boxman Date: Thu, 7 Jan 2021 21:25:37 -0500 Subject: [PATCH 2/2] Apply edits --- .../nw-sriov-networknodepolicy-object.adoc | 23 +++++++------------ 1 file changed, 8 insertions(+), 15 deletions(-) diff --git a/modules/nw-sriov-networknodepolicy-object.adoc b/modules/nw-sriov-networknodepolicy-object.adoc index eebe0557f626..dab7a32d8ec6 100644 --- a/modules/nw-sriov-networknodepolicy-object.adoc +++ b/modules/nw-sriov-networknodepolicy-object.adoc @@ -28,7 +28,7 @@ spec: deviceID: "" <10> pfNames: ["", ...] <11> rootDevices: ["", "..."] <12> - netFilter: "" <13> + netFilter: "" <13> deviceType: <14> isRdma: false <15> linkType: <16> @@ -61,12 +61,7 @@ If you specify both `pfNames` and `rootDevices` at the same time, ensure that th <12> An array of one or more PCI bus addresses for the PF of the device. Provide the address in the following format: `0000:02:00.1`. -<13> Optional: The platform specific filter string. The only supported platform is `openstack` and allowed value is `openstack/NetworkID:xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx`. -+ -[NOTE] -==== -`xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx` is the `network_id` from `/var/config/openstack/latest/network_data.json` metadata file. -==== +<13> Optional: The platform specific filter string. The only supported platform is {rh-openstack-first}. Acceptable values are of the following format: `openstack/NetworkID:xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx`. Replace `xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx` with the value from the `/var/config/openstack/latest/network_data.json` metadata file. <14> Optional: The driver type for the virtual functions. The only allowed values are `netdevice` and `vfio-pci`. The default value is `netdevice`. + @@ -112,9 +107,9 @@ spec: isRdma: true ---- -The following example describes the configuration for a SR-IOV device in OpenStack Virtual Machine: +The following example describes the configuration for an SR-IOV device in a {rh-openstack} virtual machine: -.Example configuration for a SR-IOV device in Virtual Machine +.Example configuration for an SR-IOV device in a virtual machine [source,yaml] ---- apiVersion: sriovnetwork.openshift.io/v1 @@ -126,15 +121,13 @@ spec: resourceName: sriovnic1 nodeSelector: feature.node.kubernetes.io/network-sriov.capable: "true" - numVfs: 1 + numVfs: 1 <1> nicSelector: vendor: "15b3" deviceID: "101b" - netFilter: "openstack/NetworkID:ea24bd04-8674-4f69-b0ee-fa0b3bd20509" + netFilter: "openstack/NetworkID:ea24bd04-8674-4f69-b0ee-fa0b3bd20509" <2> ---- -[NOTE] -==== -`numVfs` parameter is always set to `1` when configuring SR-IOV node policy in a Virtual Machine enviroment. For example: OpenShift on OpenStack. `netFilter` is a filter sting that may vary on different platforms, it refers to Network ID on openstack platform. `netFilter` value can be observed from `sriovnetworknodestate` in a supported platform. -==== +<1> The `numVfs` field is always set to `1` when configuring the node network policy in a virtual machine environment. +<2> On {rh-openstack} the `netFilter` field must refer to a network ID. Valid values for `netFilter` are available from a `SriovNetworkNodeState` object.