Skip to content

Commit

Permalink
Add 'IB VF GUID Configuration' design doc
Browse files Browse the repository at this point in the history
Signed-off-by: amaslennikov <[email protected]>
  • Loading branch information
almaslennikov committed Mar 11, 2024
1 parent 82a6d6f commit e69cac9
Showing 1 changed file with 72 additions and 0 deletions.
72 changes: 72 additions & 0 deletions doc/design/ib-vf-configuration.md
Original file line number Diff line number Diff line change
@@ -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": "<pci_address_1>",
"guids": [
"02:00:00:00:00:00:00:00",
"02:00:00:00:00:00:00:01"
]
},
{
"pf_guid": "<pf_guid_2>",
"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.

0 comments on commit e69cac9

Please sign in to comment.