From e69cac9551b50cd36cc76d28af6b4c3bda2c841d Mon Sep 17 00:00:00 2001 From: amaslennikov Date: Mon, 11 Mar 2024 19:30:29 +0300 Subject: [PATCH] Add 'IB VF GUID Configuration' design doc Signed-off-by: amaslennikov --- doc/design/ib-vf-configuration.md | 72 +++++++++++++++++++++++++++++++ 1 file changed, 72 insertions(+) create mode 100644 doc/design/ib-vf-configuration.md diff --git a/doc/design/ib-vf-configuration.md b/doc/design/ib-vf-configuration.md new file mode 100644 index 0000000000..ad32fec671 --- /dev/null +++ b/doc/design/ib-vf-configuration.md @@ -0,0 +1,72 @@ +--- +title: IB VF GUID Configuration +authors: + - almaslennikov +reviewers: + - SchSeba + - adrianchiris +creation-date: 11-03-2024 +last-updated: 11-03-2024 +--- + +# IB VF GUID Configuration + +## Summary +Allow SR-IOV Network Operator to use a static configuration file from the host filesystem to assign GUIDs to IB VFs + +## Motivation +We have customers using the SR-IOV operator to create IB VFs, and they need a way to automate GUID assignment, +so that IB VFs are automatically bound to the required PKeys and no additional manual configuration is needed. +In this use case, the GUID configuration is static and known in advance. +Now the GUIDs are assigned by the sriov-network-config-daemon randomly. + +### Use Cases + +### Goals + +* IB GUID configuration can be read from a static json file on the host +* IB GUID configuration is static and created in advance +* Static config file is available at the same path on every host + +### Non-Goals + +* Dynamic GUID allocation is out of scope of this proposal + +## Proposal + +Mount a configuration file as a part of `/host` hostPath in the config daemon and read it to retrieve the GUID configuration. + +### Workflow Description + +In the `pkg/host/internal/sriov/sriov.go:configSriovVFDevices` read from the static IB config file +and assign the GUIDs according to the configuration. Each PF is described by either PCI address +or the PF GUID and has either a list or a range of VF GUIDs. + +### Implementation Details/Notes/Constraints + +There can be less VFs created than GUIDs. To persist the dynamic nature of the SR-IOV Network operator, +it’s proposed not to return an error in this case but assign as many GUIDs as possible. +To ensure that nothing breaks when users add/remove VFs, the GUID distribution order should always be the same for each individual host. + +Example of the config file: + +```json +[ + { + "pci_adress": "", + "guids": [ + "02:00:00:00:00:00:00:00", + "02:00:00:00:00:00:00:01" + ] + }, + { + "pf_guid": "", + "rangeStart": "02:00:00:00:00:aa:00:02", + "rangeEnd": "02:00:00:00:00:aa:00:0a" + } +] +``` + +### Test Plan + +* Unit tests will be implemented for new logic. \ No newline at end of file