From b70bc1307681396e9866167277ab9ff8e0a4dd14 Mon Sep 17 00:00:00 2001 From: Elisamara Aoki Goncalves Date: Fri, 29 Apr 2022 17:24:11 -0300 Subject: [PATCH] Document how to set VF MTU (r5, r6, dsR6) Added example to show how to create SR-IOV network with MTU of 1950. Added ref of the example in note. Signed-off-by: Elisamara Aoki Goncalves Change-Id: I2e43559165ce3e34b72e45027df5ba44db0eb5c1 --- .../adding-data-networks-using-the-cli.rst | 11 +++- ...reating-network-attachment-definitions.rst | 59 +++++++++++++++---- 2 files changed, 57 insertions(+), 13 deletions(-) diff --git a/doc/source/datanet/kubernetes/adding-data-networks-using-the-cli.rst b/doc/source/datanet/kubernetes/adding-data-networks-using-the-cli.rst index a9be4d3bb..0819c5b44 100644 --- a/doc/source/datanet/kubernetes/adding-data-networks-using-the-cli.rst +++ b/doc/source/datanet/kubernetes/adding-data-networks-using-the-cli.rst @@ -27,11 +27,18 @@ pci-passthrough interface. A description of the data network. **** - The MTU of the data network. + The |MTU| of the data network. .. note:: + To attach to the data network, data interfaces must be configured - with an equal or larger MTU. + with an equal or larger |MTU|. + + This is not used by the Kubernetes |SRIOV| plugin. In order to + address the |MTU| in Kubernetes, the network attached definiition + needs to use the tuning plugin. For more details, see the examples + in :ref:`Create Network Attachment Definitions + `. **** The port of the data network. diff --git a/doc/source/usertasks/kubernetes/creating-network-attachment-definitions.rst b/doc/source/usertasks/kubernetes/creating-network-attachment-definitions.rst index 2d85f1bbb..6d339df60 100644 --- a/doc/source/usertasks/kubernetes/creating-network-attachment-definitions.rst +++ b/doc/source/usertasks/kubernetes/creating-network-attachment-definitions.rst @@ -7,7 +7,7 @@ Create Network Attachment Definitions ===================================== Network attachment definition specifications must be created in order to -reference / request an SR-IOV interface in a container specification. +reference / request an |SRIOV| interface in a container specification. .. rubric:: |context| @@ -20,13 +20,13 @@ container as shown in :ref:`Using Network Attachment Definitions in a Container .. rubric:: |prereq| -You must have configured at least one SR-IOV interface on a host with the +You must have configured at least one |SRIOV| interface on a host with the target datanetwork \(**datanet-a** or **datanet-b** in the example below\) assigned to it before creating a **NetworkAttachmentDefinition** referencing this data network. .. note:: - The configuration for this SR-IOV interface with either a ``netdevice`` or + The configuration for this |SRIOV| interface with either a ``netdevice`` or ``vfio`` vf-driver determines whether the **NetworkAttachmentDefinition** will be a kernel network device or a DPDK network device. @@ -34,7 +34,7 @@ this data network. .. _creating-network-attachment-definitions-steps-unordered-tbf-53z-hjb: -#. Create a simple SR-IOV network attachment definition file called net1.yaml +#. Create a simple |SRIOV| network attachment definition file called net1.yaml associated with the data network **datanet-a**. .. code-block:: yaml @@ -58,9 +58,9 @@ this data network. This **NetworkAttachmentDefinition** is valid for both a kernel-based and a DPDK \(vfio\) based device. -#. Create an SR-IOV network attachment. +#. Create an |SRIOV| network attachment. - - The following example creates an SR-IOV network attachment definition + - The following example creates an |SRIOV| network attachment definition configured for a VLAN with an ID of 2000. .. code-block:: none @@ -80,7 +80,7 @@ this data network. }' EOF - - The following example creates an SR-IOV network attachment definition + - The following example creates an |SRIOV| network attachment definition configured with IP Address information. .. code-block:: none @@ -117,10 +117,47 @@ this data network. }' EOF + + - The following example creates an |SRIOV| network attachment definition + configured with a static IP address and |MTU| of 1950. + + .. code-block:: none + + ~(keystone_admin)]$ cat < net4.yaml + apiVersion: k8s.cni.cncf.io/v1 + kind: NetworkAttachmentDefinition + metadata: + name: net4 + annotations: + k8s.v1.cni.cncf.io/resourceName: intel.com/pci_sriov_net_datanet_b + spec: + config: '{ + "cniVersion": "0.3.0", + "plugins": + [ + { + "type": "sriov", + "ipam": { + "type": "static", + "addresses": [ + { + "address": "192.168.1.2/16" + } + ] + } + }, + { + "type": "tuning", + "mtu": 1950 + } + ] + }' + EOF + .. rubric:: |result| -After SR-IOV interfaces have been provisioned and the hosts labeled and -unlocked, available SR-IOV VF resources are automatically advertised. +After |SRIOV| interfaces have been provisioned and the hosts labeled and +unlocked, available |SRIOV| VF resources are automatically advertised. They can be referenced in subsequent |prod| operations using the appropriate **NetworkAttachmentDefinition** name and the following extended resource name: @@ -145,8 +182,8 @@ would be: - The extended resource name will convert all dashes \('-'\) in the data network name into underscores \('\_'\). -- SR-IOV enabled interfaces using the netdevice VF driver must be - administratively and operationally up to be advertised by the SR-IOV +- |SRIOV| enabled interfaces using the netdevice VF driver must be + administratively and operationally up to be advertised by the |SRIOV| device plugin. - If multiple data networks are assigned to an interface, the VFs