summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVladimir Eremin <veremin@mirantis.com>2017-01-11 21:56:06 +0300
committerVladimir Eremin <veremin@mirantis.com>2017-01-12 18:19:42 +0300
commit0a306b1dc7021ec41b2947e6efa53be7c4075a9c (patch)
tree409772ffab5b0eef826110df97925e98bc70a8ae
parent8ed8caf30a2c9ef63bfbb5f653271cd77eb5f823 (diff)
Read device PCIID instead of subsystem one
For some devices like Virtio network device [1af4:1000], there is invalid PCIID in /sys/class/net. Change-Id: I3bc514c2d57e3a7669c418e49830491041cb8f52 Closes-Bug: #1655733
Notes
Notes (review): Code-Review+2: Vladimir Kuklin <vkuklin@mirantis.com> Code-Review+2: Vladimir Kozhukalov <vkozhukalov@mirantis.com> Workflow+1: Vladimir Kozhukalov <vkozhukalov@mirantis.com> Verified+2: Jenkins Submitted-by: Jenkins Submitted-at: Thu, 12 Jan 2017 15:41:25 +0000 Reviewed-on: https://review.openstack.org/419087 Project: openstack/fuel-nailgun-agent Branch: refs/heads/master
-rwxr-xr-xagent8
1 files changed, 4 insertions, 4 deletions
diff --git a/agent b/agent
index b713b7b..0c56264 100755
--- a/agent
+++ b/agent
@@ -511,9 +511,9 @@ class NodeAgent
511 DEFAULT_SRIOV 511 DEFAULT_SRIOV
512 end 512 end
513 513
514 def nic_pci_id(int) 514 def nic_pci_id(bus_info)
515 vendor = File.read("/sys/class/net/#{int}/device/vendor").chomp.gsub(/^0x/, '') 515 vendor = File.read("/sys/bus/pci/devices/#{bus_info}/vendor").chomp.gsub(/^0x/, '')
516 device = File.read("/sys/class/net/#{int}/device/device").chomp.gsub(/^0x/, '') 516 device = File.read("/sys/bus/pci/devices/#{bus_info}/device").chomp.gsub(/^0x/, '')
517 "#{vendor}:#{device}" 517 "#{vendor}:#{device}"
518 rescue 518 rescue
519 "" 519 ""
@@ -701,7 +701,7 @@ class NodeAgent
701 # Getting SR-IOV info 701 # Getting SR-IOV info
702 int_meta[:interface_properties][:sriov] = sriov_info(int, int_meta[:bus_info]) 702 int_meta[:interface_properties][:sriov] = sriov_info(int, int_meta[:bus_info])
703 # Get PCI-ID 703 # Get PCI-ID
704 int_meta[:interface_properties][:pci_id] = nic_pci_id(int) 704 int_meta[:interface_properties][:pci_id] = nic_pci_id(int_meta[:bus_info])
705 # Get numa node 705 # Get numa node
706 int_meta[:interface_properties][:numa_node] = nic_numa_node(int_meta[:bus_info]) 706 int_meta[:interface_properties][:numa_node] = nic_numa_node(int_meta[:bus_info])
707 # Get maximum queues 707 # Get maximum queues