-
Notifications
You must be signed in to change notification settings - Fork 185
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix parsing of PCI domains longer than 4 digits #373
Conversation
Signed-off-by: Ian Bishop <[email protected]>
pkg/pci/address/address.go
Outdated
@@ -13,7 +13,7 @@ import ( | |||
|
|||
var ( | |||
regexAddress *regexp.Regexp = regexp.MustCompile( | |||
`^(([0-9a-f]{0,4}):)?([0-9a-f]{2}):([0-9a-f]{2})\.([0-9a-f]{1})$`, | |||
`^(([0-9a-f]{0,8}):)?([0-9a-f]{2}):([0-9a-f]{2})\.([0-9a-f]{1})$`, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ianb-mp OK, so to be fully compliant with the PCI-X spec, I believe this needs to be:
^(1?)(([0-9a-f]{0,4}):)?([0-9a-f]{2}):([0-9a-f]{2})\.([0-9a-f]{1})$
Because, according to my research, the domain part of the PCI address is 4 hexadigits OR a 1
followed by 4 hexadigits (for the cases where the PCI extension configuration space is used)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok, I've pushed another commit with that change however moved the 1?
inside the existing capture group. I also added a test.
ccca41a
to
e38d615
Compare
Signed-off-by: Ian Bishop <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome, thank you @ianb-mp !
See: jaypipes/ghw#373 Signed-off-by: Ian Bishop <[email protected]>
Allow parsing of PCI addresses like
10001:80:05.0
where the domain component is longer than 4 digits.The domain component should be able to handle values up to 32 bits - see: https://patches.dpdk.org/project/dpdk/patch/[email protected]/
Fixes #372