From 398bd2e9a2fa3d5e0d783499b29d66c96c695848 Mon Sep 17 00:00:00 2001 From: Vladimir Eremin Date: Wed, 23 Mar 2016 21:36:37 +0300 Subject: [PATCH] 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 --- agent | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/agent b/agent index 21a9491..982e054 100755 --- a/agent +++ b/agent @@ -282,7 +282,7 @@ class NodeAgent # IOVCtl: Enable- Migration- Interrupt- MSE- ARIHierarchy- # IOVSta: Migration- # Initial VFs: 8, Total VFs: 8, Number of VFs: 0, Function Dependency Link: 01 - # VF offset: 128, stride: 4, Device ID: 1520 + # VF offset: 128, stride: 4, Device ID: 10ed # Supported Page Size: 00000553, System Page Size: 00000001 # Region 0: Memory at 0000000090040000 (64-bit, prefetchable) # Region 3: Memory at 0000000090060000 (64-bit, prefetchable) @@ -295,7 +295,7 @@ class NodeAgent sriov["available"] = true sriov["sriov_totalvfs"] = lspci.scan(/\s+Total\s+VFs:\s+(\d+)/).last.first.to_i - 1 vf_vendor = File.read("/sys/class/net/#{int}/device/vendor").chomp.gsub(/^0x/, '') - vf_device = lspci.scan(/VF\s+.*\s+Device\s+ID:\s+(\d+)/).last.first + vf_device = lspci.scan(/VF\s+.*\s+Device\s+ID:\s+([A-Fa-f0-9]+)/).last.first sriov["pci_id"] = "#{vf_vendor}:#{vf_device}" end sriov