Rename pci to PCI in various places

Signed-off-by: Tuomas Katila <tuomas.katila@intel.com>
This commit is contained in:
Tuomas Katila 2024-08-20 14:52:37 +03:00 committed by Ukri Niemimuukko
parent 63a10352d8
commit fc2dce588c
5 changed files with 11 additions and 11 deletions

View File

@ -218,14 +218,14 @@ func (dp *devicePlugin) pciAddressForCard(cardPath, cardName string) (string, er
return "", err
}
// Fetches the pci address for a drm card by reading the
// Fetches the PCI address for a drm card by reading the
// symbolic link that the /sys/class/drm/cardX points to.
// ../../devices/pci0000:00/0000:00:02.0/drm/card
// -------------------------^^^^^^^^^^^^---------.
pciAddress := filepath.Base(strings.TrimSuffix(linkPath, filepath.Join("drm", cardName)))
if !dp.pciAddressReg.MatchString(pciAddress) {
klog.Warningf("Invalid pci address for %s: %s", cardPath, pciAddress)
klog.Warningf("Invalid PCI address for %s: %s", cardPath, pciAddress)
return "", os.ErrInvalid
}

View File

@ -153,7 +153,7 @@ func createTestFiles(root string, tc TestCaseDetails) (string, string, error) {
if len(tc.pciAddresses) > 0 {
if err := os.MkdirAll(filepath.Join(sysfs, ".devices"), 0750); err != nil {
return "", "", errors.Wrap(err, "Failed to create fake pci address base")
return "", "", errors.Wrap(err, "Failed to create fake PCI address base")
}
for pci, card := range tc.pciAddresses {
@ -161,7 +161,7 @@ func createTestFiles(root string, tc TestCaseDetails) (string, string, error) {
cardPath := filepath.Join(sysfs, card)
if err := os.MkdirAll(fullPci, 0750); err != nil {
return "", "", errors.Wrap(err, "Failed to create fake pci address entry")
return "", "", errors.Wrap(err, "Failed to create fake PCI address entry")
}
if err := os.MkdirAll(cardPath, 0750); err != nil {
@ -169,7 +169,7 @@ func createTestFiles(root string, tc TestCaseDetails) (string, string, error) {
}
if err := os.Symlink(fullPci, filepath.Join(sysfs, card, "device")); err != nil {
return "", "", errors.Wrap(err, "Failed to create fake pci address symlinks")
return "", "", errors.Wrap(err, "Failed to create fake PCI address symlinks")
}
}
}
@ -840,7 +840,7 @@ func createBypathTestFiles(t *testing.T, card, root, linkFile string, bypathFile
}
if err := os.Symlink(devPath, drmPath); err != nil {
t.Fatal("Couldn't create symlink between pci path and sysfs drm path")
t.Fatal("Couldn't create symlink between PCI path and sysfs drm path")
}
}
@ -886,7 +886,7 @@ func TestBypath(t *testing.T) {
0,
},
{
"invalid pci address",
"invalid PCI address",
"00.10.2/00.334.302/0.0.1.00/000:ff:05.1/drm/" + cardName,
[]string{"pci-0000:0f:05.0-card", "pci-0000:0f:05.0-render"},
false,

View File

@ -57,7 +57,7 @@ The `numa-gpu-map` label is a list of numa to gpu mapping items separated by `_`
### PCI-groups (optional)
GPUs which share the same pci paths under `/sys/devices/pci*` can be grouped into a label. GPU nums are separated by '`.`' and
GPUs which share the same PCI paths under `/sys/devices/pci*` can be grouped into a label. GPU nums are separated by '`.`' and
groups are separated by '`_`'. The label is created only if environment variable named `GPU_PCI_GROUPING_LEVEL` has a value greater
than zero. GPUs are considered to belong to the same group, if as many identical folder names are found for the GPUs, as is the value
of the environment variable. Counting starts from the folder name which starts with `pci`.
@ -70,7 +70,7 @@ name | type | description|
|`gpu.intel.com/pci-groups`| string | list of pci-groups separated by '`_`'. GPU numbers in the groups are separated by '`.`'. The numbers correspond to device file numbers for the primary nodes of given GPUs in kernel DRI subsystem, listed as `/dev/dri/card<num>` in devfs, and `/sys/class/drm/card<num>` in sysfs.
If the value of the `pci-groups` label would not fit into the 63 character length limit, you will also get labels `pci-groups2`,
`pci-groups3`... until all the pci groups have been labeled.
`pci-groups3`... until all the PCI groups have been labeled.
### Limitations

View File

@ -274,7 +274,7 @@ func (lm labelMap) addSplittableString(labelBase, fullValue string) {
}
}
// this returns pci groups label value, groups separated by "_", gpus separated by ".".
// this returns PCI groups label value, groups separated by "_", gpus separated by ".".
// Example for two groups with 4 gpus: "0.1.2.3_4.5.6.7".
func (l *labeler) createPCIGroupLabel(gpuNumList []string) string {
pciGroups := map[string][]string{}

View File

@ -791,7 +791,7 @@ func TestL0ServiceUse(t *testing.T) {
err = os.MkdirAll(pciAddr, 0750)
if err != nil {
t.Fatalf("couldn't create pci dir: %s", err.Error())
t.Fatalf("couldn't create PCI dir: %s", err.Error())
}
err = os.MkdirAll(cardPath, 0750)