Browse Source

Fixed SR-IOV VF device ID parsing

Device ID is hex number, not decimal \d was changed to [A-Fa-f0-9]

Change-Id: Id9eacb19a296fb1b862325354be885373f5dd85b
Closes-Bug: #1561145
Vladimir Eremin 3 years ago
parent
commit
398bd2e9a2
No account linked to committer's email address
1 changed files with 2 additions and 2 deletions
  1. 2
    2
      agent

+ 2
- 2
agent View File

@@ -282,7 +282,7 @@ class NodeAgent
282 282
   #          IOVCtl: Enable- Migration- Interrupt- MSE- ARIHierarchy-
283 283
   #          IOVSta: Migration-
284 284
   #          Initial VFs: 8, Total VFs: 8, Number of VFs: 0, Function Dependency Link: 01
285
-  #          VF offset: 128, stride: 4, Device ID: 1520
285
+  #          VF offset: 128, stride: 4, Device ID: 10ed
286 286
   #          Supported Page Size: 00000553, System Page Size: 00000001
287 287
   #          Region 0: Memory at 0000000090040000 (64-bit, prefetchable)
288 288
   #          Region 3: Memory at 0000000090060000 (64-bit, prefetchable)
@@ -295,7 +295,7 @@ class NodeAgent
295 295
       sriov["available"] = true
296 296
       sriov["sriov_totalvfs"] = lspci.scan(/\s+Total\s+VFs:\s+(\d+)/).last.first.to_i - 1
297 297
       vf_vendor = File.read("/sys/class/net/#{int}/device/vendor").chomp.gsub(/^0x/, '')
298
-      vf_device = lspci.scan(/VF\s+.*\s+Device\s+ID:\s+(\d+)/).last.first
298
+      vf_device = lspci.scan(/VF\s+.*\s+Device\s+ID:\s+([A-Fa-f0-9]+)/).last.first
299 299
       sriov["pci_id"] = "#{vf_vendor}:#{vf_device}"
300 300
     end
301 301
     sriov

Loading…
Cancel
Save