Merge "Follow-up to the IntelIPMIHardware patch"
This commit is contained in:
commit
aded2c8b31
@ -18,17 +18,15 @@ Intel SST-PP supports three configuration levels:
|
|||||||
* 2 - Intel SST-PP Config 2
|
* 2 - Intel SST-PP Config 2
|
||||||
|
|
||||||
The following table shows the list of active cores and their base frequency at
|
The following table shows the list of active cores and their base frequency at
|
||||||
different SST-PP config levels::
|
different SST-PP config levels:
|
||||||
|
|
||||||
+-------------+---------+-------------------+
|
============== ========= ===================
|
||||||
| Config | Cores | Base Freq (GHz) |
|
Config Cores Base Freq (GHz)
|
||||||
+=============+=========+===================+
|
============== ========= ===================
|
||||||
| Base | 24 | 2.4 |
|
Base 24 2.4
|
||||||
+-------------+---------+-------------------+
|
Config 1 20 2.5
|
||||||
| Config 1 | 20 | 2.5 |
|
Config 2 16 2.7
|
||||||
+-------------+---------+-------------------+
|
============== ========= ===================
|
||||||
| Config 2 | 16 | 2.7 |
|
|
||||||
+-------------+---------+-------------------+
|
|
||||||
|
|
||||||
This configuration is managed by the management interface ``intel-ipmitool``
|
This configuration is managed by the management interface ``intel-ipmitool``
|
||||||
for IntelIPMI hardware.
|
for IntelIPMI hardware.
|
||||||
@ -95,7 +93,7 @@ A node with Intel SST-PP can be configured to use it via
|
|||||||
|
|
||||||
* ``intel_speedselect_config``:
|
* ``intel_speedselect_config``:
|
||||||
Hexadecimal code of Intel SST-PP configuration. Accepted values are
|
Hexadecimal code of Intel SST-PP configuration. Accepted values are
|
||||||
['0x00', '0x01', '0x02']. These values correspond to
|
'0x00', '0x01', '0x02'. These values correspond to
|
||||||
`Intel SST-PP Config Base`, `Intel SST-PP Config 1`,
|
`Intel SST-PP Config Base`, `Intel SST-PP Config 1`,
|
||||||
`Intel SST-PP Config 2` respectively. The input value must be a string.
|
`Intel SST-PP Config 2` respectively. The input value must be a string.
|
||||||
|
|
||||||
|
@ -42,7 +42,7 @@ class IntelIPMIManagement(ipmitool.IPMIManagement):
|
|||||||
socket_count = int(sockets)
|
socket_count = int(sockets)
|
||||||
if socket_count <= 0:
|
if socket_count <= 0:
|
||||||
raise ValueError
|
raise ValueError
|
||||||
except ValueError:
|
except (ValueError, TypeError):
|
||||||
raise exception.InvalidParameterValue(_(
|
raise exception.InvalidParameterValue(_(
|
||||||
"Invalid number of socket %(socket)s value specified. "
|
"Invalid number of socket %(socket)s value specified. "
|
||||||
"Expected a positive integer.") % {"socket": sockets})
|
"Expected a positive integer.") % {"socket": sockets})
|
||||||
@ -51,8 +51,8 @@ class IntelIPMIManagement(ipmitool.IPMIManagement):
|
|||||||
'intel_speedselect_config': {
|
'intel_speedselect_config': {
|
||||||
'description': (
|
'description': (
|
||||||
"Hexadecimal code of Intel SST-PP configuration provided. "
|
"Hexadecimal code of Intel SST-PP configuration provided. "
|
||||||
"Input value should be string. Accepted values are "
|
"Input value should be string. Accepted values are %s."
|
||||||
"['0x00', '0x01', '0x02']. "
|
% ', '.join(INTEL_SST_PP_CONFIG_HEXA_CODES)
|
||||||
),
|
),
|
||||||
'required': True
|
'required': True
|
||||||
},
|
},
|
||||||
@ -70,17 +70,15 @@ class IntelIPMIManagement(ipmitool.IPMIManagement):
|
|||||||
"for node %(node)s with socket count %(socket)s",
|
"for node %(node)s with socket count %(socket)s",
|
||||||
{"config": config, "node": task.node.uuid,
|
{"config": config, "node": task.node.uuid,
|
||||||
"socket": socket_count})
|
"socket": socket_count})
|
||||||
self._configure_intel_speed_select(task, config, socket_count)
|
|
||||||
|
|
||||||
def _configure_intel_speed_select(self, task, config, socket_count):
|
|
||||||
iss_conf = "0x2c 0x41 0x04 0x00 0x0%s %s"
|
iss_conf = "0x2c 0x41 0x04 0x00 0x0%s %s"
|
||||||
for socket in range(socket_count):
|
for socket in range(socket_count):
|
||||||
hexa_code = iss_conf % (socket, config)
|
hexa_code = iss_conf % (socket, config)
|
||||||
try:
|
try:
|
||||||
ipmitool.send_raw(task, hexa_code)
|
ipmitool.send_raw(task, hexa_code)
|
||||||
except exception.IPMIFailure as e:
|
except exception.IPMIFailure as e:
|
||||||
msg = ("Failed to set Intel SST-PP configuration level "
|
msg = (_("Failed to set Intel SST-PP configuration level "
|
||||||
"%(cfg)s on socket number %(skt)s due to reason "
|
"%(cfg)s on socket number %(skt)s due to "
|
||||||
"%(exc)s." % {"cfg": config, "skt": socket, "exc": e})
|
"reason %(exc)s.") % {"cfg": config,
|
||||||
LOG.exception(msg)
|
"skt": socket, "exc": e})
|
||||||
|
LOG.error(msg)
|
||||||
raise exception.IPMIFailure(message=msg)
|
raise exception.IPMIFailure(message=msg)
|
||||||
|
@ -64,11 +64,11 @@ class IntelIPMIManagementTestCase(base.IntelIPMITestCase):
|
|||||||
send_raw_mock.side_effect = exception.IPMIFailure('err')
|
send_raw_mock.side_effect = exception.IPMIFailure('err')
|
||||||
config = {"intel_speedselect_config": "0x02", "socket_count": 1}
|
config = {"intel_speedselect_config": "0x02", "socket_count": 1}
|
||||||
with task_manager.acquire(self.context, self.node.uuid) as task:
|
with task_manager.acquire(self.context, self.node.uuid) as task:
|
||||||
e = self.assertRaises(
|
self.assertRaisesRegex(
|
||||||
exception.IPMIFailure,
|
exception.IPMIFailure,
|
||||||
|
"Failed to set Intel SST-PP configuration",
|
||||||
task.driver.management.configure_intel_speedselect,
|
task.driver.management.configure_intel_speedselect,
|
||||||
task, **config)
|
task, **config)
|
||||||
self.assertIn("Failed to set Intel SST-PP configuration", str(e))
|
|
||||||
|
|
||||||
def test_configure_intel_speedselect_invalid_input(self):
|
def test_configure_intel_speedselect_invalid_input(self):
|
||||||
config = {"intel_speedselect_config": "0", "socket_count": 1}
|
config = {"intel_speedselect_config": "0", "socket_count": 1}
|
||||||
@ -77,10 +77,11 @@ class IntelIPMIManagementTestCase(base.IntelIPMITestCase):
|
|||||||
exception.InvalidParameterValue,
|
exception.InvalidParameterValue,
|
||||||
task.driver.management.configure_intel_speedselect,
|
task.driver.management.configure_intel_speedselect,
|
||||||
task, **config)
|
task, **config)
|
||||||
|
for value in (-1, None):
|
||||||
config = {"intel_speedselect_config": "0x00", "socket_count": -1}
|
config = {"intel_speedselect_config": "0x00",
|
||||||
with task_manager.acquire(self.context, self.node.uuid) as task:
|
"socket_count": value}
|
||||||
self.assertRaises(
|
with task_manager.acquire(self.context, self.node.uuid) as task:
|
||||||
exception.InvalidParameterValue,
|
self.assertRaises(
|
||||||
task.driver.management.configure_intel_speedselect,
|
exception.InvalidParameterValue,
|
||||||
task, **config)
|
task.driver.management.configure_intel_speedselect,
|
||||||
|
task, **config)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user