|
| 1 | +// Module included in the following assemblies: |
| 2 | +// |
| 3 | +// * post_installation_configuration/network-configuration.adoc |
| 4 | + |
| 5 | +:_content-type: PROCEDURE |
| 6 | +[id="nw-osp-enabling-ovs-offload_{context}"] |
| 7 | += Enabling OVS hardware offloading |
| 8 | + |
| 9 | +For clusters that run on {rh-openstack-first}, you can enable link:https://www.openvswitch.org/[Open vSwitch (OVS)] hardware offloading. |
| 10 | + |
| 11 | +OVS is a multi-layer virtual switch that enables large-scale, multi-server network virtualization. |
| 12 | + |
| 13 | +.Prerequisites |
| 14 | + |
| 15 | +* You installed a cluster on {rh-openstack} that is configured for single-root input/output virtualization (SR-IOV). |
| 16 | +* You installed the SR-IOV Network Operator on your cluster. |
| 17 | +* You created two `hw-offload` type virtual function (VF) interfaces on your cluster. |
| 18 | +
|
| 19 | +.Procedure |
| 20 | + |
| 21 | +. From a command line, enter the following command to disable the admission webhook: |
| 22 | ++ |
| 23 | +[source,terminal] |
| 24 | +---- |
| 25 | +$ oc patch sriovoperatorconfig default --type=merge -n openshift-sriov-network-operator --patch '{ "spec": { "enableOperatorWebhook": false } }' |
| 26 | +---- |
| 27 | + |
| 28 | +. Create an `SriovNetworkNodePolicy` policy for the two `hw-offload` type VF interfaces that are on your cluster: |
| 29 | ++ |
| 30 | +.The first virtual function interface |
| 31 | +[source,yaml] |
| 32 | +---- |
| 33 | +apiVersion: sriovnetwork.openshift.io/v1 |
| 34 | +kind: SriovNetworkNodePolicy <1> |
| 35 | +metadata: |
| 36 | + name: "hwoffload9" |
| 37 | + namespace: openshift-sriov-network-operator |
| 38 | +spec: |
| 39 | + deviceType: netdevice |
| 40 | + isRdma: true |
| 41 | + nicSelector: |
| 42 | + pfNames: <2> |
| 43 | + - ens6 |
| 44 | + nodeSelector: |
| 45 | + feature.node.kubernetes.io/network-sriov.capable: 'true' |
| 46 | + numVfs: 1 |
| 47 | + priority: 99 |
| 48 | + resourceName: "hwoffload9" |
| 49 | +---- |
| 50 | +<1> Insert the `SriovNetworkNodePolicy` value here. |
| 51 | +<2> Both interfaces must include physical function (PF) names. |
| 52 | ++ |
| 53 | +.The second virtual function interface |
| 54 | +[source,yaml] |
| 55 | +---- |
| 56 | +apiVersion: sriovnetwork.openshift.io/v1 |
| 57 | +kind: SriovNetworkNodePolicy <1> |
| 58 | +metadata: |
| 59 | + name: "hwoffload10" |
| 60 | + namespace: openshift-sriov-network-operator |
| 61 | +spec: |
| 62 | + deviceType: netdevice |
| 63 | + isRdma: true |
| 64 | + nicSelector: |
| 65 | + pfNames: <2> |
| 66 | + - ens5 |
| 67 | + nodeSelector: |
| 68 | + feature.node.kubernetes.io/network-sriov.capable: 'true' |
| 69 | + numVfs: 1 |
| 70 | + priority: 99 |
| 71 | + resourceName: "hwoffload10" |
| 72 | +---- |
| 73 | +<1> Insert the `SriovNetworkNodePolicy` value here. |
| 74 | +<2> Both interfaces must include physical function (PF) names. |
| 75 | + |
| 76 | +. Create `NetworkAttachmentDefinition` resources for the two interfaces: |
| 77 | ++ |
| 78 | +.A `NetworkAttachmentDefinition` resource for the first interface |
| 79 | +[source,yaml] |
| 80 | +---- |
| 81 | +apiVersion: k8s.cni.cncf.io/v1 |
| 82 | +kind: NetworkAttachmentDefinition |
| 83 | +metadata: |
| 84 | + annotations: |
| 85 | + k8s.v1.cni.cncf.io/resourceName: openshift.io/hwoffload9 |
| 86 | + name: hwoffload9 |
| 87 | + namespace: default |
| 88 | +spec: |
| 89 | + config: '{ "cniVersion":"0.3.1", "name":"hwoffload9","type":"host-device","device":"ens6" |
| 90 | + }' |
| 91 | +---- |
| 92 | ++ |
| 93 | +.A `NetworkAttachmentDefinition` resource for the second interface |
| 94 | +[source,yaml] |
| 95 | +---- |
| 96 | +apiVersion: k8s.cni.cncf.io/v1 |
| 97 | +kind: NetworkAttachmentDefinition |
| 98 | +metadata: |
| 99 | + annotations: |
| 100 | + k8s.v1.cni.cncf.io/resourceName: openshift.io/hwoffload10 |
| 101 | + name: hwoffload10 |
| 102 | + namespace: default |
| 103 | +spec: |
| 104 | + config: '{ "cniVersion":"0.3.1", "name":"hwoffload10","type":"host-device","device":"ens5" |
| 105 | + }' |
| 106 | +---- |
| 107 | + |
| 108 | +. Use the interfaces that you created with a pod. For example: |
| 109 | ++ |
| 110 | +.A pod that uses the two OVS offload interfaces |
| 111 | +[source,yaml] |
| 112 | +---- |
| 113 | +apiVersion: v1 |
| 114 | +kind: Pod |
| 115 | +metadata: |
| 116 | + name: dpdk-testpmd |
| 117 | + namespace: default |
| 118 | + annotations: |
| 119 | + irq-load-balancing.crio.io: disable |
| 120 | + cpu-quota.crio.io: disable |
| 121 | + k8s.v1.cni.cncf.io/networks: '[ |
| 122 | + { |
| 123 | + "name": "hwoffload9", |
| 124 | + "namespace": "default" |
| 125 | + }, |
| 126 | + { |
| 127 | + "name": "hwoffload10", |
| 128 | + "namespace": "default" |
| 129 | + } |
| 130 | + ]' |
| 131 | +spec: |
| 132 | + restartPolicy: Never |
| 133 | + containers: |
| 134 | + - name: dpdk-testpmd |
| 135 | + image: quay.io/krister/centos8_nfv-container-dpdk-testpmd:latest |
| 136 | +---- |
0 commit comments