diff --git a/pkg/pci/address/address.go b/pkg/pci/address/address.go index 65e8cca..5997bab 100644 --- a/pkg/pci/address/address.go +++ b/pkg/pci/address/address.go @@ -13,7 +13,7 @@ import ( var ( regexAddress *regexp.Regexp = regexp.MustCompile( - `^(([0-9a-f]{0,8}):)?([0-9a-f]{2}):([0-9a-f]{2})\.([0-9a-f]{1})$`, + `^((1?[0-9a-f]{0,4}):)?([0-9a-f]{2}):([0-9a-f]{2})\.([0-9a-f]{1})$`, ) ) diff --git a/pkg/pci/address/address_test.go b/pkg/pci/address/address_test.go index daf0eaa..9167ff7 100644 --- a/pkg/pci/address/address_test.go +++ b/pkg/pci/address/address_test.go @@ -62,6 +62,16 @@ func TestPCIAddressFromString(t *testing.T) { Function: "a", }, }, + { + // PCI-X / PCI Express extentions may use 5-digit domain + addrStr: "10000:03:00.A", + expected: &pciaddr.Address{ + Domain: "10000", + Bus: "03", + Device: "00", + Function: "a", + }, + }, } for x, test := range tests { got := pciaddr.FromString(test.addrStr)