Skip to content

Commit fc2dce5

Browse files
tkatilauniemimu
authored andcommitted
Rename pci to PCI in various places
Signed-off-by: Tuomas Katila <[email protected]>
1 parent 63a1035 commit fc2dce5

File tree

5 files changed

+11
-11
lines changed

5 files changed

+11
-11
lines changed

cmd/gpu_plugin/gpu_plugin.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -218,14 +218,14 @@ func (dp *devicePlugin) pciAddressForCard(cardPath, cardName string) (string, er
218218
return "", err
219219
}
220220

221-
// Fetches the pci address for a drm card by reading the
221+
// Fetches the PCI address for a drm card by reading the
222222
// symbolic link that the /sys/class/drm/cardX points to.
223223
// ../../devices/pci0000:00/0000:00:02.0/drm/card
224224
// -------------------------^^^^^^^^^^^^---------.
225225
pciAddress := filepath.Base(strings.TrimSuffix(linkPath, filepath.Join("drm", cardName)))
226226

227227
if !dp.pciAddressReg.MatchString(pciAddress) {
228-
klog.Warningf("Invalid pci address for %s: %s", cardPath, pciAddress)
228+
klog.Warningf("Invalid PCI address for %s: %s", cardPath, pciAddress)
229229

230230
return "", os.ErrInvalid
231231
}

cmd/gpu_plugin/gpu_plugin_test.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -153,23 +153,23 @@ func createTestFiles(root string, tc TestCaseDetails) (string, string, error) {
153153

154154
if len(tc.pciAddresses) > 0 {
155155
if err := os.MkdirAll(filepath.Join(sysfs, ".devices"), 0750); err != nil {
156-
return "", "", errors.Wrap(err, "Failed to create fake pci address base")
156+
return "", "", errors.Wrap(err, "Failed to create fake PCI address base")
157157
}
158158

159159
for pci, card := range tc.pciAddresses {
160160
fullPci := filepath.Join(sysfs, ".devices", pci)
161161
cardPath := filepath.Join(sysfs, card)
162162

163163
if err := os.MkdirAll(fullPci, 0750); err != nil {
164-
return "", "", errors.Wrap(err, "Failed to create fake pci address entry")
164+
return "", "", errors.Wrap(err, "Failed to create fake PCI address entry")
165165
}
166166

167167
if err := os.MkdirAll(cardPath, 0750); err != nil {
168168
return "", "", errors.Wrap(err, "Failed to create fake card entry")
169169
}
170170

171171
if err := os.Symlink(fullPci, filepath.Join(sysfs, card, "device")); err != nil {
172-
return "", "", errors.Wrap(err, "Failed to create fake pci address symlinks")
172+
return "", "", errors.Wrap(err, "Failed to create fake PCI address symlinks")
173173
}
174174
}
175175
}
@@ -840,7 +840,7 @@ func createBypathTestFiles(t *testing.T, card, root, linkFile string, bypathFile
840840
}
841841

842842
if err := os.Symlink(devPath, drmPath); err != nil {
843-
t.Fatal("Couldn't create symlink between pci path and sysfs drm path")
843+
t.Fatal("Couldn't create symlink between PCI path and sysfs drm path")
844844
}
845845
}
846846

@@ -886,7 +886,7 @@ func TestBypath(t *testing.T) {
886886
0,
887887
},
888888
{
889-
"invalid pci address",
889+
"invalid PCI address",
890890
"00.10.2/00.334.302/0.0.1.00/000:ff:05.1/drm/" + cardName,
891891
[]string{"pci-0000:0f:05.0-card", "pci-0000:0f:05.0-render"},
892892
false,

cmd/gpu_plugin/labels.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ The `numa-gpu-map` label is a list of numa to gpu mapping items separated by `_`
5757

5858
### PCI-groups (optional)
5959

60-
GPUs which share the same pci paths under `/sys/devices/pci*` can be grouped into a label. GPU nums are separated by '`.`' and
60+
GPUs which share the same PCI paths under `/sys/devices/pci*` can be grouped into a label. GPU nums are separated by '`.`' and
6161
groups are separated by '`_`'. The label is created only if environment variable named `GPU_PCI_GROUPING_LEVEL` has a value greater
6262
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
6363
of the environment variable. Counting starts from the folder name which starts with `pci`.
@@ -70,7 +70,7 @@ name | type | description|
7070
|`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.
7171

7272
If the value of the `pci-groups` label would not fit into the 63 character length limit, you will also get labels `pci-groups2`,
73-
`pci-groups3`... until all the pci groups have been labeled.
73+
`pci-groups3`... until all the PCI groups have been labeled.
7474

7575
### Limitations
7676

cmd/internal/labeler/labeler.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,7 @@ func (lm labelMap) addSplittableString(labelBase, fullValue string) {
274274
}
275275
}
276276

277-
// this returns pci groups label value, groups separated by "_", gpus separated by ".".
277+
// this returns PCI groups label value, groups separated by "_", gpus separated by ".".
278278
// Example for two groups with 4 gpus: "0.1.2.3_4.5.6.7".
279279
func (l *labeler) createPCIGroupLabel(gpuNumList []string) string {
280280
pciGroups := map[string][]string{}

cmd/internal/labeler/labeler_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -791,7 +791,7 @@ func TestL0ServiceUse(t *testing.T) {
791791

792792
err = os.MkdirAll(pciAddr, 0750)
793793
if err != nil {
794-
t.Fatalf("couldn't create pci dir: %s", err.Error())
794+
t.Fatalf("couldn't create PCI dir: %s", err.Error())
795795
}
796796

797797
err = os.MkdirAll(cardPath, 0750)

0 commit comments

Comments
 (0)