Get number of maximum queues for NIC
It's needed for configure multiq for dpdk
Change-Id: Iffa1a6c872b46230de6e9ab3b8f34cb727661571
Partial-Bug: #1643920
(cherry picked from commit 8ed8caf30a
)
This commit is contained in:
parent
27ad2910a4
commit
f7169a9314
22
agent
22
agent
|
@ -581,6 +581,26 @@ class NodeAgent
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def _get_max_queues(ifname)
|
||||||
|
data = `ethtool -l #{ifname}`
|
||||||
|
# Example of output to parse:
|
||||||
|
# Channel parameters for ens4f0:
|
||||||
|
# Pre-set maximums:
|
||||||
|
# RX: 0
|
||||||
|
# TX: 0
|
||||||
|
# Other: 1
|
||||||
|
# Combined: 63
|
||||||
|
# Current hardware settings:
|
||||||
|
# RX: 0
|
||||||
|
# TX: 0
|
||||||
|
# Other: 1
|
||||||
|
# Combined: 40
|
||||||
|
return nil if $?.to_i != 0
|
||||||
|
return data.scan(/Pre-set maximums:.*?Combined:\s*(\d+)/m).join.to_i
|
||||||
|
rescue
|
||||||
|
return nil
|
||||||
|
end
|
||||||
|
|
||||||
def _detailed
|
def _detailed
|
||||||
detailed_meta = {
|
detailed_meta = {
|
||||||
:system => _system_info,
|
:system => _system_info,
|
||||||
|
@ -684,6 +704,8 @@ class NodeAgent
|
||||||
int_meta[:interface_properties][:pci_id] = nic_pci_id(int)
|
int_meta[:interface_properties][:pci_id] = nic_pci_id(int)
|
||||||
# Get numa node
|
# Get numa node
|
||||||
int_meta[:interface_properties][:numa_node] = nic_numa_node(int_meta[:bus_info])
|
int_meta[:interface_properties][:numa_node] = nic_numa_node(int_meta[:bus_info])
|
||||||
|
# Get maximum queues
|
||||||
|
int_meta[:interface_properties][:max_queues] = _get_max_queues(int)
|
||||||
detailed_meta[:interfaces] << int_meta
|
detailed_meta[:interfaces] << int_meta
|
||||||
end
|
end
|
||||||
rescue Exception => e
|
rescue Exception => e
|
||||||
|
|
Loading…
Reference in New Issue