Skip to content

Add function to get the PCI bus ID for a device#41

Merged
elezar merged 1 commit intoNVIDIA:mainfrom
elezar:add-get-pci-busid
Jun 17, 2024
Merged

Add function to get the PCI bus ID for a device#41
elezar merged 1 commit intoNVIDIA:mainfrom
elezar:add-get-pci-busid

Conversation

@elezar
Copy link
Member

@elezar elezar commented Jun 11, 2024

This change adds a Device function to return the PCI Bus ID for a Device.

Comment on lines +161 to +163
if id != "0000" {
id = strings.TrimPrefix(id, "0000")
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If I recall correctly, some systems had 8 leading numbers and some 4. I guess this is handling the case when there are 8 leading numbers but the first 4 are 0000. Is that correct?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes. That's correct.

Copy link

@visheshtanksale visheshtanksale left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good. Thanks for adding it.

Signed-off-by: Evan Lezar <elezar@nvidia.com>
@elezar elezar force-pushed the add-get-pci-busid branch from aa3c471 to d60aa34 Compare June 17, 2024 12:56
@elezar elezar merged commit a408243 into NVIDIA:main Jun 17, 2024
@elezar elezar deleted the add-get-pci-busid branch June 17, 2024 12:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants